diff --git a/.github/workflows/release-sdks.yml b/.github/workflows/release-sdks.yml new file mode 100644 index 000000000..bdca6825d --- /dev/null +++ b/.github/workflows/release-sdks.yml @@ -0,0 +1,349 @@ +name: Release-SDKs + +# Consolidated, dispatch-only release pipeline for all five go-ios SDKs +# (typescript, python, java, csharp, mcp). They are generated from ONE OpenAPI +# spec, so they ship in lockstep: a single `version` input is stamped into every +# package manifest and published to every registry together. +# +# Safety model (mirrors the CLI release.yml): +# * Dispatch only. There is no tag/push trigger, so nothing here ever runs off +# a merge. `dry_run` defaults to true. +# * All build/test happens BEFORE any upload. If a single package fails to +# build or test, no publish job runs, so a bad build ships nothing. +# * Every real upload is gated twice: +# 1. `if: ${{ !inputs.dry_run }}` — a dry run does a real dry-run instead +# (npm --dry-run, twine check, mvn verify, dotnet pack) with NO upload. +# 2. a secret/trust-presence guard — even a non-dry run SKIPS the upload, +# with a clear log line, when the registry isn't armed yet. This makes +# the first real run safe to do before the registries exist. +# * The git tag + GitHub release are created only after every publish job +# succeeds AND it was not a dry run. +# +# Auth (see sdks/docs/RELEASING.md for the registry prerequisites): +# * npm — OIDC trusted publishing (id-token: write, provenance). NO token. +# * PyPI — trusted publishing via pypa/gh-action-pypi-publish (id-token). +# * Maven — central-publishing-maven-plugin + GPG (MAVEN_GPG_PRIVATE_KEY, +# MAVEN_GPG_PASSPHRASE, CENTRAL_TOKEN_USERNAME, CENTRAL_TOKEN_PASSWORD). +# * NuGet — dotnet nuget push with NUGET_API_KEY. + +on: + workflow_dispatch: + inputs: + version: + description: "SDK version to release (semver, e.g. 0.1.0). Stamped into all five package manifests." + required: true + type: string + dry_run: + description: "Dry run: build/test + real dry-run of every publish, but upload nothing and create no tag/release." + required: true + default: true + type: boolean + +permissions: + contents: read + +jobs: + # --- Stamp the version into every manifest and hand the tree to build jobs --- + prepare: + runs-on: ubuntu-latest + outputs: + version: ${{ steps.setv.outputs.version }} + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: "22" + + - name: Stamp version into all package manifests + id: setv + run: | + set -euo pipefail + bash sdks/scripts/set-version.sh "${{ inputs.version }}" + echo "version=${{ inputs.version }}" >> "$GITHUB_OUTPUT" + + - name: Upload version-stamped sdks tree + uses: actions/upload-artifact@v4 + with: + name: sdks-stamped + path: sdks/ + include-hidden-files: true + retention-days: 1 + + # ----------------------------- BUILD + TEST ------------------------------- + # Mirrors sdks.yml. All five must pass before any publish job starts. + build-typescript: + needs: prepare + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4 + with: { name: sdks-stamped, path: sdks } + - uses: actions/setup-node@v4 + with: { node-version: "22" } + - name: build + test (typescript) + working-directory: sdks/packages/typescript + run: | + npm ci + npx tsc --noEmit + npm run build + npm test + + build-mcp: + needs: prepare + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4 + with: { name: sdks-stamped, path: sdks } + - uses: actions/setup-node@v4 + with: { node-version: "22" } + - name: build + test (mcp) + working-directory: sdks/packages/mcp + run: | + npm ci + npx tsc --noEmit + npm run build + npm test + + build-python: + needs: prepare + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4 + with: { name: sdks-stamped, path: sdks } + - name: Install uv + uses: astral-sh/setup-uv@v5 + - name: build + test (python) + working-directory: sdks/packages/python + run: | + uv python install 3.13 + uv sync --all-extras --dev + uv run pytest + uv run mypy src/go_ios_sdk --exclude '_generated' + + build-csharp: + needs: prepare + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4 + with: { name: sdks-stamped, path: sdks } + - uses: actions/setup-dotnet@v4 + with: { dotnet-version: "8.0.x" } + - name: build + test (csharp) + working-directory: sdks/packages/csharp + run: | + dotnet build -c Release + dotnet test -c Release --no-build + + build-java: + needs: prepare + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4 + with: { name: sdks-stamped, path: sdks } + - uses: actions/setup-java@v4 + with: { distribution: temurin, java-version: "17" } + - name: build + test (java) + working-directory: sdks/packages/java + run: bash scripts/verify.sh + + # ------------------------------- PUBLISH ---------------------------------- + # Each ecosystem publishes independently, but only after ALL builds pass. + # dry_run -> real dry-run (no upload). Non-dry -> real upload, still guarded + # by a registry-armed check so it self-skips until the registry is configured. + + publish-npm: + needs: [prepare, build-typescript, build-mcp, build-python, build-csharp, build-java] + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write # OIDC trusted publishing / provenance. NO token. + env: + NPM_CONFIG_PROVENANCE: "true" + steps: + - uses: actions/download-artifact@v4 + with: { name: sdks-stamped, path: sdks } + # OIDC trusted publishing needs Node >= 22.14 and npm >= 11.5.1. + - uses: actions/setup-node@v4 + with: + node-version: "22" + registry-url: "https://registry.npmjs.org" + - name: Prepare npm + build (typescript) + working-directory: sdks/packages/typescript + run: | + npm install -g npm@latest + npm ci + npm run build + # Dry run: exercises packing/publish end to end without uploading. + - name: npm publish --dry-run (dry_run) + if: ${{ inputs.dry_run }} + working-directory: sdks/packages/typescript + run: npm publish --dry-run --access public + # Real publish. OIDC is only available when id-token is issued for this + # run (ACTIONS_ID_TOKEN_REQUEST_URL is set). If it isn't — e.g. the org / + # trusted publisher isn't configured yet — skip loudly instead of failing. + - name: npm publish (OIDC) + if: ${{ !inputs.dry_run }} + working-directory: sdks/packages/typescript + run: | + set -euo pipefail + if [ -z "${ACTIONS_ID_TOKEN_REQUEST_URL:-}" ]; then + echo "::warning::npm OIDC context not available — skipping real npm publish. Configure the @go-ios org + OIDC trusted publisher first (see sdks/docs/RELEASING.md)." + exit 0 + fi + # No NODE_AUTH_TOKEN / .npmrc auth line: npm authenticates via OIDC + # trusted publishing. Any (even empty) token would break OIDC. + npm publish --access public + # @go-ios/mcp ships to npm alongside the TypeScript SDK (same OIDC trusted + # publishing + provenance). Guarded identically to the TS publish above. + - name: Prepare + build (mcp) + working-directory: sdks/packages/mcp + run: | + npm ci + npm run build + - name: npm publish --dry-run (mcp, dry_run) + if: ${{ inputs.dry_run }} + working-directory: sdks/packages/mcp + run: npm publish --dry-run --access public + - name: npm publish (mcp, OIDC) + if: ${{ !inputs.dry_run }} + working-directory: sdks/packages/mcp + run: | + set -euo pipefail + if [ -z "${ACTIONS_ID_TOKEN_REQUEST_URL:-}" ]; then + echo "::warning::npm OIDC context not available — skipping real @go-ios/mcp publish. Configure the @go-ios org + OIDC trusted publisher first (see sdks/docs/RELEASING.md)." + exit 0 + fi + # No NODE_AUTH_TOKEN / .npmrc auth line: OIDC trusted publishing only. + npm publish --access public + + publish-pypi: + needs: [prepare, build-typescript, build-mcp, build-python, build-csharp, build-java] + runs-on: ubuntu-latest + environment: pypi + permissions: + contents: read + id-token: write # PyPI trusted publishing. NO token. + # `secrets` cannot be used in an `if:` expression, so map the trust-armed + # flag into env once and gate on env.* instead. + env: + PYPI_ARMED: ${{ secrets.PYPI_TRUSTED_PUBLISHER_CONFIGURED }} + steps: + - uses: actions/download-artifact@v4 + with: { name: sdks-stamped, path: sdks } + - name: Install uv + uses: astral-sh/setup-uv@v5 + - name: Build sdist + wheel + working-directory: sdks/packages/python + run: | + uv python install 3.12 + uv build --sdist --wheel + # Dry run: build + metadata validation, no upload. + - name: twine check (dry_run) + if: ${{ inputs.dry_run }} + working-directory: sdks/packages/python + run: uvx twine check dist/* + # Real publish via trusted publishing. Only reached when the + # PYPI_TRUSTED_PUBLISHER_CONFIGURED repo secret is set, so the first real + # run before the trusted publisher exists self-skips. + - name: Publish to PyPI (trusted publishing) + if: ${{ !inputs.dry_run && env.PYPI_ARMED != '' }} + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: sdks/packages/python/dist + - name: Note if PyPI publish skipped + if: ${{ !inputs.dry_run && env.PYPI_ARMED == '' }} + run: echo "::warning::PYPI_TRUSTED_PUBLISHER_CONFIGURED not set — skipping real PyPI publish. Create the PyPI project + trusted publisher, then set that repo secret (see sdks/docs/RELEASING.md)." + + publish-maven: + needs: [prepare, build-typescript, build-mcp, build-python, build-csharp, build-java] + runs-on: ubuntu-latest + # `secrets` cannot be used in an `if:` expression; map the arm-check into env. + # MAVEN_ARMED is non-empty only when all three required secrets are present. + env: + MAVEN_GPG_PRIVATE_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + CENTRAL_TOKEN_USERNAME: ${{ secrets.CENTRAL_TOKEN_USERNAME }} + CENTRAL_TOKEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN_PASSWORD }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + MAVEN_ARMED: ${{ (secrets.MAVEN_GPG_PRIVATE_KEY != '' && secrets.CENTRAL_TOKEN_USERNAME != '' && secrets.CENTRAL_TOKEN_PASSWORD != '') && 'yes' || '' }} + steps: + - uses: actions/download-artifact@v4 + with: { name: sdks-stamped, path: sdks } + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: "17" + # Configure ~/.m2/settings.xml server "central" from these env-var + # secrets so the central-publishing-maven-plugin can authenticate. + server-id: central + server-username: CENTRAL_TOKEN_USERNAME + server-password: CENTRAL_TOKEN_PASSWORD + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE + # Dry run: full verify (compile, test, package) with NO deploy. + - name: mvn verify (dry_run — no deploy) + if: ${{ inputs.dry_run }} + working-directory: sdks/packages/java + run: mvn -B -ntp verify + # Real deploy — only when the Central token + GPG key secrets all exist. + - name: mvn deploy to Maven Central + if: ${{ !inputs.dry_run && env.MAVEN_ARMED != '' }} + working-directory: sdks/packages/java + run: mvn -B -ntp -Prelease clean deploy + - name: Note if Maven publish skipped + if: ${{ !inputs.dry_run && env.MAVEN_ARMED == '' }} + run: echo "::warning::Maven Central secrets not set (need MAVEN_GPG_PRIVATE_KEY + CENTRAL_TOKEN_USERNAME/PASSWORD) — skipping real Maven deploy (see sdks/docs/RELEASING.md)." + + publish-nuget: + needs: [prepare, build-typescript, build-mcp, build-python, build-csharp, build-java] + runs-on: ubuntu-latest + # `secrets` cannot be used in an `if:` expression; map the key into env. + env: + NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} + steps: + - uses: actions/download-artifact@v4 + with: { name: sdks-stamped, path: sdks } + - uses: actions/setup-dotnet@v4 + with: { dotnet-version: "8.0.x" } + - name: Pack (Release) + working-directory: sdks/packages/csharp + run: dotnet pack src/GoIos.Sdk/GoIos.Sdk.csproj --configuration Release --output ../../artifacts + # dotnet pack above IS the dry-run artifact build; nothing to upload on dry. + - name: Note (dry_run — packed, not pushed) + if: ${{ inputs.dry_run }} + run: 'echo "dry_run: packed nupkg but not pushing to NuGet."' + - name: Push to NuGet + if: ${{ !inputs.dry_run && env.NUGET_API_KEY != '' }} + run: | + dotnet nuget push "sdks/artifacts/*.nupkg" \ + --api-key "$NUGET_API_KEY" \ + --source https://api.nuget.org/v3/index.json \ + --skip-duplicate + - name: Note if NuGet publish skipped + if: ${{ !inputs.dry_run && env.NUGET_API_KEY == '' }} + run: echo "::warning::NUGET_API_KEY not set — skipping real NuGet push. Create the package id + NUGET_API_KEY secret (see sdks/docs/RELEASING.md)." + + # ------------------------- TAG + GITHUB RELEASE --------------------------- + # Only after every publish job succeeds AND this was not a dry run. This is the + # single mutating step against the repo, so an earlier failure leaves no tag. + tag-and-release: + needs: [prepare, publish-npm, publish-pypi, publish-maven, publish-nuget] + if: ${{ !inputs.dry_run }} + runs-on: ubuntu-latest + permissions: + contents: write + env: + VERSION: ${{ needs.prepare.outputs.version }} + steps: + - uses: actions/checkout@v4 + - name: Create SDK tag + GitHub release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + set -euo pipefail + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git tag "sdk-v${VERSION}" + git push origin "sdk-v${VERSION}" + gh release create "sdk-v${VERSION}" \ + --title "SDKs v${VERSION}" \ + --notes "go-ios SDKs v${VERSION} (typescript, python, java, csharp; mcp bundled). Lockstep release generated from sdks/spec/openapi/openapi.yaml." diff --git a/.github/workflows/sdks.yml b/.github/workflows/sdks.yml new file mode 100644 index 000000000..4fb930c90 --- /dev/null +++ b/.github/workflows/sdks.yml @@ -0,0 +1,136 @@ +name: SDKs CI + +# Validation only (spec compile + per-package build/test) for the SDKs under +# sdks/. Publishing is handled by the separate, dispatch-only release-sdks.yml +# (lockstep: all five SDKs share one version and ship together). +on: + pull_request: + paths: + - "sdks/**" + push: + branches: [main] + paths: + - "sdks/**" + +jobs: + spec: + name: TypeSpec compiles + OpenAPI 3.1 is emitted + runs-on: ubuntu-latest + defaults: + run: + working-directory: sdks/spec + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: "22" + cache: npm + cache-dependency-path: sdks/spec/package-lock.json + - name: Install spec dependencies + run: npm ci + - name: Compile TypeSpec -> OpenAPI + run: npx tsp compile . + - name: Verify OpenAPI 3.1 output exists + run: | + test -f openapi/openapi.3.1.0.yaml + head -1 openapi/openapi.3.1.0.yaml | grep -q 'openapi: 3.1.0' + - name: Verify committed spec is up to date + run: | + cp openapi/openapi.3.1.0.yaml openapi/openapi.yaml + cp openapi/openapi.3.1.0.json openapi/openapi.json + git diff --exit-code -- openapi/ \ + || (echo "::error::sdks/spec/openapi is out of date — run scripts/regen.sh and commit" && exit 1) + + typescript: + name: TypeScript SDK build + test + runs-on: ubuntu-latest + defaults: + run: + working-directory: sdks/packages/typescript + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: "22" + cache: npm + cache-dependency-path: sdks/packages/typescript/package-lock.json + - run: npm ci + - run: npx tsc --noEmit + - run: npm run build + - run: npm test + + mcp: + name: MCP server build + test + runs-on: ubuntu-latest + defaults: + run: + working-directory: sdks/packages/mcp + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: "22" + cache: npm + cache-dependency-path: sdks/packages/mcp/package-lock.json + - run: npm ci + - run: npx tsc --noEmit + - run: npm run build + - run: npm test + # Device-free pre-release gate: the list-tools example spawns the built + # MCP server over stdio and asserts the exact curated 44-tool set. It needs + # no device and no daemon (call-tool auto-skips without GO_IOS_API_KEY), so + # a broken MCP server fails CI here. See sdks/docs/EXAMPLES.md. + - name: MCP examples smoke test (list-tools, device-free) + run: npm run examples + + python: + name: Python SDK test (3.9-3.13) + types + runs-on: ubuntu-latest + defaults: + run: + working-directory: sdks/packages/python + strategy: + matrix: + python-version: ["3.9", "3.13"] + steps: + - uses: actions/checkout@v4 + - name: Install uv + uses: astral-sh/setup-uv@v5 + - name: Set up Python ${{ matrix.python-version }} + run: uv python install ${{ matrix.python-version }} + - name: Sync deps + run: uv sync --all-extras --dev + - name: Test + run: uv run pytest + - name: Type check (facade) + run: uv run mypy src/go_ios_sdk --exclude '_generated' + continue-on-error: false + + csharp: + name: C# SDK build + test + runs-on: ubuntu-latest + defaults: + run: + working-directory: sdks/packages/csharp + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-dotnet@v4 + with: + dotnet-version: "8.0.x" + - run: dotnet build -c Release + - run: dotnet test -c Release --no-build + + java: + name: Java SDK compile + test + runs-on: ubuntu-latest + defaults: + run: + working-directory: sdks/packages/java + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: "17" + - name: Compile + test (javac + JUnit console) + run: bash scripts/verify.sh diff --git a/.github/workflows/verify-sdk-examples.yml b/.github/workflows/verify-sdk-examples.yml new file mode 100644 index 000000000..635c20d83 --- /dev/null +++ b/.github/workflows/verify-sdk-examples.yml @@ -0,0 +1,111 @@ +# Verify SDK examples against a real go-ios REST daemon + device. +# +# ┌───────────────────────────────────────────────────────────────────────────┐ +# │ NOT YET ACTIVE. This workflow is dispatch-only (workflow_dispatch) and is │ +# │ INERT until the full go-ios REST daemon is deployable on the self-hosted │ +# │ farm. The feature-complete REST daemon is NOT on `main` yet — it lands with │ +# │ PRs #817 / #821 (restapi on `main` today is minimal). Do NOT try to build │ +# │ or start the daemon from `main` here; the "Start go-ios REST daemon" step │ +# │ below is a documented PLACEHOLDER describing the command to fill in once │ +# │ #817 / #821 have merged and the daemon can run on office01 / ganjalf. │ +# └───────────────────────────────────────────────────────────────────────────┘ +# +# What it does once activated: given a reachable go-ios REST daemon +# (GO_IOS_BASE_URL) authenticated with the GO_IOS_API_KEY secret, and a real +# device attached to the runner, it runs every SDK's example RUNNER in sequence +# and fails if any exits non-zero. This is the device-dependent counterpart to +# the always-on, device-free MCP list-tools gate in sdks.yml. +# +# Shared env convention (see sdks/docs/EXAMPLES.md): +# GO_IOS_BASE_URL origin of the daemon (default http://localhost:8080) +# GO_IOS_API_KEY bearer token (repo secret) +# GO_IOS_UDID optional; first attached device is used when unset +# RUN_UI set to 1 to also run the mutating UI-automation examples +# +# Trigger: dispatch-only for now. Once the daemon can run on the farm, this can +# also be wired as a `workflow_call` pre-release gate from release-sdks.yml. + +name: Verify SDK examples (device farm) + +on: + workflow_dispatch: + inputs: + run_ui: + description: "Also run the mutating UI-automation examples (RUN_UI=1)" + type: boolean + default: false + +# Until the daemon lands on the farm this job has no self-hosted target to run +# on and is expected to stay unused. Kept dispatch-only so it never blocks CI. +jobs: + verify: + name: Run every SDK example runner against a live daemon + # Runs on the self-hosted device farm (office01 / ganjalf), reusing the same + # runner labels as real-device.yml. Until #817/#821 land and the daemon is + # deployable there, do not dispatch this. + runs-on: [self-hosted, macOS] + env: + GO_IOS_BASE_URL: ${{ vars.GO_IOS_BASE_URL || 'http://localhost:8080' }} + GO_IOS_API_KEY: ${{ secrets.GO_IOS_API_KEY }} + RUN_UI: ${{ inputs.run_ui && '1' || '' }} + steps: + - uses: actions/checkout@v4 + + # ───────────────────────────────────────────────────────────────────── + # PLACEHOLDER — activate once the full REST daemon is on main (#817/#821). + # + # The daemon does not exist on `main` yet, so we cannot build/start it + # here. When it lands, replace this step with something like: + # + # - name: Build & start go-ios REST daemon + # run: | + # go build -o /tmp/ios ./ + # /tmp/ios api --api-key "$GO_IOS_API_KEY" --addr :8080 & + # # wait until GET $GO_IOS_BASE_URL/health responds + # for i in $(seq 1 30); do + # curl -fsS -H "Authorization: Bearer $GO_IOS_API_KEY" \ + # "$GO_IOS_BASE_URL/api/v1/health" && break || sleep 1 + # done + # + # (Default bind address is :8080 — see restapi/api/server.go and + # sdks/docs/EXAMPLES.md.) + # ───────────────────────────────────────────────────────────────────── + - name: Start go-ios REST daemon (PLACEHOLDER — see #817/#821) + run: | + echo "::error::verify-sdk-examples is inert until the full go-ios REST daemon lands on main (#817/#821)." + echo "Fill in the daemon-start step above and remove this guard once the daemon is deployable on the farm." + exit 1 + + # --- Language toolchains (kept ready for when the gate above is removed) --- + - uses: actions/setup-node@v4 + with: + node-version: "22" + - uses: astral-sh/setup-uv@v5 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: "17" + - uses: actions/setup-dotnet@v4 + with: + dotnet-version: "8.0.x" + + # --- Run each SDK's example runner; any non-zero exit fails the job --- + - name: TypeScript examples + working-directory: sdks/packages/typescript + run: npm ci && npm run examples + + - name: Python examples + working-directory: sdks/packages/python + run: uv sync --all-extras && uv run python examples/run_all.py + + - name: Java examples + working-directory: sdks/packages/java + run: bash examples/run.sh + + - name: C# examples + working-directory: sdks/packages/csharp + run: dotnet run --project examples/GoIos.Examples -- run-all + + - name: MCP examples (list-tools + call-tool against the live daemon) + working-directory: sdks/packages/mcp + run: npm ci && npm run build && npm run examples diff --git a/README.md b/README.md index a8b67ca51..02d54a56d 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,10 @@ If you miss something your Mac can do but go-iOS can't, just request a feature i Go-iOS is getting an experimental REST-API check it out [https://github.com/danielpaulus/go-ios/tree/main/restapi](https://github.com/danielpaulus/go-ios/tree/main/restapi) +# SDKs & MCP + +Official client SDKs for the REST-API and an MCP server live in-tree under [`sdks/`](sdks/). They are generated from a TypeSpec source that emits an OpenAPI 3.1 spec ([`sdks/spec/`](sdks/spec/)), with client packages for Python, TypeScript, Java, and C#, plus an MCP server under [`sdks/packages/`](sdks/packages/). See [`sdks/README.md`](sdks/README.md) and [`sdks/PROJECT-STATUS.md`](sdks/PROJECT-STATUS.md) for details. + # Design principles: 1. Using golang to compile static, small and fast binaries for all platforms very easily. diff --git a/sdks/.gitignore b/sdks/.gitignore new file mode 100644 index 000000000..c7fc2acca --- /dev/null +++ b/sdks/.gitignore @@ -0,0 +1,39 @@ +# Node / TypeScript +node_modules/ +dist/ +build/ +*.tsbuildinfo +.npmrc + +# TypeSpec emitter scratch output (canonical output lives in spec/openapi/, committed) +tsp-output/ + +# Python +__pycache__/ +*.py[cod] +.venv/ +venv/ +.env +*.egg-info/ +.pytest_cache/ +.mypy_cache/ +.ruff_cache/ + +# Java +target/ +*.class +.gradle/ + +# C# / .NET +bin/ +obj/ +*.user + +# Generated SDK code (regenerated from spec; not committed until Phase B decides) +generated/ + +# Editor / OS +.DS_Store +.idea/ +.vscode/ +*.log diff --git a/sdks/PROJECT-STATUS.md b/sdks/PROJECT-STATUS.md new file mode 100644 index 000000000..37f3768f3 --- /dev/null +++ b/sdks/PROJECT-STATUS.md @@ -0,0 +1,30 @@ +# go-ios SDKs + MCP — project status (2026-08-10) + +Built autonomously. **Local git repo at `/Users/danielpaulus/privaterepos/go-ios-sdks` — 31 commits on `main`, NOT pushed (no remote created), nothing published.** + +## What's here +- **spec/** — TypeSpec source of truth → OpenAPI 3.1 (`spec/openapi/openapi.yaml`). **80 operations / 65 paths**, 1:1 with the daemon's `/api/v1` surface (PR #817). Typed SSE via `@events` unions + `x-sse-events` extension (+ a 3.2 variant with inline itemSchema). API fixes baked in: `longtitude`→`longitude`, screenshot `image/png`, unified `GenericResponse` errors, real SSE. +- **packages/typescript** — `@go-ios/sdk` (hey-api client + facade), 38 tests. ESM+CJS via tsup, changesets, npm-provenance publish workflow. +- **packages/python** — `go-ios-sdk` (openapi-python-client + sync & async facades), 44 tests, mypy+ruff clean. uv + PyPI trusted-publishing (OIDC) workflow. +- **packages/java** — `com.github.danielpaulus:go-ios-sdk` (openapi-generator + facade), 32 tests (javac+JUnit; Maven Central pom). RawHttp for binary/multipart. +- **packages/csharp** — `GoIos.Sdk` (openapi-generator + async facade), 31 tests. NuGet publish workflow. +- **packages/mcp** — `@go-ios/mcp` (official MCP SDK), **31 curated tools**, stdio + Streamable-HTTP, 27 tests. +- **.github/workflows/ci.yml** — validates spec compile + every package build/test. Publishing is separate & gated (tag/dispatch), currently inert. + +## Cross-language facade (identical shape) +`IosClient(baseUrl, apiKey)` → `devices.list()` · `device(udid).{info,deviceName,date,battery,diagnostics,mobileGestalt,processes,lockdown,screenshot,activate,pair,reboot,shutdown,erase,devmode,lang,memlimitoff,conditions/enable/disable,images/installImage/unmountImage,profiles/addProfile/removeProfile,resetAccessibility,resetLocation,setLocation}` + sub-clients `apps`, `wda`, `files`, `crashes`, `media`, `settings`, `mdm`, `proxy`, `jobs` (device-scoped) + SSE streams `syslog/notifications/ostrace/listen/sysmontap` · `client.tunnels` (fleet-level). SSE = async iterators (TS/C#), async generators (Python), Iterable/AutoCloseable (Java). + +## Toolchain decisions (see docs/DESIGN.md, and scratchpad DECISION.md) +- Source of truth: **TypeSpec 1.0** (spec-first) → OpenAPI 3.1. OpenAPI is still the right IDL in 2026. +- Generators: **OSS-first** — hey-api (TS), openapi-python-client (Py), openapi-generator (Java/C#), official MCP SDK. Commercial rejected: Stainless (signups closed post-Anthropic-acquisition), Fern & Speakeasy (SSE + MCP paywalled / no 2-language free tier). +- Streaming: **SSE** for all log/event streams; WebSocket/mjpeg reserved for future interactive screen-mirror + input. +- MCP tools deliberately curated (not 1:1); omitted erase, raw file writes, MDM/system-config. + +## Depends on +The SDKs/MCP target the **full ~80-endpoint daemon = PR #817** (`feature/restapi-parity`). #817 is merge-ready (see go-ios repo). Until it merges, the SDKs describe endpoints that live on that branch. + +## Open items for Daniel +1. **Repo placement** — decide: new GitHub repo `go-ios-sdks`, or subtree in go-ios. Then push (I created no remote). +2. **Merge #817** — dismiss stale CodeQL alert #9 (`ncm/ncm.go`, pre-2024, unrelated) + re-run the macOS e2e syslog flake, then it's green. +3. **Publishing** — register `@go-ios` npm org, PyPI project, Maven Central namespace, NuGet id; wire OIDC/trusted-publishing; flip the (currently inert) publish workflows on. +4. Optional: push server-side to emit *real* SSE frames for the two legacy undelimited streams (/syslog, /listen) — spec already models it; small go-ios PR. diff --git a/sdks/README.md b/sdks/README.md new file mode 100644 index 000000000..7250cbdfd --- /dev/null +++ b/sdks/README.md @@ -0,0 +1,80 @@ +# go-ios SDKs + +Official SDKs and an MCP server for the [go-ios](https://github.com/danielpaulus/go-ios) +REST API, all generated from a single **spec-first source of truth**. + +The API is authored in [TypeSpec](https://typespec.io) and emitted to **OpenAPI 3.1**. +Every SDK and the MCP server generate from that one OpenAPI document, so the spec — +not any individual client — is canonical. The go-ios REST server conforms to this +spec (it is the *ideal* contract; there is no backward-compatibility constraint yet). + +## Targets + +| Package | Language / product | Generator | Status | +| --------------------- | ------------------ | -------------------------------------- | ----------- | +| `packages/typescript` | TypeScript SDK | `@hey-api/openapi-ts` | Phase B2 | +| `packages/python` | Python SDK | `openapi-python-client` (httpx) | Phase B3 | +| `packages/java` | Java SDK | `openapi-generator` (java) | Phase B | +| `packages/csharp` | C# SDK | `openapi-generator` (csharp) | Phase B | +| `packages/mcp` | MCP server | OSS openapi→mcp, **curated** tools | Phase B4 | + +Five delivery targets: **typescript, python, java, csharp, mcp**. + +## Layout + +``` +go-ios-sdks/ + spec/ # TypeSpec source of truth (authoritative) + main.tsp # service, auth, base path + models.tsp # data models + shared error responses + routes.tsp # all 26 operations + streaming.tsp # SSE event models + event unions + tspconfig.yaml # emits OpenAPI 3.1 (+ 3.2) to spec/openapi/ + openapi/ # generated OpenAPI (committed) + openapi.yaml # canonical OpenAPI 3.1 (downstream generators read this) + openapi.json # canonical OpenAPI 3.1, JSON + openapi.3.1.0.{yaml,json} # version-suffixed emitter output + openapi.3.2.0.{yaml,json} # 3.2 variant — full typed SSE itemSchema + packages/ + typescript/ python/ java/ csharp/ mcp/ # per-target (placeholders until Phase B) + scripts/regen.sh # regenerate everything from the spec + docs/DESIGN.md # locked decisions + SSE/streaming contract + .github/workflows/ # CI: spec compile check +``` + +## Examples + +Every SDK (and the MCP server) ships runnable, heavily-commented examples under +`packages//examples/`. They double as tutorials and as the pre-release +smoke test. See [`docs/EXAMPLES.md`](docs/EXAMPLES.md) for the per-language +index, the shared `GO_IOS_BASE_URL` / `GO_IOS_API_KEY` / `GO_IOS_UDID` / +`RUN_UI` convention, and how to run them all. + +## Regenerate everything + +```bash +scripts/regen.sh +``` + +Or just the spec: + +```bash +cd spec +npm install # first time only +npx tsp compile . # emits spec/openapi/openapi.3.1.0.{yaml,json} and 3.2.0 +``` + +`regen.sh` then copies the canonical 3.1 output to the stable `spec/openapi/openapi.{yaml,json}` +path that all downstream generators consume. + +## Authentication + +All routes under `/api/v1` require `Authorization: Bearer `. The +server refuses to start without a key unless launched with `--disable-auth`, in +which case the header may be omitted. See `docs/DESIGN.md`. + +## Streaming + +`/notifications`, `/syslog`, `/ostrace`, and `/listen` are real Server-Sent Events +(`text/event-stream`) with typed event payloads. The contract and event model +shapes are documented in `docs/DESIGN.md`. diff --git a/sdks/docs/DESIGN.md b/sdks/docs/DESIGN.md new file mode 100644 index 000000000..50c560314 --- /dev/null +++ b/sdks/docs/DESIGN.md @@ -0,0 +1,282 @@ +# go-ios SDKs — design & contracts + +This document captures the locked decisions and the exact streaming contract that +every downstream phase (TypeScript/Python/Java/C# SDKs, MCP server, and the go-ios +server SSE PR) must implement consistently. + +## Source of truth + +- **IDL:** TypeSpec 1.14 → **OpenAPI 3.1** (`spec/*.tsp` → `spec/openapi/openapi.yaml`). + The spec is the *ideal* contract; the go-ios REST server conforms to it. No + backward-compatibility constraint yet. +- Downstream generators consume the canonical `spec/openapi/openapi.yaml` (3.1). + A **3.2.0** variant (`spec/openapi/openapi.3.2.0.yaml`) is also emitted because + 3.2 is the only OpenAPI version that carries the typed SSE event schema inline + (see "Streaming" below). + +## Locked toolchain (OSS-first) + +Commercial generators (Stainless/Speakeasy/Fern) were all rejected — no free/OSS +tier covers a streaming-heavy Py+TS+MCP project. Stack: + +- **TypeScript SDK:** `@hey-api/openapi-ts` (MIT). +- **Python SDK:** `openapi-python-client` (httpx, sync+async). +- **Java SDK:** `openapi-generator` java client (Maven Central). +- **C# SDK:** `openapi-generator` csharp client (NuGet). +- **MCP server:** OSS openapi→mcp with **curated** tools (not naive 1:1). +- **Architecture:** generated client + thin hand-written ergonomic facade with an + *identical public API across languages*, generator-agnostic (so a commercial + gen could swap in later). +- **Packaging:** Python uv + PyPI OIDC; TS tsup + changesets + npm provenance; + Java Maven Central; C# NuGet. + +## Authentication + +- Bearer auth (`@useAuth(BearerAuth)`) on the whole `/api/v1` group: + `Authorization: Bearer `. +- The server **refuses to start** with no key and no `--disable-auth`. +- When started with **`--disable-auth`**, auth is not enforced and the header may + be omitted. SDKs should make the token optional but strongly encouraged, and + MUST send it when present. (`--disable-auth` is a server launch flag, not part + of the wire contract, so it is only noted here, not modeled as a scheme.) +- The Swagger UI (`/swagger/*`) is unauthenticated and outside `/api/v1` — not + modeled in the spec. + +## Base path & device routing + +- Base path: `/api/v1`. +- Device-scoped routes: `/device/{udid}/...`. Middleware resolves the udid: + unknown udid → **404**, empty udid → **422**. +- `/device/{udid}/apps/*` is serialized per-udid (one concurrent request per + device) — a server behavior, not expressed in the schema. + +## Error model (consistent) + +All errors use the `GenericResponse` envelope (`{ message?, error? }`) with proper +status codes. Shared across device routes: + +- **401** unauthorized (missing/invalid token when auth enabled) +- **404** device not found (and, for WDA session routes, unknown session) +- **422** empty/invalid udid +- **400** malformed request (missing required query/body) +- **423** device locked (pairing only) +- **500** internal/device error + +## Deviations from the current go-ios API (baked into the spec) + +The spec fixes these warts; the companion go-ios server PR must conform: + +1. **`longtitude` → `longitude`.** `PUT /setlocation` uses `longitude` (correct + spelling). Server should accept `longitude`, optionally keeping `longtitude` + as a deprecated alias. +2. **Screenshot media type.** `GET /screenshot` returns `image/png` (was + mislabeled `application/octet-stream`). +3. **Consistent errors.** All error bodies are `GenericResponse` with the status + codes above (previously a mix of `gin.H` shapes). +4. **Real SSE.** The six SSE endpoints emit real `text/event-stream` frames + (today they emit NDJSON or, worse, concatenated JSON with no delimiter for + `/syslog` and `/listen`). These are distinct from the v3 **binary** streams + (`ui/stream`, `screenshot/stream`, `pcap`), which are raw byte streams, not + SSE. See "Streaming contract" and "Binary streaming endpoints" below. + +## Endpoint surface (spec v3 — feature-complete daemon parity) + +Spec **v3** models the **complete, feature-complete** go-ios REST daemon surface +(`feature/restapi-complete`, Waves 1–4): **125 operations across 107 paths** +under `/api/v1`, grouped as below. This matches the daemon's registered routes +1:1, with three deliberate exclusions (see "Excluded routes"). + +Spec v2 (PR #817 `feature/restapi-parity`) modeled the pre-wave surface of **80 +operations across 65 paths**; v3 adds the **45 new operations** of Waves 1–4 +(diagnostics/network, accessibility/location, AFC fsync + provisioning, +WebInspector, UI automation, binary streams, and codesigning/prepare). The new +groups are called out in the table below. + +| Group | Routes | Notes | +| -------------------- | ------ | ----- | +| Global | `GET /list` | device listing | +| Tunnel agent | `GET /tunnels`, `DELETE /tunnels/{udid}`, `POST /tunnels/{udid}/refresh`, `POST /tunnel-agent/shutdown` | not device-scoped; talk to the tunnel agent by udid. `502 BadGateway` when the agent is unreachable. | +| Device lifecycle | `activate`, `info`, `screenshot`, `setlocation`, `resetlocation`, `resetaccessibility`, `pair` | (in `routes.tsp`) | +| Developer image | `GET/PUT/DELETE image`, `GET image/list` | mount (raw body or `?auto=true`), list, unmount | +| Conditions | `GET conditions`, `PUT enable-condition`, `POST disable-condition` | condition inducers | +| WebDriverAgent | `POST wda/session`, `GET/DELETE wda/session/{sessionId}` | interactive session (distinct from the `runwda` job) | +| Apps | `GET apps/`, `POST apps/launch|kill|install|uninstall` | serialized per-udid | +| Device info (RO) | `devicename`, `date`, `battery`, `diagnostics`, `mobilegestalt`, `processes`, `lockdown` | `routes-deviceinfo.tsp` | +| Device management | `reboot`, `shutdown`, `erase` (`?confirm=true`), `GET/POST devmode`, `GET/PUT lang`, `memlimitoff` | `routes-devicemgmt.tsp` | +| Files & crashes | `GET files`, `GET files/pull` (octet-stream), `POST files/push` (raw body), `GET/DELETE crashes` | `routes-files.tsp`; `domain` = `app|app-group|crash|temp` | +| Media | `GET/PUT wallpaper`, `GET/PUT icon-layout`, `GET/PUT pasteboard` | `routes-media.tsp`; wallpaper is supervised (multipart) | +| Config / profiles | `POST profiles`, `DELETE profiles/{name}` | `routes-config.tsp` (`GET profiles`, `GET/PUT image` are in `routes.tsp`) | +| Settings | `GET/PUT assistivetouch`, `GET/PUT timeformat`, `PUT/DELETE wifi` | `routes-settings.tsp` | +| Monitoring | `GET sysmontap` (SSE) | `routes-monitoring.tsp` | +| MDM (supervised) | `POST mdm/security-info|fetch-unlock-token|clear-passcode|clear-screen-time-password` | `routes-mdm.tsp`; each takes a `p12` multipart identity | +| Proxy (supervised) | `PUT/DELETE httpproxy` | `routes-proxy.tsp` | +| Async jobs | `POST jobs/runtest|runwda|forward`, `GET jobs`, `GET jobs/{id}`, `GET jobs/{id}/logs` (SSE), `DELETE jobs/{id}` | `routes-jobs.tsp` | +| **Diagnostics/network** (v3, w1a) | `GET diskspace`, `GET ip`, `GET rsd` (`400` w/o tunnel), `GET battery/registry`; `GET lockdown?domain=` | `routes-diagnostics.tsp`; open-map JSON. `lockdown` gained an optional `domain` query in `routes-deviceinfo.tsp` | +| **Accessibility/location** (v3, w1b) | `GET/PUT voiceover`, `GET/PUT zoom`, `POST ax/audit`, `GET ax`, `PUT setlocation/gpx` (multipart) | `routes-accessibility.tsp`; toggles accept `{enabled}` body or `?enabled=` | +| **AFC fsync** (v3, w1c) | `GET fsync/ls|tree`, `GET fsync/pull` (binary), `POST fsync/push` (raw or multipart), `DELETE fsync/rm`, `POST fsync/mkdir`; `GET cloudconfig` | `routes-fsync.tsp`; all take `?path=`/`?bundleID=`; `..` rejected (`400`); oversized push → `413` | +| **Provisioning host** (v3, w1c/w4) | `GET /prepare/skip-options` | host-scoped (device-free); in `routes-fsync.tsp` / `routes-sign.tsp` | +| **WebInspector** (v3, w1d) | `GET webinspector/pages`, `POST webinspector/launch`, `POST webinspector/eval` | `routes-webinspector.tsp`; `424` when Web Inspector/Remote Automation disabled; `eval` `404` on no page | +| **UI automation** (v3, w2) | `POST ui/{tap,swipe,longpress,type,button,api}`, `POST ui/app/{launch,terminate,foreground}`, `GET ui/{screenshot(PNG),source,size,orientation,status}`, `PUT ui/orientation` | `routes-ui.tsp`; proxy to a forwarded WDA/DeviceKit backend via `?backend=/?wdaUrl=/?timeout=` (or headers). `501` unsupported op, `502` backend error/unreachable. **Not started by these routes** — bring up WDA via `jobs/runwda`+`jobs/forward` first | +| **Binary streams** (v3, w3) | `GET ui/stream`, `GET screenshot/stream`, `GET pcap` | `routes-streams.tsp`; **binary, NOT SSE** — see "Binary streaming endpoints" below | +| **Codesigning/prepare** (v3, w4) | `POST /sign/certificate` (→ P12), `POST /sign/provision` (JSON base64 envelope), `POST /sign/app` (→ signed ipa), `POST /prepare/create-cert`; `POST /device/{udid}/prepare` (multipart) | `routes-sign.tsp`; `/sign/*` and `/prepare/create-cert` are **host-scoped** (device-free); secrets never logged | + +### Async jobs subsystem + +Long-running operations (test runs, the WDA runner, port forwards) run in the +background as **jobs**. `POST /jobs/{runtest,runwda,forward}` returns **202** with +a `Job` (`id`, `kind`, `udid`, `status`, `startedAt`, `finishedAt?`, `error?`, +`result?`; `status` ∈ `running|succeeded|failed|stopped`). Poll `GET /jobs/{id}`, +list with `GET /jobs`, stream output with `GET /jobs/{id}/logs` (SSE, see below), +and `DELETE /jobs/{id}` to stop a running job or purge a terminal one. Unknown +job ids yield **404**. + +Note: `POST /wda/session` (interactive WDA session, `routes.tsp`) and +`POST /jobs/runwda` (async WDA runner job) are distinct surfaces that both launch +WebDriverAgent — the former returns a `WdaSession`, the latter a `Job`. + +### Excluded routes + +Three routes registered by the server are intentionally **not** modeled: +`GET /healthz` and `GET /readyz` (unauthenticated probes outside `/api/v1`) and +`GET /swagger/*any` (the Swagger UI). None are part of the JSON wire contract. + +## Streaming contract (Server-Sent Events) + +The six long-lived endpoints are modeled with `@typespec/sse`'s `SSEStream`, +which sets the response content-type to **`text/event-stream`**. Each stream's +`T` is an `@events` union: **each named union variant becomes the SSE `event:` +name**, and the variant's model is the JSON payload of that event's `data:` frame. + +### Wire framing (server PR must emit exactly this) + +``` +event: \n +data: \n +\n +``` + +- One event per frame, terminated by a blank line. +- `data:` is compact (single-line) JSON of the payload model. +- A `heartbeat` event (empty JSON object `{}`) is sent on an idle interval on + **every** stream, so clients can distinguish a live-but-idle connection from a + dropped one and keep-alives are self-describing. +- There is no terminal event; streams run until the client disconnects or the + device goes away. + +### Endpoints and their event unions + +| Endpoint | Event union | `event:` name → payload model | +| --------------------------------- | ------------------- | --------------------------------------------- | +| `GET /device/{udid}/notifications`| `NotificationEvents`| `appstate` → `AppStateNotification`; `heartbeat` → `Heartbeat` | +| `GET /device/{udid}/syslog` | `SyslogEvents` | `syslog` → `SyslogMessage`; `heartbeat` → `Heartbeat` | +| `GET /device/{udid}/ostrace` | `OsTraceEvents` | `ostrace` → `OsTraceEntry`; `heartbeat` → `Heartbeat` | +| `GET /device/{udid}/listen` | `ListenEvents` | `attachdetach` → `AttachDetachEvent`; `heartbeat` → `Heartbeat` | +| `GET /device/{udid}/sysmontap` | `SysmontapEvents` | `sample` → `CpuUsageSample`; `heartbeat` → `Heartbeat` | +| `GET /device/{udid}/jobs/{id}/logs`| `JobLogEvents` | `log` → `JobLogLine`; `heartbeat` → `Heartbeat` | + +`/ostrace` also accepts optional AND-combined query filters: +`pid`, `level`, `subsystem`, `match`, `exclude`. + +`/sysmontap` streams CPU-usage samples; `/jobs/{id}/logs` replays the job's +buffered log history first, then streams live lines until the job ends. + +### Event payload shapes (JSON) + +```jsonc +// AppStateNotification (event: appstate) +{ "bundleId": "com.apple.Preferences", "state": "foreground", "timestamp": 1723200000000 } + +// SyslogMessage (event: syslog) +{ "message": "…raw syslog line…", "timestamp": 1723200000000 } + +// OsTraceEntry (event: ostrace) +{ "pid": 123, "processName": "SpringBoard", "level": "info", + "subsystem": "com.apple.network", "category": "boringssl", + "message": "…", "timestamp": 1723200000000 } + +// AttachDetachEvent (event: attachdetach) +{ "event": "attached", "deviceID": 5, "udid": "00008110-…", + "properties": { "serialNumber": "00008110-…", "connectionType": "USB", … } } + +// CpuUsageSample (event: sample) — open map; sampler keys vary by OS +{ "CPU_TotalLoad": 42.5, "SystemLoad": 12.0, "UserLoad": 30.5 } + +// JobLogLine (event: log) +{ "line": "…one line of job output…" } + +// Heartbeat (event: heartbeat) +{} +``` + +`state` (AppStateNotification) is one of `foreground`, `background`, `suspended`, +`terminated`, `unknown`. `AttachDetachEvent.event` is `attached`, `detached`, or +`paired` (`properties` present on `attached`). `OsTraceEntry.level` is one of +`default`, `info`, `debug`, `error`, `fault`. + +### How SDKs should expose SSE + +- **TS:** async iterator, `for await (const ev of client.streamSyslog(udid))`. +- **Python:** async generator + context manager. +- **Java / C#:** hand-written SSE reader exposing an iterable/observable of typed + events. +- Each event is dispatched by its `event:` name to the matching typed payload. + Unknown event names should be surfaced (not dropped) for forward-compat. + +### OpenAPI representation note (important for generators) + +On **OpenAPI 3.1** the SSE responses render with content-type `text/event-stream` +and a bare `schema: { type: string }` — 3.1 cannot express the per-event typed +body inline (the emitter drops `itemSchema` with a warning). To keep the typed +contract machine-readable we provide it two ways: + +1. **`x-sse-events` vendor extension** on every SSE operation in the 3.1 doc: + `{ schema: "", events: { "": "", … } }`. + All payload/union models are still fully defined under `components/schemas`. +2. **`spec/openapi/openapi.3.2.0.yaml`** — the 3.2 variant carries the full typed + `itemSchema` inline (a `oneOf` keyed by `event` const, with `data` as a JSON + `contentSchema` `$ref` to the payload model). + +Generators/facades should read the event map from `x-sse-events` (or the 3.2 file) +and hand-write the typed dispatch; do not rely on the bare 3.1 SSE response schema. + +## Binary streaming endpoints (v3 — BINARY, NOT SSE) + +Three v3 endpoints (`routes-streams.tsp`) are **long-lived binary byte streams**, +deliberately distinct from the `text/event-stream` SSE endpoints above. They have +**no** `@events`/`x-sse-events`, no typed `event:` frames, and no +`SSEStream` — they stream raw bytes over chunked HTTP until the client +disconnects or the source ends. SDKs must expose them as byte-stream readers (a +hand-written async-iterator / `io.Reader`-style helper per SDK), **not** through +the typed SSE dispatch: + +| Endpoint | Wire content-type | Modeled as | Notes | +| -------- | ----------------- | ---------- | ----- | +| `GET /device/{udid}/ui/stream` | `multipart/x-mixed-replace` (mjpeg) **or** `video/H264` (`?codec=h264`) | `UIVideoStream` → `application/octet-stream` bytes; real type per request in `x-content-type` | proxied from a forwarded WDA/DeviceKit backend; `?codec/fps/quality/scale/bitrate` + `UIBackendParams` | +| `GET /device/{udid}/screenshot/stream` | `multipart/x-mixed-replace; boundary=BoundaryString` (each part `image/jpeg`) | `MjpegStream` → `image/jpeg` bytes; real multipart type in `x-content-type` | instruments screenshot service; `?quality=1..100` | +| `GET /device/{udid}/pcap` | `application/vnd.tcpdump.pcap` | `PcapStream` → that media type | libpcap stream (wireshark/tshark); `?timeout=` seconds (default 60, max 3600) | + +> TypeSpec's HTTP library rejects a `multipart/*` **response body** that is not a +> structured `@multipartBody` payload. Because `x-mixed-replace` is a continuous +> byte stream (not a form), the two mjpeg streams are schematized with a +> single-frame media type (`image/jpeg` / `application/octet-stream`) and carry +> the true wire content-type in an `x-content-type` vendor extension; every binary +> stream also carries `x-stream: binary`. Generators should treat any operation +> whose response schema has `x-stream: binary` (or `x-content-type`) as a raw +> byte stream. + +## Other binary & raw-body endpoints + +- `GET /screenshot` and `GET /device/{udid}/ui/screenshot` return `image/png` bytes. +- `GET /device/{udid}/files/pull` and `GET /device/{udid}/fsync/pull` return + `application/octet-stream` file bytes. +- `POST /device/{udid}/files/push` and `POST /device/{udid}/fsync/push` accept a + raw request body (`fsync/push` also accepts a multipart `file`); oversized + `fsync` uploads yield `413`. +- `PUT /device/{udid}/image` accepts a raw image body (`application/octet-stream`, + up to 2 GiB) or auto-resolves via `?auto=true&basedir=…`. +- `POST /sign/certificate` returns `application/x-pkcs12`; `POST /sign/app` + returns the signed IPA as `application/octet-stream`; `POST /sign/provision` + and `POST /prepare/create-cert` return JSON envelopes with base64-encoded + binary artifacts. +- `/healthz`, `/readyz` and `/swagger/*` are intentionally excluded (see + "Excluded routes"). diff --git a/sdks/docs/EXAMPLES.md b/sdks/docs/EXAMPLES.md new file mode 100644 index 000000000..b9af3dad9 --- /dev/null +++ b/sdks/docs/EXAMPLES.md @@ -0,0 +1,130 @@ +# go-ios SDK examples + +Each SDK (and the MCP server) ships a set of runnable, heavily-commented +**examples** under `sdks/packages//examples/`. They serve two purposes: + +1. **Docs** — the shortest correct path from "I have the SDK installed" to + "I called the go-ios REST daemon and did something useful". Every example is + annotated so it reads as a tutorial. +2. **Pre-release smoke test** — each package has an example *runner* that + executes the whole set in sequence against a live daemon and exits non-zero + if anything breaks. This is what the release/verify pipeline drives to prove + the published clients actually talk to a real device before shipping. + +## Per-language index + +| SDK / target | Examples README | Runner command (from the package dir) | +| ------------------ | --------------------------------------------------------------------------- | ---------------------------------------------- | +| TypeScript | [`packages/typescript/examples/README.md`](../packages/typescript/examples/README.md) | `npm run examples` | +| Python | [`packages/python/examples/README.md`](../packages/python/examples/README.md) | `uv run python examples/run_all.py` | +| Java | [`packages/java/examples/README.md`](../packages/java/examples/README.md) | `bash examples/run.sh` | +| C# / .NET | [`packages/csharp/examples/README.md`](../packages/csharp/examples/README.md) | `dotnet run --project examples/GoIos.Examples -- run-all` | +| MCP server | [`packages/mcp/examples/README.md`](../packages/mcp/examples/README.md) | `npm run examples` | + +The **MCP `list-tools`** example is special: it is fully **device-free and +daemon-free** (it just spawns the built MCP server over stdio and asserts the +exact curated 44-tool set), so it runs in ordinary CI as a gate. Its +`call-tool` companion auto-skips when no daemon is reachable. See +[Pre-release verification](#pre-release-verification) below. + +## Shared environment convention + +All example runners read the same environment variables so a single set of +exports drives every language: + +| Variable | Required | Default | Meaning | +| ----------------- | -------- | ------------------------------------ | -------------------------------------------------------------- | +| `GO_IOS_BASE_URL` | no | auto-discovered (`~/.go-ios/rest-api.json`) | Origin of the go-ios REST daemon. The SDK appends `/api/v1`. Unset → discover the local daemon. | +| `GO_IOS_API_KEY` | yes\* | — | Bearer token. \*Not needed if the daemon runs `--disable-auth`. | +| `GO_IOS_UDID` | no | first attached device | Which device to target. | +| `RUN_UI` | no | unset (off) | Set to `1` to also run the mutating UI-automation example. | + +```bash +export GO_IOS_API_KEY=your-secret # required (unless --disable-auth) +# GO_IOS_BASE_URL is optional; unset, the local daemon is auto-discovered. +# export GO_IOS_BASE_URL=http://localhost:8080 # only to pin a fixed/remote daemon +export GO_IOS_UDID=00008030-0000... # optional; first device otherwise +# export RUN_UI=1 # optional; include UI automation +``` + +Read-only examples SKIP (rather than fail) when a device isn't attached, so the +runners are safe to invoke even without hardware — but for a real smoke test you +want a device connected. + +## Daemon discovery (no hardcoded port) + +By default the go-ios REST daemon binds an **ephemeral loopback port** +(`--addr` defaults to `127.0.0.1:0`) and, after binding, writes a discovery file +at `~/.go-ios/rest-api.json` (`$GO_IOS_HOME/rest-api.json` when `GO_IOS_HOME` is +set) containing the real `baseUrl`. The file is removed on graceful shutdown. + +Every SDK (TypeScript, Python, Java, C#) resolves its base URL in the same +order — the examples rely on this rather than hardcoding a port: + +1. an **explicit** `baseUrl` / `BaseUrl` init option → used verbatim (for remote + daemons; discovery is skipped); +2. the **`GO_IOS_BASE_URL`** environment variable; +3. the **discovery file** `~/.go-ios/rest-api.json` (its `baseUrl`); +4. otherwise a **clear error** telling you to start the daemon or pass a base URL. + +So you normally just start the daemon and run the examples — no port to know: + +```bash +ios api --api-key "$GO_IOS_API_KEY" # ephemeral loopback port; writes ~/.go-ios/rest-api.json +``` + +To **pin** a fixed port (e.g. to reach a daemon on another host, or expose it), +start it with `--addr` and point the SDK at it: + +```bash +ios api --api-key "$GO_IOS_API_KEY" --addr :8080 +export GO_IOS_BASE_URL=http://localhost:8080 +``` + +> **Resolved:** the earlier SDK-library-vs-daemon default mismatch (the SDK +> libraries defaulting `baseUrl` to `http://localhost:60105` from the OpenAPI +> spec's `servers` URL, while the daemon listened on `:8080`) no longer exists. +> The SDKs have **no hardcoded default** — they auto-discover the local daemon +> via `~/.go-ios/rest-api.json`. The OpenAPI `servers` URL is now a documentation +> placeholder only. (Daemon side: PR #825 / #821; SDK side: PR #819.) + +## Run them all + +With the environment exported and a daemon (plus device) reachable, from each +package directory: + +```bash +# TypeScript +cd sdks/packages/typescript && npm ci && npm run examples + +# Python +cd sdks/packages/python && uv sync --all-extras && uv run python examples/run_all.py + +# Java (JDK 17+, no Maven needed) +cd sdks/packages/java && bash examples/run.sh + +# C# / .NET 8 +cd sdks/packages/csharp && dotnet run --project examples/GoIos.Examples -- run-all + +# MCP server (list-tools is device-free; call-tool needs a daemon) +cd sdks/packages/mcp && npm ci && npm run build && npm run examples +``` + +## Pre-release verification + +Two layers of CI drive these examples: + +1. **Device-free gate (always on).** `.github/workflows/sdks.yml` runs the MCP + `list-tools` smoke check (`cd sdks/packages/mcp && npm ci && npm run build && + npm run examples`). It needs no device and no daemon, so a broken MCP server + — a bad tool set, a server that won't start — fails ordinary CI on every + `sdks/**` change. (`call-tool` auto-skips without daemon credentials.) + +2. **Device-dependent verification (farm-gated, dispatch-only).** + `.github/workflows/verify-sdk-examples.yml` runs *every* SDK's example runner + against a real go-ios REST daemon + device on the self-hosted farm + (office01 / ganjalf). It is **`workflow_dispatch`-only and inert today**: the + full REST daemon is not yet on `main` (it lands with PRs **#817 / #821**), so + the workflow documents — but does not yet execute — the daemon-start step. It + activates once the daemon is deployable on the farm. See the header of that + workflow file for the exact daemon-start command to fill in. diff --git a/sdks/docs/RELEASING.md b/sdks/docs/RELEASING.md new file mode 100644 index 000000000..b325c8b6c --- /dev/null +++ b/sdks/docs/RELEASING.md @@ -0,0 +1,117 @@ +# Releasing the go-ios SDKs + +All five SDKs (`typescript`, `python`, `java`, `csharp`, `mcp`) are generated +from **one** OpenAPI spec (`sdks/spec/openapi/openapi.yaml`), so they ship in +**lockstep**: a single version number is stamped into every package manifest and +published to every registry in one run. + +Releasing is **dispatch-only** — exactly like the CLI's `release.yml`. Merging a +PR never publishes anything. The pipeline lives in +[`.github/workflows/release-sdks.yml`](../../.github/workflows/release-sdks.yml) +and is completely separate from the CLI release (`release.yml`). + +## Lockstep versioning + +One `version` input drives all five packages. `sdks/scripts/set-version.sh` +stamps it into: + +| Package | Manifest | Registry id | +| ---------- | ---------------------------------------------------- | --------------------------------- | +| typescript | `sdks/packages/typescript/package.json` | npm `@go-ios/sdk` | +| mcp | `sdks/packages/mcp/package.json` | (private — not published to npm) | +| python | `sdks/packages/python/pyproject.toml` | PyPI `go-ios-sdk` | +| java | `sdks/packages/java/pom.xml` | Maven Central `com.github.danielpaulus:go-ios-sdk` | +| csharp | `sdks/packages/csharp/src/GoIos.Sdk/GoIos.Sdk.csproj` | NuGet `GoIos.Sdk` | + +The script fails loudly if any manifest is not updated, so a partial version +bump can never reach the publish step. `packages/mcp` is `"private": true`; it is +versioned and built/tested for parity but not published to npm. + +## How to cut a release + +1. **Dry run first (always).** From the Actions tab run **Release-SDKs** with + `dry_run = true` (the default), or: + + ``` + gh workflow run release-sdks.yml -f version=0.1.0 -f dry_run=true + ``` + + This stamps the version, builds and tests all five SDKs, then does a **real + dry-run of every publish** — `npm publish --dry-run`, `twine check`, + `mvn verify`, `dotnet pack` — with **no upload** and **no git tag/release**. + +2. **Real release.** Once the dry run is green, run it again with + `dry_run = false`: + + ``` + gh workflow run release-sdks.yml -f version=0.1.0 -f dry_run=false + ``` + + This rebuilds/retests, then each ecosystem's publish job uploads **only if + that registry is armed** (see prerequisites below). After all publish jobs + succeed it creates the git tag `sdk-v` and a GitHub release. + +### Safety model + +- **Dispatch only.** No tag/push trigger — nothing here runs off a merge. + `dry_run` defaults to `true`. +- **Build before upload.** All five build/test jobs must pass before any publish + job starts, so a bad build ships nothing. +- **Every upload is gated twice:** (1) `if: ${{ !inputs.dry_run }}` — a dry run + does a real dry-run instead; (2) a registry-armed guard — even a real run + **self-skips** an upload (with a `::warning::` in the log) when that registry + isn't configured yet. This makes the first real run safe before any registry + exists. +- **Tag + GitHub release** are created only after every publish job succeeds and + it was not a dry run — the single repo-mutating stage, last. + +## Registry prerequisites (maintainer must set these up before real publishing) + +Until each of these is configured, that ecosystem's real publish **self-skips** +with a warning; the run still succeeds. Arm them one at a time and re-run. + +### npm (`@go-ios/sdk`) + +- Create the **`@go-ios` npm org** and the `@go-ios/sdk` package. +- Register **OIDC trusted publishing** for the package on npmjs.com, pointing at + this repo + the `release-sdks.yml` workflow. +- **No token.** Auth is OIDC only (`id-token: write`, `NPM_CONFIG_PROVENANCE`). + Do **not** add `NODE_AUTH_TOKEN` or an `.npmrc` token line — even an empty one + breaks OIDC (per AGENTS.md). The job self-skips until an OIDC token is issued. + +### PyPI (`go-ios-sdk`) + +- Create the **PyPI project** `go-ios-sdk`. +- Add a **Trusted Publisher** for this repo + `release-sdks.yml` (environment + `pypi`). +- Set the repo secret **`PYPI_TRUSTED_PUBLISHER_CONFIGURED`** to any non-empty + value — that's the arm flag the workflow gates on. (Publishing itself is + tokenless OIDC via `pypa/gh-action-pypi-publish`.) + +### Maven Central (`com.github.danielpaulus:go-ios-sdk`) + +- Register the namespace on the **Sonatype Central Portal** — either + `com.github.danielpaulus` (verify via GitHub) or an `io.github.*` namespace. +- Generate a **GPG key** and publish the public key to a keyserver. +- Add these repo secrets: + - **`MAVEN_GPG_PRIVATE_KEY`** — ASCII-armored private key. + - **`MAVEN_GPG_PASSPHRASE`** — its passphrase. + - **`CENTRAL_TOKEN_USERNAME`** / **`CENTRAL_TOKEN_PASSWORD`** — Central Portal + user token. +- The workflow deploys via the `release` profile in `pom.xml` + (`central-publishing-maven-plugin` + `maven-gpg-plugin`). It self-skips unless + all three of the key + token username + token password secrets are present. + +### NuGet (`GoIos.Sdk`) + +- Reserve the **`GoIos.Sdk`** package id on nuget.org. +- Create an API key scoped to that package and add it as the repo secret + **`NUGET_API_KEY`**. The push self-skips until it exists. + +## Notes + +- The `sdk-v*` tag prefix is used so SDK releases never collide with the CLI's + own `v*` release tags. +- To change what's published, edit `release-sdks.yml`; to change versions, pass a + different `version` input — never hand-edit the version in the manifests for a + release (the pipeline owns that via `set-version.sh`). diff --git a/sdks/packages/csharp/.gitignore b/sdks/packages/csharp/.gitignore new file mode 100644 index 000000000..a5de5e450 --- /dev/null +++ b/sdks/packages/csharp/.gitignore @@ -0,0 +1,17 @@ +# Build output +bin/ +obj/ +artifacts/ +*.user + +# Re-include the committed generated low-level client (the repo-root .gitignore +# ignores "generated/", which on a case-insensitive filesystem also matches our +# src/Generated/ tree). We DO commit the generated sources; only bin/obj below +# it are ignored (via the patterns above). +!src/Generated/ +!src/Generated/** +src/Generated/**/bin/ +src/Generated/**/obj/ + +# openapi-generator scratch config written by regen.sh +.openapi-generator-config.json diff --git a/sdks/packages/csharp/GoIos.Sdk.sln b/sdks/packages/csharp/GoIos.Sdk.sln new file mode 100644 index 000000000..024bc0b3b --- /dev/null +++ b/sdks/packages/csharp/GoIos.Sdk.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GoIos.Sdk", "src\GoIos.Sdk\GoIos.Sdk.csproj", "{11111111-1111-1111-1111-111111111111}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GoIos.Sdk.Generated", "src\Generated\src\GoIos.Sdk.Generated\GoIos.Sdk.Generated.csproj", "{22222222-2222-2222-2222-222222222222}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GoIos.Sdk.Tests", "tests\GoIos.Sdk.Tests\GoIos.Sdk.Tests.csproj", "{33333333-3333-3333-3333-333333333333}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {11111111-1111-1111-1111-111111111111}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {11111111-1111-1111-1111-111111111111}.Debug|Any CPU.Build.0 = Debug|Any CPU + {11111111-1111-1111-1111-111111111111}.Release|Any CPU.ActiveCfg = Release|Any CPU + {11111111-1111-1111-1111-111111111111}.Release|Any CPU.Build.0 = Release|Any CPU + {22222222-2222-2222-2222-222222222222}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {22222222-2222-2222-2222-222222222222}.Debug|Any CPU.Build.0 = Debug|Any CPU + {22222222-2222-2222-2222-222222222222}.Release|Any CPU.ActiveCfg = Release|Any CPU + {22222222-2222-2222-2222-222222222222}.Release|Any CPU.Build.0 = Release|Any CPU + {33333333-3333-3333-3333-333333333333}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {33333333-3333-3333-3333-333333333333}.Debug|Any CPU.Build.0 = Debug|Any CPU + {33333333-3333-3333-3333-333333333333}.Release|Any CPU.ActiveCfg = Release|Any CPU + {33333333-3333-3333-3333-333333333333}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/sdks/packages/csharp/README.md b/sdks/packages/csharp/README.md new file mode 100644 index 000000000..65397a636 --- /dev/null +++ b/sdks/packages/csharp/README.md @@ -0,0 +1,356 @@ +# GoIos.Sdk — C#/.NET SDK for go-ios + +Ergonomic, async C#/.NET SDK for the [go-ios](https://github.com/danielpaulus/go-ios) +REST API. It covers the **full daemon surface** (125 operations) — device info & +diagnostics (disk space, IP, RSD, battery registry), apps, WebDriverAgent, UI +automation, WebInspector, accessibility (VoiceOver / Zoom / AX audit), condition +inducers, location (incl. GPX), developer images, files (AFC + fsync), crashes, +media (wallpaper/icon-layout/pasteboard), profiles, settings, MDM, HTTP proxy, +device preparation & supervision, host-side code signing, background jobs and +tunnels — plus six live SSE streams (syslog, notifications, os_trace, listen, +sysmontap, job-logs) as typed `IAsyncEnumerable` and three raw binary +streams (UI video, MJPEG screenshots, pcap) as `Stream`. + +- **Low-level client:** generated from the OpenAPI 3.1 spec with + [openapi-generator](https://openapi-generator.tech/) (`csharp`, `httpclient` + library, `net8.0`, nullable, async). Lives under `src/Generated/`. +- **Facade:** a thin hand-written layer (`GoIos` / `GoIos.Sdk`) with an API shape + shared across the go-ios SDKs. + +## Install + +```sh +dotnet add package GoIos.Sdk +``` + +Targets **net8.0**. + +## Connecting (daemon discovery) + +By default the go-ios REST daemon binds an **ephemeral, loopback-only** port and +writes a discovery file at `/rest-api.json` after it starts. The SDK reads +that file so `new IosClient()` "just works" against a locally running daemon — +no port to hardcode. + +`BaseUrl` is optional. When it is not set, the base URL is resolved in this order: + +1. **explicit `Options.BaseUrl`** — used verbatim (for remote daemons); discovery + is skipped; +2. **`GO_IOS_BASE_URL`** environment variable; +3. **discovery** — read `baseUrl` from `/rest-api.json`; +4. **none found** → a `DaemonNotFoundException` is thrown with a clear message + ("no local go-ios REST daemon found at ``; start it … or pass an explicit + BaseUrl"). + +The **home** directory is `GO_IOS_HOME` (if set and non-empty), otherwise +`~/.go-ios` (the user profile dir; `%USERPROFILE%\.go-ios` on Windows). To pin the +daemon to a fixed port instead of the ephemeral default, run it with `--addr :8080` +and/or set `GO_IOS_BASE_URL`. + +The `ApiKey` is independent of discovery: set it on `Options.ApiKey` (see +[Authentication](#authentication)). It is **not** read from the discovery file. + +You can also call the discovery helper directly: + +```csharp +string baseUrl = GoIos.Discovery.DiscoverBaseUrl(); // throws DaemonNotFoundException if none +``` + +## Quickstart + +### Unary calls + +```csharp +using GoIos; + +// No BaseUrl: the SDK auto-discovers a local go-ios REST daemon (see below). +using var client = new IosClient(new IosClientOptions +{ + ApiKey = "your-go-ios-api-key", // optional if the server runs with --disable-auth +}); + +// ...or, equivalently, with no options at all: +using var discovered = new IosClient(); + +// List devices +var devices = await client.Devices.ListAsync(); +foreach (var d in devices.VarDeviceList) // generated prop name for JSON "deviceList" + Console.WriteLine(d.Properties.SerialNumber); + +var device = client.Device("00008110-000123456789ABCD"); +Console.WriteLine(device.Udid); // convenience accessor (properties.serialNumber) + +// Info + screenshot (raw PNG bytes) +var info = await device.InfoAsync(); +byte[] png = await device.ScreenshotAsync(); +await File.WriteAllBytesAsync("shot.png", png); + +// Device information +var name = await device.DeviceNameAsync(); +var date = await device.DateAsync(); +var battery = await device.BatteryAsync(); +var diag = await device.DiagnosticsAsync(); +var gestalt = await device.MobileGestaltAsync(new[] { "ProductType", "UniqueDeviceID" }); +var procs = await device.ProcessesAsync(apps: true); +var lockdown = await device.LockdownAsync(); // or LockdownAsync(domain: "com.apple.mobile.battery") + +// Diagnostics / network +var disk = await device.DiskSpaceAsync(); +var ip = await device.IpAsync(); +var rsd = await device.RsdAsync(); +var batReg = await device.BatteryRegistryAsync(); + +// Accessibility +await device.SetVoiceOverAsync(true); +await device.SetZoomAsync(false); +var axIssues = await device.AxAuditAsync(timeout: 60); +var axTree = await device.AxAsync(); +await device.SetLocationGpxAsync(File.ReadAllBytes("route.gpx")); +var cloudCfg = await device.CloudConfigAsync(); + +// Management +await device.RebootAsync(); +await device.ShutdownAsync(); +await device.EraseAsync(confirm: true); // destructive +await device.SetDevmodeAsync("enable", enablePostRestart: true); +await device.SetLangAsync(language: "en", locale: "en_US"); +await device.MemLimitOffAsync("MyApp"); + +// Files (AFC) — binary transfers stream through the raw HTTP pipeline +var listing = await device.Files.LsAsync(domain: "appDocuments", path: "Documents", identifier: "com.example.app"); +byte[] pulled = await device.Files.PullAsync("appDocuments", "Documents/log.txt", "com.example.app"); +await device.Files.PushAsync("appDocuments", "Documents/out.txt", pulled, "com.example.app"); + +// fsync (ios fsync ...) — path + optional bundleId scope +var tree = await device.Fsync.TreeAsync(path: "/Documents", bundleId: "com.example.app"); +byte[] f = await device.Fsync.PullAsync("/Documents/log.txt", bundleId: "com.example.app"); +await device.Fsync.PushAsync("/Documents/out.txt", f, bundleId: "com.example.app"); +await device.Fsync.MkdirAsync("/Documents/sub", bundleId: "com.example.app"); +await device.Fsync.RmAsync("/Documents/old", recursive: true, bundleId: "com.example.app"); + +// UI automation (WDA / DeviceKit) — optional backend/wdaUrl/timeout via Options +var ui = device.Ui; +await ui.TapAsync(100, 200); +await ui.SwipeAsync(10, 400, 10, 100, duration: 0.5); +await ui.LongPressAsync(100, 200, duration: 1.0); +await ui.TypeAsync("hello"); +await ui.ButtonAsync("home"); +byte[] uiShot = await ui.ScreenshotAsync(); +string source = await ui.SourceAsync(); +var size = await ui.SizeAsync(); +await ui.SetOrientationAsync("landscape"); +await ui.AppLaunchAsync("com.apple.Preferences", new UiClient.Options { Backend = "devicekit", Timeout = 30 }); +var raw = await ui.ApiAsync(method: "GET", path: "/status"); + +// WebInspector (remote web debugging) +var pages = await device.WebInspector.PagesAsync(); +await device.WebInspector.LaunchAsync(url: "https://example.com"); +var eval = await device.WebInspector.EvalAsync("document.title", page: pages[0]["id"]?.ToString()); + +// Device preparation (multipart; supply a supervision cert to supervise) +var prep = await device.PrepareAsync(cert: File.ReadAllBytes("supervision.p12"), + p12Password: "pass", skip: new[] { "Siri" }, orgName: "Acme"); + +// Host-side code signing / preparation (device-free) +var skipOpts = await client.Prepare.SkipOptionsAsync(); +var superCert = await client.Prepare.CreateCertAsync(); +byte[] p12Cert = await client.Sign.CertificateAsync(File.ReadAllBytes("AuthKey.p8"), "KEYID", "ISSUER"); +byte[] signedIpa = await client.Sign.AppAsync(File.ReadAllBytes("app.ipa"), + File.ReadAllBytes("id.p12"), + File.ReadAllBytes("app.mobileprovision")); + +// Crashes +var crashes = await device.Crashes.ListAsync("*.ips"); +await device.Crashes.RemoveAsync("*.ips", cwd: "/tmp/crashes"); + +// Media +byte[] wallpaper = await device.Media.WallpaperAsync(); +await device.Media.SetPasteboardAsync("hello"); +var clip = await device.Media.PasteboardAsync(); + +// Settings +await device.Settings.SetAssistiveTouchAsync(true); +await device.Settings.SetTimeFormatAsync(uses24Hour: true); +await device.Settings.SetWifiAsync("MyNet", password: "hunter2", encType: "WPA2"); +await device.Settings.RemoveWifiAsync("MyNet"); + +// Profiles / images +await device.AddProfileAsync(File.ReadAllBytes("wifi.mobileconfig")); +await device.RemoveProfileAsync("com.example.profile"); +var mounted = await device.MountedImagesAsync(); +await device.UnmountImageAsync(); + +// MDM (supervised — pass the supervision .p12) +byte[] p12 = File.ReadAllBytes("supervision.p12"); +var security = await device.Mdm.SecurityInfoAsync(p12, password: "pass"); +var token = await device.Mdm.FetchUnlockTokenAsync(p12, "pass"); +await device.Mdm.ClearPasscodeAsync(p12, token.Token, "pass"); + +// HTTP proxy +await device.Proxy.SetHttpProxyAsync("10.0.0.1", "8888", p12); +await device.Proxy.RemoveHttpProxyAsync(); + +// Background jobs (device-scoped) +var job = await device.Jobs.RunwdaAsync(); +var jobs = await device.Jobs.ListAsync(); +await device.Jobs.ForwardAsync(hostPort: 8100, targetPort: 8100); +await device.Jobs.DeleteAsync(job.Id); + +// Tunnels (global) +var tunnels = await client.Tunnels.ListAsync(); +await client.Tunnels.RefreshAsync(device.Udid); +await client.Tunnels.ShutdownAgentAsync(); + +// Apps +var apps = await device.Apps.ListAsync(); +await device.Apps.LaunchAsync("com.apple.Preferences"); +await device.Apps.KillAsync("com.apple.Preferences"); +await device.Apps.InstallAsync("/path/to/MyApp.ipa"); +await device.Apps.UninstallAsync("com.example.myapp"); + +// Location +await device.SetLocationAsync(latitude: 52.5200, longitude: 13.4050); +await device.ResetLocationAsync(); + +// Condition inducers +var conditions = await device.ConditionsAsync(); +await device.EnableConditionAsync(profileTypeId: "…", profileId: "…"); +await device.DisableConditionAsync(); + +// Developer disk image +var images = await device.ImagesAsync(); +await device.InstallImageAsync(auto: true); + +// WebDriverAgent (XCUITest) +var session = await device.Wda.CreateSessionAsync(new GoIos.Sdk.Generated.Model.WdaConfig( + bundleId: "com.facebook.WebDriverAgentRunner.xctrunner", + testBundleId: "com.facebook.WebDriverAgentRunner", + xcTestConfig: "WebDriverAgentRunner.xctest")); +await device.Wda.ReadSessionAsync(session.SessionId); +await device.Wda.DeleteSessionAsync(session.SessionId); +``` + +### Streaming (Server-Sent Events) + +The six long-lived endpoints are exposed as `IAsyncEnumerable`. Each +typed event maps to an SSE `event:` name; `HeartbeatEvent` keep-alives are +surfaced so you can tell a live-but-idle stream from a dropped one, and any +unrecognized `event:` name arrives as `UnknownEvent` (never silently dropped). + +```csharp +using var cts = new CancellationTokenSource(); + +await foreach (var e in device.SyslogAsync(cts.Token)) +{ + switch (e) + { + case SyslogMessageEvent s: Console.WriteLine(s.Message); break; + case HeartbeatEvent: /* still alive */ break; + case UnknownEvent u: Console.WriteLine($"unknown {u.EventName}: {u.RawData}"); break; + } +} + +// Notifications (app lifecycle): +await foreach (var e in device.NotificationsAsync(cts.Token)) + if (e is AppStateNotificationEvent a) Console.WriteLine($"{a.BundleId} -> {a.State}"); + +// os_trace with AND-combined filters: +var filters = new OsTraceFilters { Level = "error", Subsystem = "com.apple.network" }; +await foreach (var e in device.OsTraceAsync(filters, cts.Token)) + if (e is OsTraceEntryEvent t) Console.WriteLine($"[{t.ProcessName}] {t.Message}"); + +// Device attach/detach/pair: +await foreach (var e in device.ListenAsync(cts.Token)) + if (e is AttachDetachEventEvent ad) Console.WriteLine($"{ad.Event} {ad.Udid}"); + +// sysmontap CPU-usage samples (open map — extra sampler keys land in `Extra`): +await foreach (var e in device.SysmontapAsync(cts.Token)) + if (e is CpuUsageSampleEvent s) Console.WriteLine($"CPU {s.CpuTotalLoad}%"); + +// Live job logs: +await foreach (var e in device.Jobs.LogsAsync(job.Id, cts.Token)) + if (e is JobLogLineEvent l) Console.Write(l.Line); +``` + +Cancel the `CancellationToken` (or `break`) to stop a stream and release the +connection. + +### Binary streams (raw bytes, not SSE) + +Three endpoints emit an open-ended stream of raw bytes rather than SSE frames: +live UI video (MJPEG / H.264), MJPEG screenshots, and a libpcap capture. Each +returns a `BinaryStream` — a read-only `Stream` opened with +`HttpCompletionOption.ResponseHeadersRead` so bytes are pulled off the socket as +they arrive. Reads honor the `CancellationToken`; dispose the stream to stop the +capture and release the connection. `ContentType` exposes the negotiated media +type. + +```csharp +using var cts = new CancellationTokenSource(); + +// pcap → pipe straight to a file (or into wireshark/tshark) +await using (var pcap = await device.PcapAsync(timeout: 30, cancellationToken: cts.Token)) +await using (var file = File.Create("capture.pcap")) + await pcap.CopyToAsync(file, cts.Token); + +// MJPEG screenshot stream +await using var shots = await device.ScreenshotStreamAsync(quality: 80, cancellationToken: cts.Token); + +// UI video (MJPEG default; codec: "h264" needs the devicekit backend) +await using var video = await device.Ui.StreamAsync( + new UiClient.Options { Backend = "devicekit" }, codec: "h264", cancellationToken: cts.Token); +Console.WriteLine(video.ContentType); +``` + +## Examples + +Runnable, heavily-commented examples live in [`examples/`](./examples). They +double as documentation and as a pre-release smoke test: `examples/run.sh` +(`dotnet run --project examples/GoIos.Examples -- run-all`) drives the read-only +surface of a live daemon (list devices, device info, list apps, screenshot, +stream syslog) and exits non-zero on any failure. Steps that need a device — or +a forwarded WebDriverAgent for the optional UI example — print `SKIP` instead of +failing. See [`examples/README.md`](./examples/README.md) for setup and the full +command list. + +## Authentication + +Every `/api/v1` route expects a bearer token +(`Authorization: Bearer `). Set `ApiKey` on `IosClientOptions`; +the SDK sends it on every request. It is optional only when the server is +launched with `--disable-auth`, but supplying it whenever you have it is +strongly encouraged. + +## Streaming event types + +| Endpoint | Method | Typed event | SSE `event:` | +| -------------------- | --------------------- | -------------------------- | -------------- | +| `/syslog` | `SyslogAsync` | `SyslogMessageEvent` | `syslog` | +| `/notifications` | `NotificationsAsync` | `AppStateNotificationEvent`| `appstate` | +| `/ostrace` | `OsTraceAsync` | `OsTraceEntryEvent` | `ostrace` | +| `/listen` | `ListenAsync` | `AttachDetachEventEvent` | `attachdetach` | +| `/sysmontap` | `SysmontapAsync` | `CpuUsageSampleEvent` | `sample` | +| `/jobs/{id}/logs` | `Jobs.LogsAsync` | `JobLogLineEvent` | `log` | +| *(all streams)* | — | `HeartbeatEvent` | `heartbeat` | +| *(forward-compat)* | — | `UnknownEvent` | *(any other)* | + +## Notes on coverage + +All 125 daemon operations are exposed. Two conveniences are intentionally absent +because the daemon has **no corresponding endpoint**: there is no set-device-name +or set-date route (only `GET /devicename` and `GET /date`), so the SDK offers +`DeviceNameAsync`/`DateAsync` but no setters. + +Endpoints whose response is an open, schema-less JSON object (RSD services, +cloud config, AX snapshot/audit, WebInspector pages, and the UI backend +passthrough responses) are surfaced as `IReadOnlyDictionary` +(or a list of them) so no data is lost to a fixed DTO. + +## Regenerating the low-level client + +```sh +./regen.sh # requires Java (openapi-generator) + npx +``` + +Regenerates `src/Generated/` from `../../spec/openapi/openapi.yaml`. The facade +under `src/GoIos.Sdk/` is hand-written and is not overwritten. diff --git a/sdks/packages/csharp/examples/GoIos.Examples/ExampleContext.cs b/sdks/packages/csharp/examples/GoIos.Examples/ExampleContext.cs new file mode 100644 index 000000000..96cacbc3b --- /dev/null +++ b/sdks/packages/csharp/examples/GoIos.Examples/ExampleContext.cs @@ -0,0 +1,118 @@ +using GoIos; + +namespace GoIos.Examples; + +/// +/// Shared, environment-driven configuration for every example. +/// +/// The examples are configured entirely through environment variables so they +/// can run unchanged in a shell, a container, or CI: +/// +/// GO_IOS_BASE_URL Base URL of the go-ios REST daemon. Optional — when unset +/// the examples pass no BaseUrl, so the SDK auto-discovers +/// the local daemon via ~/.go-ios/rest-api.json. Set it only +/// to target a pinned or remote daemon. +/// GO_IOS_API_KEY Bearer token the daemon was started with. REQUIRED +/// unless the daemon runs with --disable-auth (in which +/// case set it to any non-empty placeholder, or export it +/// empty and start the daemon with --disable-auth). +/// GO_IOS_UDID Target device udid. Optional: when unset the examples +/// pick the first device the daemon reports. +/// RUN_UI Set to "1" to also run the (mutating) UI-automation +/// example, which needs a forwarded WebDriverAgent. +/// +/// This type resolves those variables once, builds a single reusable +/// , and offers a small helper to resolve the target +/// device udid (explicit env var, else first attached device). +/// +public sealed class ExampleContext : IDisposable +{ + /// Base URL of the go-ios daemon (from GO_IOS_BASE_URL), or null to auto-discover the local daemon. + public string? BaseUrl { get; } + + /// Bearer token (from GO_IOS_API_KEY). May be empty when the daemon runs with --disable-auth. + public string ApiKey { get; } + + /// Explicit target udid (from GO_IOS_UDID), or null to auto-pick the first device. + public string? PreferredUdid { get; } + + /// The single, reusable, thread-safe SDK client. Construct once, share everywhere. + public IosClient Client { get; } + + private ExampleContext(string? baseUrl, string apiKey, string? preferredUdid) + { + BaseUrl = baseUrl; + ApiKey = apiKey; + PreferredUdid = preferredUdid; + + // The IosClient is thread-safe and intended to be created once and + // reused. It owns its own long-lived HttpClient (streaming endpoints + // are long-lived, so there is no request timeout). + Client = new IosClient(new IosClientOptions + { + BaseUrl = baseUrl, + // Sent as "Authorization: Bearer " on every request. When + // empty the SDK simply omits the header (works with --disable-auth). + ApiKey = string.IsNullOrEmpty(apiKey) ? null : apiKey, + }); + } + + /// + /// Read the environment and build a context. Returns null (after printing a + /// helpful message) when GO_IOS_API_KEY is missing AND the daemon is not + /// obviously in --disable-auth mode — the caller should then exit non-zero. + /// + public static ExampleContext? FromEnvironment() + { + // Leave baseUrl null when GO_IOS_BASE_URL is unset so the SDK falls + // through to local-daemon discovery; we no longer hardcode a default port. + var baseUrl = Environment.GetEnvironmentVariable("GO_IOS_BASE_URL"); + if (string.IsNullOrWhiteSpace(baseUrl)) + baseUrl = null; + + var apiKey = Environment.GetEnvironmentVariable("GO_IOS_API_KEY") ?? ""; + var udid = Environment.GetEnvironmentVariable("GO_IOS_UDID"); + if (string.IsNullOrWhiteSpace(udid)) + udid = null; + + // A missing API key is the single most common misconfiguration, and the + // daemon rejects every /api/v1 route without a bearer token unless it + // was started with --disable-auth. We refuse to guess: if the key is + // absent we explain exactly what to set and let the caller exit 2. + if (string.IsNullOrEmpty(apiKey)) + { + Console.Error.WriteLine( + "GO_IOS_API_KEY is not set.\n" + + "\n" + + "The go-ios daemon protects every /api/v1 route with a bearer token.\n" + + "Start it (it prints the key on startup) and export the key, e.g.:\n" + + "\n" + + " ios api --udid # note the API key it prints\n" + + " export GO_IOS_API_KEY=\n" + + " export GO_IOS_BASE_URL=http://localhost:8080\n" + + "\n" + + "If you deliberately started the daemon with --disable-auth, set\n" + + "GO_IOS_API_KEY to any non-empty placeholder to acknowledge that.\n"); + return null; + } + + return new ExampleContext(baseUrl, apiKey, udid); + } + + /// + /// Resolve the udid to operate on: the explicit GO_IOS_UDID if set, + /// otherwise the first device the daemon reports. Returns null (no device + /// attached) so examples can print SKIP instead of failing. + /// + public async Task ResolveUdidAsync(CancellationToken ct = default) + { + if (PreferredUdid is not null) + return PreferredUdid; + + var devices = await Client.Devices.ListAsync(ct).ConfigureAwait(false); + var first = devices.VarDeviceList?.FirstOrDefault(); + return first?.Properties?.SerialNumber; + } + + public void Dispose() => Client.Dispose(); +} diff --git a/sdks/packages/csharp/examples/GoIos.Examples/ExampleResult.cs b/sdks/packages/csharp/examples/GoIos.Examples/ExampleResult.cs new file mode 100644 index 000000000..b8729b8bc --- /dev/null +++ b/sdks/packages/csharp/examples/GoIos.Examples/ExampleResult.cs @@ -0,0 +1,16 @@ +namespace GoIos.Examples; + +/// +/// Outcome of a single example. An example either succeeds () or +/// is skipped for a documented, non-fatal reason (, e.g. no +/// device attached, or a WDA prerequisite is not met). A thrown exception is a +/// hard failure and is handled by the runner (non-zero exit). +/// +public readonly record struct ExampleResult(bool Skipped, string? Reason) +{ + /// The example ran to completion. + public static ExampleResult Ok(string? note = null) => new(false, note); + + /// The example was skipped for the given (non-fatal) reason. + public static ExampleResult Skip(string reason) => new(true, reason); +} diff --git a/sdks/packages/csharp/examples/GoIos.Examples/Examples.cs b/sdks/packages/csharp/examples/GoIos.Examples/Examples.cs new file mode 100644 index 000000000..4fcdb7e38 --- /dev/null +++ b/sdks/packages/csharp/examples/GoIos.Examples/Examples.cs @@ -0,0 +1,222 @@ +using GoIos; +using GoIos.Sdk; + +namespace GoIos.Examples; + +/// +/// Every example is a small, heavily-commented static method that takes the +/// shared and returns an . +/// +/// The methods are intentionally independent so each one reads as standalone +/// documentation for one slice of the SDK. The dispatcher in Program.cs runs +/// them by name (or all of them in sequence). +/// +public static class Examples +{ + // --------------------------------------------------------------------- + // 1. list-devices — build the client and enumerate attached devices. + // --------------------------------------------------------------------- + public static async Task ListDevicesAsync(ExampleContext ctx, CancellationToken ct) + { + // Devices.ListAsync() returns the daemon's device list. The generated + // model exposes the JSON "deviceList" array as `VarDeviceList`. + var devices = await ctx.Client.Devices.ListAsync(ct); + var list = devices.VarDeviceList ?? new(); + + Console.WriteLine($"Found {list.Count} device(s):"); + foreach (var d in list) + { + // `Properties.SerialNumber` is the udid used to scope every + // device-specific call. ConnectionType is "USB" or "Network". + Console.WriteLine( + $" - udid={d.Properties?.SerialNumber} " + + $"connection={d.Properties?.ConnectionType} " + + $"deviceId={d.DeviceID}"); + } + + if (list.Count == 0) + return ExampleResult.Skip("no devices attached to the daemon"); + + return ExampleResult.Ok(); + } + + // --------------------------------------------------------------------- + // 2. device-info — lockdown + instruments:* values for one device. + // --------------------------------------------------------------------- + public static async Task DeviceInfoAsync(ExampleContext ctx, CancellationToken ct) + { + var udid = await ctx.ResolveUdidAsync(ct); + if (udid is null) + return ExampleResult.Skip("no target device (set GO_IOS_UDID or attach a device)"); + + // Scope operations to one device by udid. `Device(udid)` is cheap; + // it just wraps the shared HTTP pipeline. + var device = ctx.Client.Device(udid); + + // InfoAsync() returns an open map of lockdown values (ProductType, + // ProductVersion, DeviceName, ...) plus instruments:* keys. It is + // surfaced as a dictionary so nothing is lost to a fixed DTO. + var info = await device.InfoAsync(ct); + + Console.WriteLine($"Device info for {udid} ({info.Count} keys):"); + foreach (var key in new[] { "ProductType", "ProductVersion", "DeviceName", "BuildVersion" }) + { + if (info.TryGetValue(key, out var value)) + Console.WriteLine($" {key,-16}= {value}"); + } + + return ExampleResult.Ok(); + } + + // --------------------------------------------------------------------- + // 3. list-apps — installed applications on the device. + // --------------------------------------------------------------------- + public static async Task ListAppsAsync(ExampleContext ctx, CancellationToken ct) + { + var udid = await ctx.ResolveUdidAsync(ct); + if (udid is null) + return ExampleResult.Skip("no target device (set GO_IOS_UDID or attach a device)"); + + var device = ctx.Client.Device(udid); + + // Apps.ListAsync() returns installed apps. Each AppInfo is an Info.plist + // map; the well-known keys are surfaced strongly-typed. + var apps = await device.Apps.ListAsync(ct); + + Console.WriteLine($"{apps.Count} installed app(s) on {udid}. First few:"); + foreach (var app in apps.Take(10)) + { + Console.WriteLine( + $" - {app.CFBundleIdentifier} " + + $"({app.CFBundleName} {app.CFBundleShortVersionString})"); + } + + return ExampleResult.Ok(); + } + + // --------------------------------------------------------------------- + // 4. screenshot — capture a PNG to ./screenshot.png. + // --------------------------------------------------------------------- + public static async Task ScreenshotAsync(ExampleContext ctx, CancellationToken ct) + { + var udid = await ctx.ResolveUdidAsync(ct); + if (udid is null) + return ExampleResult.Skip("no target device (set GO_IOS_UDID or attach a device)"); + + var device = ctx.Client.Device(udid); + + // ScreenshotAsync() returns the raw PNG bytes straight off the wire. + byte[] png = await device.ScreenshotAsync(ct); + + var path = Path.Combine(Directory.GetCurrentDirectory(), "screenshot.png"); + await File.WriteAllBytesAsync(path, png, ct); + + Console.WriteLine($"Wrote {png.Length:N0} bytes to {path}"); + return ExampleResult.Ok(); + } + + // --------------------------------------------------------------------- + // 5. stream-syslog — consume the syslog SSE stream for a bounded window. + // --------------------------------------------------------------------- + public static async Task StreamSyslogAsync(ExampleContext ctx, CancellationToken ct) + { + var udid = await ctx.ResolveUdidAsync(ct); + if (udid is null) + return ExampleResult.Skip("no target device (set GO_IOS_UDID or attach a device)"); + + var device = ctx.Client.Device(udid); + + // Streaming endpoints are long-lived IAsyncEnumerables. We bound this + // example two ways so it always terminates: a ~5s time budget AND a + // cap of ~20 syslog events. Linking the caller's token means Ctrl-C + // still cancels promptly. + const int maxEvents = 20; + using var timeout = new CancellationTokenSource(TimeSpan.FromSeconds(5)); + using var linked = CancellationTokenSource.CreateLinkedTokenSource(ct, timeout.Token); + + Console.WriteLine($"Streaming syslog from {udid} (up to {maxEvents} events / ~5s)..."); + int count = 0; + + try + { + await foreach (var e in device.SyslogAsync(linked.Token)) + { + switch (e) + { + case SyslogMessageEvent s: + count++; + // Trim noisy long lines for the console. + var msg = s.Message.Length > 100 ? s.Message[..100] + "..." : s.Message; + Console.WriteLine($" [{count:D2}] {msg}"); + if (count >= maxEvents) + return ExampleResult.Ok($"captured {count} syslog event(s)"); + break; + + case HeartbeatEvent: + // Live-but-idle keep-alive: the stream is up, nothing to log yet. + break; + + case UnknownEvent u: + Console.WriteLine($" (unknown event '{u.EventName}': {u.RawData})"); + break; + } + } + } + catch (OperationCanceledException) when (timeout.IsCancellationRequested && !ct.IsCancellationRequested) + { + // Expected: our 5s budget elapsed. That is a clean stop, not a failure. + } + + return ExampleResult.Ok($"captured {count} syslog event(s) before the window closed"); + } + + // --------------------------------------------------------------------- + // 6. ui-automation — OPTIONAL. Tap + type via the UI (WDA) backend. + // + // PREREQUISITE: a running / forwarded WebDriverAgent. Start it with + // `ios runwda` (or the daemon's runwda job) and, if needed, forward its + // port so the daemon can reach it. Without a reachable WDA the calls + // fail; this example catches that and SKIPs rather than failing the run. + // + // This example MUTATES the device (it injects a tap and keystrokes), so + // the runner only executes it when RUN_UI=1. + // --------------------------------------------------------------------- + public static async Task UiAutomationAsync(ExampleContext ctx, CancellationToken ct) + { + var udid = await ctx.ResolveUdidAsync(ct); + if (udid is null) + return ExampleResult.Skip("no target device (set GO_IOS_UDID or attach a device)"); + + var device = ctx.Client.Device(udid); + var ui = device.Ui; + + // Give UI calls a short timeout so an unreachable WDA fails fast rather + // than hanging. Backend defaults to "wda". + var options = new UiClient.Options { Timeout = 15 }; + + try + { + // Query the backend health first — the cheapest way to detect that + // WDA is actually forwarded and reachable. + var status = await ui.StatusAsync(options, ct); + Console.WriteLine($"UI backend reachable ({status.Count} status keys). Injecting a tap + type..."); + + // A tap near the top-centre, then type some text into whatever is + // focused. Coordinates are illustrative; adjust for your screen. + await ui.TapAsync(150, 150, options, ct); + await ui.TypeAsync("hello from GoIos.Sdk", options, ct); + + Console.WriteLine("Tap + type dispatched."); + return ExampleResult.Ok(); + } + catch (IosApiException ex) + { + // The daemon reachable but the UI backend/WDA is not wired up. + return ExampleResult.Skip($"UI backend unavailable (HTTP {ex.StatusCode}) — is WDA forwarded? Run `ios runwda`."); + } + catch (HttpRequestException ex) + { + return ExampleResult.Skip($"UI backend unreachable ({ex.Message}) — is WDA forwarded? Run `ios runwda`."); + } + } +} diff --git a/sdks/packages/csharp/examples/GoIos.Examples/GoIos.Examples.csproj b/sdks/packages/csharp/examples/GoIos.Examples/GoIos.Examples.csproj new file mode 100644 index 000000000..e8ffb6d89 --- /dev/null +++ b/sdks/packages/csharp/examples/GoIos.Examples/GoIos.Examples.csproj @@ -0,0 +1,31 @@ + + + + + + Exe + net8.0 + latest + enable + enable + GoIos.Examples + GoIos.Examples + + false + + + + + + + + diff --git a/sdks/packages/csharp/examples/GoIos.Examples/Program.cs b/sdks/packages/csharp/examples/GoIos.Examples/Program.cs new file mode 100644 index 000000000..debe4eeed --- /dev/null +++ b/sdks/packages/csharp/examples/GoIos.Examples/Program.cs @@ -0,0 +1,143 @@ +using GoIos.Examples; + +// ============================================================================= +// GoIos.Examples — runnable docs + pre-release smoke test for GoIos.Sdk. +// +// Usage: +// dotnet run --project examples/GoIos.Examples -- run-all +// dotnet run --project examples/GoIos.Examples -- list-devices +// dotnet run --project examples/GoIos.Examples -- device-info +// dotnet run --project examples/GoIos.Examples -- list-apps +// dotnet run --project examples/GoIos.Examples -- screenshot +// dotnet run --project examples/GoIos.Examples -- stream-syslog +// dotnet run --project examples/GoIos.Examples -- ui-automation +// +// `run-all` runs examples 1-5 (all read-only) in sequence. The mutating +// ui-automation example is only included in run-all when RUN_UI=1. +// +// Exit codes: +// 0 every selected example either succeeded or SKIPped cleanly +// 1 an example threw (hard failure) +// 2 configuration error (missing GO_IOS_API_KEY, unknown command) +// +// Configuration is via environment variables — see ExampleContext for details. +// ============================================================================= + +// Cancel promptly on Ctrl-C and let the streaming example unwind cleanly. +using var cts = new CancellationTokenSource(); +Console.CancelKeyPress += (_, e) => +{ + e.Cancel = true; // don't hard-kill; let cooperative cancellation run. + cts.Cancel(); +}; + +// One command word selects which example(s) to run; default is run-all. +var command = args.Length > 0 ? args[0].Trim().ToLowerInvariant() : "run-all"; + +if (command is "-h" or "--help" or "help") +{ + PrintUsage(); + return 0; +} + +// Build the environment-driven context (client + config). A missing API key is +// a configuration error: the helper already printed how to fix it. +using var ctx = ExampleContext.FromEnvironment(); +if (ctx is null) + return 2; + +Console.WriteLine($"go-ios examples -> {ctx.BaseUrl ?? "(auto-discovered local daemon)"}"); +Console.WriteLine(); + +// Named example registry. Order matters for run-all. +var registry = new (string Name, Func> Run)[] +{ + ("list-devices", Examples.ListDevicesAsync), + ("device-info", Examples.DeviceInfoAsync), + ("list-apps", Examples.ListAppsAsync), + ("screenshot", Examples.ScreenshotAsync), + ("stream-syslog", Examples.StreamSyslogAsync), + ("ui-automation", Examples.UiAutomationAsync), +}; + +// Decide the set to run. +List<(string Name, Func> Run)> toRun; +if (command == "run-all") +{ + var runUi = Environment.GetEnvironmentVariable("RUN_UI") == "1"; + // Examples 1-5 always; ui-automation only when explicitly opted in. + toRun = registry.Where(e => e.Name != "ui-automation" || runUi).ToList(); +} +else +{ + var match = registry.FirstOrDefault(e => e.Name == command); + if (match.Run is null) + { + Console.Error.WriteLine($"Unknown command: '{command}'."); + Console.Error.WriteLine(); + PrintUsage(); + return 2; + } + toRun = new() { match }; +} + +// Run selected examples. A thrown exception is a hard failure that fails the +// whole run (exit 1). A SKIP is reported but does not fail. +int failures = 0; +int skipped = 0; + +foreach (var (name, run) in toRun) +{ + Console.WriteLine($"=== {name} ==="); + try + { + var result = await run(ctx, cts.Token); + if (result.Skipped) + { + skipped++; + Console.WriteLine($"SKIP: {result.Reason}"); + } + else + { + Console.WriteLine(result.Reason is { } note ? $"OK: {note}" : "OK"); + } + } + catch (OperationCanceledException) when (cts.IsCancellationRequested) + { + Console.Error.WriteLine("CANCELLED (Ctrl-C)"); + return 1; + } + catch (Exception ex) + { + failures++; + Console.Error.WriteLine($"FAIL: {ex.GetType().Name}: {ex.Message}"); + } + Console.WriteLine(); +} + +// Summary line, then the exit code the smoke test keys off of. +Console.WriteLine($"Summary: {toRun.Count - failures - skipped} ok, {skipped} skipped, {failures} failed."); +return failures == 0 ? 0 : 1; + +static void PrintUsage() +{ + Console.WriteLine( + "GoIos.Examples — runnable examples for the go-ios C#/.NET SDK.\n" + + "\n" + + "Usage: dotnet run --project examples/GoIos.Examples -- \n" + + "\n" + + "Commands:\n" + + " run-all Run examples 1-5 in sequence (ui-automation too if RUN_UI=1).\n" + + " list-devices List attached devices.\n" + + " device-info Print lockdown/info values for the target device.\n" + + " list-apps List installed applications.\n" + + " screenshot Capture a PNG to ./screenshot.png.\n" + + " stream-syslog Stream ~20 syslog events (~5s) then stop.\n" + + " ui-automation Tap + type via WDA (needs a forwarded WebDriverAgent).\n" + + "\n" + + "Environment:\n" + + " GO_IOS_BASE_URL Daemon base URL (default http://localhost:8080).\n" + + " GO_IOS_API_KEY Bearer token (required unless daemon runs --disable-auth).\n" + + " GO_IOS_UDID Target device udid (optional; first device if unset).\n" + + " RUN_UI=1 Include ui-automation in run-all.\n"); +} diff --git a/sdks/packages/csharp/examples/README.md b/sdks/packages/csharp/examples/README.md new file mode 100644 index 000000000..c59190c3c --- /dev/null +++ b/sdks/packages/csharp/examples/README.md @@ -0,0 +1,102 @@ +# GoIos.Sdk examples + +Runnable, heavily-commented examples for the go-ios C#/.NET SDK. They double as +**documentation** (each example is standalone, annotated source) and as a +**pre-release smoke test** (`run.sh` exercises the read-only surface of a live +go-ios daemon and fails on any exception). + +The project ([`GoIos.Examples`](./GoIos.Examples)) references the SDK facade +project directly, so it always compiles against the exact public API the package +ships. + +## Prerequisites + +- **.NET 8 SDK** (`dotnet` on your `PATH`). +- A running **go-ios REST daemon**. Start it and note the API key it prints: + + ```sh + ios api --udid # prints the base URL and the API key on startup + ``` + + By default the daemon binds an **ephemeral loopback port** and writes a + discovery file at `~/.go-ios/rest-api.json`; the examples auto-discover it, so + you do not need to know or set the port. To pin a fixed port, start it with + `--addr :8080` and set `GO_IOS_BASE_URL=http://localhost:8080`. + + (Or run it with `--disable-auth` for local experiments — see below.) +- For most examples, **an iOS device attached** to the daemon's host. Steps that + need a device print `SKIP` instead of failing when none is available. +- For `ui-automation` only: a **forwarded WebDriverAgent** (`ios runwda`). Without + it that example prints `SKIP`. + +## Configuration + +All configuration is via environment variables: + +| Variable | Default | Meaning | +| ----------------- | ------------------------ | -------------------------------------------------------------- | +| `GO_IOS_BASE_URL` | auto-discovered | Base URL of the go-ios REST daemon. Unset → discover the local daemon (`~/.go-ios/rest-api.json`). | +| `GO_IOS_API_KEY` | *(required)* | Bearer token the daemon prints on startup. | +| `GO_IOS_UDID` | *(first device)* | Target device udid. When unset, the first device is used. | +| `RUN_UI` | *(off)* | Set to `1` to also run the mutating `ui-automation` example. | + +If `GO_IOS_API_KEY` is missing, the examples print how to fix it and exit `2`. +If the daemon was started with `--disable-auth`, set `GO_IOS_API_KEY` to any +non-empty placeholder to acknowledge that. + +## Running + +```sh +# GO_IOS_BASE_URL is optional; unset, the local daemon is auto-discovered. +# export GO_IOS_BASE_URL=http://localhost:8080 # only to pin a fixed/remote daemon +export GO_IOS_API_KEY= +# export GO_IOS_UDID=00008110-000123456789ABCD # optional + +# Run examples 1-5 in sequence (the pre-release smoke test): +./run.sh +# equivalent to: +dotnet run --project GoIos.Examples -- run-all + +# Run one example by name: +dotnet run --project GoIos.Examples -- list-devices +dotnet run --project GoIos.Examples -- device-info +dotnet run --project GoIos.Examples -- list-apps +dotnet run --project GoIos.Examples -- screenshot +dotnet run --project GoIos.Examples -- stream-syslog + +# Include the mutating UI example in run-all: +RUN_UI=1 ./run.sh +# ...or run it directly: +dotnet run --project GoIos.Examples -- ui-automation +``` + +## Examples + +| # | Command | What it shows | +| - | --------------- | ----------------------------------------------------------------------------- | +| 1 | `list-devices` | Build `IosClient`, `Devices.ListAsync()`, print udid/connection per device. | +| 2 | `device-info` | `Device(udid).InfoAsync()` — lockdown + `instruments:*` values. | +| 3 | `list-apps` | `device.Apps.ListAsync()` — installed applications. | +| 4 | `screenshot` | `device.ScreenshotAsync()` → `./screenshot.png`; prints the byte size. | +| 5 | `stream-syslog` | `await foreach` over `device.SyslogAsync()` — ~20 events / ~5s, then stops. | +| 6 | `ui-automation` | `device.Ui` tap + type (needs forwarded WDA; SKIPs if unreachable). Opt-in. | + +## Exit codes + +| Code | Meaning | +| ---- | ------------------------------------------------------------- | +| `0` | Every selected example succeeded or `SKIP`ped cleanly. | +| `1` | An example threw (hard failure). | +| `2` | Configuration error (missing `GO_IOS_API_KEY`, unknown cmd). | + +`SKIP` (no device attached, WDA not forwarded, …) is **not** a failure — the run +still exits `0`, which keeps `run.sh` usable as a smoke test even on a host with +no device currently attached. + +## Building only + +To verify the examples compile without a daemon: + +```sh +dotnet build -c Release GoIos.Examples/GoIos.Examples.csproj +``` diff --git a/sdks/packages/csharp/examples/run.sh b/sdks/packages/csharp/examples/run.sh new file mode 100755 index 000000000..8a71f3b5e --- /dev/null +++ b/sdks/packages/csharp/examples/run.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +# +# Runnable pre-release smoke test for the go-ios C#/.NET SDK. +# +# Runs examples 1-5 against a live go-ios daemon and exits non-zero if any of +# them throws. Steps that need a device (or a forwarded WDA) print SKIP without +# failing, so this is safe to run even with no device attached — though for a +# real smoke test you want a device connected. +# +# Configure via environment (see examples/README.md): +# GO_IOS_BASE_URL default http://localhost:8080 +# GO_IOS_API_KEY required (unless the daemon runs with --disable-auth) +# GO_IOS_UDID optional; first device is used when unset +# RUN_UI=1 also run the mutating ui-automation example +# +# `dotnet` must be on PATH. +set -euo pipefail + +# Resolve this script's directory so it works from anywhere. +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +exec dotnet run --project "${SCRIPT_DIR}/GoIos.Examples" -- run-all diff --git a/sdks/packages/csharp/openapitools.json b/sdks/packages/csharp/openapitools.json new file mode 100644 index 000000000..a82623d64 --- /dev/null +++ b/sdks/packages/csharp/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "7.14.0" + } +} diff --git a/sdks/packages/csharp/regen.sh b/sdks/packages/csharp/regen.sh new file mode 100755 index 000000000..27589428a --- /dev/null +++ b/sdks/packages/csharp/regen.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash +# Regenerate the low-level C# client from the canonical OpenAPI 3.1 spec. +# Requires: Java (for openapi-generator) and npx. +# +# The hand-written facade under src/GoIos.Sdk/ is NOT touched. +set -euo pipefail + +HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +SPEC="$HERE/../../spec/openapi/openapi.yaml" +OUT="$HERE/src/Generated" +GEN_VERSION="7.14.0" + +# npx can inherit a NODE_OPTIONS that breaks the CLI wrapper; clear it. +unset NODE_OPTIONS || true + +cat > "$HERE/.openapi-generator-config.json" <<'JSON' +{ + "packageName": "GoIos.Sdk.Generated", + "targetFramework": "net8.0", + "library": "httpclient", + "nullableReferenceTypes": true, + "useDateTimeOffset": true, + "netCoreProjectFile": true, + "validatable": false, + "hideGenerationTimestamp": true, + "packageVersion": "0.1.0", + "sourceFolder": "src" +} +JSON + +npx --yes "@openapitools/openapi-generator-cli@2.20.0" version-manager set "$GEN_VERSION" +npx --yes "@openapitools/openapi-generator-cli@2.20.0" generate \ + -g csharp \ + -i "$SPEC" \ + -o "$OUT" \ + -c "$HERE/.openapi-generator-config.json" \ + --skip-validate-spec + +# Post-fix: openapi-generator (7.14.0) emits a dangling base-class comma for +# anyOf union models whose only extra variant is an empty object (Heartbeat), +# producing "class X : AbstractOpenAPISchema, " which does not compile. Strip it. +find "$OUT/src" -name '*.cs' -print0 \ + | xargs -0 sed -i '' -E 's/(: AbstractOpenAPISchema),[[:space:]]*$/\1/' + +# Drop generator scaffolding we do not commit (its own test project + solution). +rm -rf "$OUT/src/GoIos.Sdk.Generated.Test" "$OUT/GoIos.Sdk.Generated.sln" "$OUT/git_push.sh" + +echo "Regenerated low-level client into $OUT" diff --git a/sdks/packages/csharp/src/Generated/.gitignore b/sdks/packages/csharp/src/Generated/.gitignore new file mode 100644 index 000000000..1ee53850b --- /dev/null +++ b/sdks/packages/csharp/src/Generated/.gitignore @@ -0,0 +1,362 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/sdks/packages/csharp/src/Generated/.openapi-generator-ignore b/sdks/packages/csharp/src/Generated/.openapi-generator-ignore new file mode 100644 index 000000000..7484ee590 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/sdks/packages/csharp/src/Generated/.openapi-generator/FILES b/sdks/packages/csharp/src/Generated/.openapi-generator/FILES new file mode 100644 index 000000000..eb38d5cb6 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/.openapi-generator/FILES @@ -0,0 +1,272 @@ +.gitignore +GoIos.Sdk.Generated.sln +README.md +api/openapi.yaml +appveyor.yml +docs/AXEnabledRequest.md +docs/AgentShutdown.md +docs/AppInfo.md +docs/AppStateNotification.md +docs/AssistiveTouchState.md +docs/AttachDetachEvent.md +docs/BatteryInfo.md +docs/BatteryRegistry.md +docs/CpuUsageSample.md +docs/CrashListing.md +docs/DefaultApi.md +docs/DevModeRequest.md +docs/DevModeState.md +docs/DeviceDate.md +docs/DeviceEntry.md +docs/DeviceList.md +docs/DeviceName.md +docs/DeviceProperties.md +docs/DevicesGetJob404Response.md +docs/DiskSpaceInfo.md +docs/EnabledRequest.md +docs/FileDomain.md +docs/FileEntry.md +docs/FileListing.md +docs/FilePushResult.md +docs/ForwardRequest.md +docs/FsyncListing.md +docs/FsyncMessage.md +docs/FsyncPushResult.md +docs/FsyncTreeEntry.md +docs/FsyncTreeListing.md +docs/GenericResponse.md +docs/Job.md +docs/JobLogEvents.md +docs/JobLogLine.md +docs/JobStatus.md +docs/LanguageConfiguration.md +docs/ListenEvents.md +docs/MemLimitRequest.md +docs/MemLimitResult.md +docs/MountedImages.md +docs/NetworkInfo.md +docs/NotificationEvents.md +docs/OsTraceEntry.md +docs/OsTraceEvents.md +docs/PasteboardContent.md +docs/PrepareResult.md +docs/PrepareSkipOptions.md +docs/ProcessInfo.md +docs/Profile.md +docs/ProfileType.md +docs/ProvisioningResult.md +docs/RsdServiceEntry.md +docs/RunTestRequest.md +docs/SetLanguageRequest.md +docs/StatusOk.md +docs/SupervisionCert.md +docs/SyslogEvents.md +docs/SyslogMessage.md +docs/SysmontapEvents.md +docs/TimeFormatRequest.md +docs/TimeFormatState.md +docs/Tunnel.md +docs/TunnelStopped.md +docs/UIAPIRequest.md +docs/UIAppRequest.md +docs/UIButtonRequest.md +docs/UILongPressRequest.md +docs/UIOrientationRequest.md +docs/UISwipeRequest.md +docs/UITapRequest.md +docs/UITypeRequest.md +docs/UnlockToken.md +docs/VoiceOverState.md +docs/WdaConfig.md +docs/WdaSession.md +docs/WebInspectorEvalRequest.md +docs/WebInspectorEvalResult.md +docs/WebInspectorLaunchRequest.md +docs/WebInspectorLaunchResult.md +docs/WifiRequest.md +docs/ZoomTouchState.md +git_push.sh +src/GoIos.Sdk.Generated.Test/Api/DefaultApiTests.cs +src/GoIos.Sdk.Generated.Test/GoIos.Sdk.Generated.Test.csproj +src/GoIos.Sdk.Generated.Test/Model/AXEnabledRequestTests.cs +src/GoIos.Sdk.Generated.Test/Model/AgentShutdownTests.cs +src/GoIos.Sdk.Generated.Test/Model/AppInfoTests.cs +src/GoIos.Sdk.Generated.Test/Model/AppStateNotificationTests.cs +src/GoIos.Sdk.Generated.Test/Model/AssistiveTouchStateTests.cs +src/GoIos.Sdk.Generated.Test/Model/AttachDetachEventTests.cs +src/GoIos.Sdk.Generated.Test/Model/BatteryInfoTests.cs +src/GoIos.Sdk.Generated.Test/Model/BatteryRegistryTests.cs +src/GoIos.Sdk.Generated.Test/Model/CpuUsageSampleTests.cs +src/GoIos.Sdk.Generated.Test/Model/CrashListingTests.cs +src/GoIos.Sdk.Generated.Test/Model/DevModeRequestTests.cs +src/GoIos.Sdk.Generated.Test/Model/DevModeStateTests.cs +src/GoIos.Sdk.Generated.Test/Model/DeviceDateTests.cs +src/GoIos.Sdk.Generated.Test/Model/DeviceEntryTests.cs +src/GoIos.Sdk.Generated.Test/Model/DeviceListTests.cs +src/GoIos.Sdk.Generated.Test/Model/DeviceNameTests.cs +src/GoIos.Sdk.Generated.Test/Model/DevicePropertiesTests.cs +src/GoIos.Sdk.Generated.Test/Model/DevicesGetJob404ResponseTests.cs +src/GoIos.Sdk.Generated.Test/Model/DiskSpaceInfoTests.cs +src/GoIos.Sdk.Generated.Test/Model/EnabledRequestTests.cs +src/GoIos.Sdk.Generated.Test/Model/FileDomainTests.cs +src/GoIos.Sdk.Generated.Test/Model/FileEntryTests.cs +src/GoIos.Sdk.Generated.Test/Model/FileListingTests.cs +src/GoIos.Sdk.Generated.Test/Model/FilePushResultTests.cs +src/GoIos.Sdk.Generated.Test/Model/ForwardRequestTests.cs +src/GoIos.Sdk.Generated.Test/Model/FsyncListingTests.cs +src/GoIos.Sdk.Generated.Test/Model/FsyncMessageTests.cs +src/GoIos.Sdk.Generated.Test/Model/FsyncPushResultTests.cs +src/GoIos.Sdk.Generated.Test/Model/FsyncTreeEntryTests.cs +src/GoIos.Sdk.Generated.Test/Model/FsyncTreeListingTests.cs +src/GoIos.Sdk.Generated.Test/Model/GenericResponseTests.cs +src/GoIos.Sdk.Generated.Test/Model/JobLogEventsTests.cs +src/GoIos.Sdk.Generated.Test/Model/JobLogLineTests.cs +src/GoIos.Sdk.Generated.Test/Model/JobStatusTests.cs +src/GoIos.Sdk.Generated.Test/Model/JobTests.cs +src/GoIos.Sdk.Generated.Test/Model/LanguageConfigurationTests.cs +src/GoIos.Sdk.Generated.Test/Model/ListenEventsTests.cs +src/GoIos.Sdk.Generated.Test/Model/MemLimitRequestTests.cs +src/GoIos.Sdk.Generated.Test/Model/MemLimitResultTests.cs +src/GoIos.Sdk.Generated.Test/Model/MountedImagesTests.cs +src/GoIos.Sdk.Generated.Test/Model/NetworkInfoTests.cs +src/GoIos.Sdk.Generated.Test/Model/NotificationEventsTests.cs +src/GoIos.Sdk.Generated.Test/Model/OsTraceEntryTests.cs +src/GoIos.Sdk.Generated.Test/Model/OsTraceEventsTests.cs +src/GoIos.Sdk.Generated.Test/Model/PasteboardContentTests.cs +src/GoIos.Sdk.Generated.Test/Model/PrepareResultTests.cs +src/GoIos.Sdk.Generated.Test/Model/PrepareSkipOptionsTests.cs +src/GoIos.Sdk.Generated.Test/Model/ProcessInfoTests.cs +src/GoIos.Sdk.Generated.Test/Model/ProfileTests.cs +src/GoIos.Sdk.Generated.Test/Model/ProfileTypeTests.cs +src/GoIos.Sdk.Generated.Test/Model/ProvisioningResultTests.cs +src/GoIos.Sdk.Generated.Test/Model/RsdServiceEntryTests.cs +src/GoIos.Sdk.Generated.Test/Model/RunTestRequestTests.cs +src/GoIos.Sdk.Generated.Test/Model/SetLanguageRequestTests.cs +src/GoIos.Sdk.Generated.Test/Model/StatusOkTests.cs +src/GoIos.Sdk.Generated.Test/Model/SupervisionCertTests.cs +src/GoIos.Sdk.Generated.Test/Model/SyslogEventsTests.cs +src/GoIos.Sdk.Generated.Test/Model/SyslogMessageTests.cs +src/GoIos.Sdk.Generated.Test/Model/SysmontapEventsTests.cs +src/GoIos.Sdk.Generated.Test/Model/TimeFormatRequestTests.cs +src/GoIos.Sdk.Generated.Test/Model/TimeFormatStateTests.cs +src/GoIos.Sdk.Generated.Test/Model/TunnelStoppedTests.cs +src/GoIos.Sdk.Generated.Test/Model/TunnelTests.cs +src/GoIos.Sdk.Generated.Test/Model/UIAPIRequestTests.cs +src/GoIos.Sdk.Generated.Test/Model/UIAppRequestTests.cs +src/GoIos.Sdk.Generated.Test/Model/UIButtonRequestTests.cs +src/GoIos.Sdk.Generated.Test/Model/UILongPressRequestTests.cs +src/GoIos.Sdk.Generated.Test/Model/UIOrientationRequestTests.cs +src/GoIos.Sdk.Generated.Test/Model/UISwipeRequestTests.cs +src/GoIos.Sdk.Generated.Test/Model/UITapRequestTests.cs +src/GoIos.Sdk.Generated.Test/Model/UITypeRequestTests.cs +src/GoIos.Sdk.Generated.Test/Model/UnlockTokenTests.cs +src/GoIos.Sdk.Generated.Test/Model/VoiceOverStateTests.cs +src/GoIos.Sdk.Generated.Test/Model/WdaConfigTests.cs +src/GoIos.Sdk.Generated.Test/Model/WdaSessionTests.cs +src/GoIos.Sdk.Generated.Test/Model/WebInspectorEvalRequestTests.cs +src/GoIos.Sdk.Generated.Test/Model/WebInspectorEvalResultTests.cs +src/GoIos.Sdk.Generated.Test/Model/WebInspectorLaunchRequestTests.cs +src/GoIos.Sdk.Generated.Test/Model/WebInspectorLaunchResultTests.cs +src/GoIos.Sdk.Generated.Test/Model/WifiRequestTests.cs +src/GoIos.Sdk.Generated.Test/Model/ZoomTouchStateTests.cs +src/GoIos.Sdk.Generated/Api/DefaultApi.cs +src/GoIos.Sdk.Generated/Client/ApiClient.cs +src/GoIos.Sdk.Generated/Client/ApiException.cs +src/GoIos.Sdk.Generated/Client/ApiResponse.cs +src/GoIos.Sdk.Generated/Client/ClientUtils.cs +src/GoIos.Sdk.Generated/Client/Configuration.cs +src/GoIos.Sdk.Generated/Client/ExceptionFactory.cs +src/GoIos.Sdk.Generated/Client/FileParameter.cs +src/GoIos.Sdk.Generated/Client/GlobalConfiguration.cs +src/GoIos.Sdk.Generated/Client/IApiAccessor.cs +src/GoIos.Sdk.Generated/Client/IAsynchronousClient.cs +src/GoIos.Sdk.Generated/Client/IReadableConfiguration.cs +src/GoIos.Sdk.Generated/Client/ISynchronousClient.cs +src/GoIos.Sdk.Generated/Client/Multimap.cs +src/GoIos.Sdk.Generated/Client/OpenAPIDateConverter.cs +src/GoIos.Sdk.Generated/Client/RequestOptions.cs +src/GoIos.Sdk.Generated/Client/RetryConfiguration.cs +src/GoIos.Sdk.Generated/Client/WebRequestPathBuilder.cs +src/GoIos.Sdk.Generated/GoIos.Sdk.Generated.csproj +src/GoIos.Sdk.Generated/Model/AXEnabledRequest.cs +src/GoIos.Sdk.Generated/Model/AbstractOpenAPISchema.cs +src/GoIos.Sdk.Generated/Model/AgentShutdown.cs +src/GoIos.Sdk.Generated/Model/AppInfo.cs +src/GoIos.Sdk.Generated/Model/AppStateNotification.cs +src/GoIos.Sdk.Generated/Model/AssistiveTouchState.cs +src/GoIos.Sdk.Generated/Model/AttachDetachEvent.cs +src/GoIos.Sdk.Generated/Model/BatteryInfo.cs +src/GoIos.Sdk.Generated/Model/BatteryRegistry.cs +src/GoIos.Sdk.Generated/Model/CpuUsageSample.cs +src/GoIos.Sdk.Generated/Model/CrashListing.cs +src/GoIos.Sdk.Generated/Model/DevModeRequest.cs +src/GoIos.Sdk.Generated/Model/DevModeState.cs +src/GoIos.Sdk.Generated/Model/DeviceDate.cs +src/GoIos.Sdk.Generated/Model/DeviceEntry.cs +src/GoIos.Sdk.Generated/Model/DeviceList.cs +src/GoIos.Sdk.Generated/Model/DeviceName.cs +src/GoIos.Sdk.Generated/Model/DeviceProperties.cs +src/GoIos.Sdk.Generated/Model/DevicesGetJob404Response.cs +src/GoIos.Sdk.Generated/Model/DiskSpaceInfo.cs +src/GoIos.Sdk.Generated/Model/EnabledRequest.cs +src/GoIos.Sdk.Generated/Model/FileDomain.cs +src/GoIos.Sdk.Generated/Model/FileEntry.cs +src/GoIos.Sdk.Generated/Model/FileListing.cs +src/GoIos.Sdk.Generated/Model/FilePushResult.cs +src/GoIos.Sdk.Generated/Model/ForwardRequest.cs +src/GoIos.Sdk.Generated/Model/FsyncListing.cs +src/GoIos.Sdk.Generated/Model/FsyncMessage.cs +src/GoIos.Sdk.Generated/Model/FsyncPushResult.cs +src/GoIos.Sdk.Generated/Model/FsyncTreeEntry.cs +src/GoIos.Sdk.Generated/Model/FsyncTreeListing.cs +src/GoIos.Sdk.Generated/Model/GenericResponse.cs +src/GoIos.Sdk.Generated/Model/Job.cs +src/GoIos.Sdk.Generated/Model/JobLogEvents.cs +src/GoIos.Sdk.Generated/Model/JobLogLine.cs +src/GoIos.Sdk.Generated/Model/JobStatus.cs +src/GoIos.Sdk.Generated/Model/LanguageConfiguration.cs +src/GoIos.Sdk.Generated/Model/ListenEvents.cs +src/GoIos.Sdk.Generated/Model/MemLimitRequest.cs +src/GoIos.Sdk.Generated/Model/MemLimitResult.cs +src/GoIos.Sdk.Generated/Model/MountedImages.cs +src/GoIos.Sdk.Generated/Model/NetworkInfo.cs +src/GoIos.Sdk.Generated/Model/NotificationEvents.cs +src/GoIos.Sdk.Generated/Model/OsTraceEntry.cs +src/GoIos.Sdk.Generated/Model/OsTraceEvents.cs +src/GoIos.Sdk.Generated/Model/PasteboardContent.cs +src/GoIos.Sdk.Generated/Model/PrepareResult.cs +src/GoIos.Sdk.Generated/Model/PrepareSkipOptions.cs +src/GoIos.Sdk.Generated/Model/ProcessInfo.cs +src/GoIos.Sdk.Generated/Model/Profile.cs +src/GoIos.Sdk.Generated/Model/ProfileType.cs +src/GoIos.Sdk.Generated/Model/ProvisioningResult.cs +src/GoIos.Sdk.Generated/Model/RsdServiceEntry.cs +src/GoIos.Sdk.Generated/Model/RunTestRequest.cs +src/GoIos.Sdk.Generated/Model/SetLanguageRequest.cs +src/GoIos.Sdk.Generated/Model/StatusOk.cs +src/GoIos.Sdk.Generated/Model/SupervisionCert.cs +src/GoIos.Sdk.Generated/Model/SyslogEvents.cs +src/GoIos.Sdk.Generated/Model/SyslogMessage.cs +src/GoIos.Sdk.Generated/Model/SysmontapEvents.cs +src/GoIos.Sdk.Generated/Model/TimeFormatRequest.cs +src/GoIos.Sdk.Generated/Model/TimeFormatState.cs +src/GoIos.Sdk.Generated/Model/Tunnel.cs +src/GoIos.Sdk.Generated/Model/TunnelStopped.cs +src/GoIos.Sdk.Generated/Model/UIAPIRequest.cs +src/GoIos.Sdk.Generated/Model/UIAppRequest.cs +src/GoIos.Sdk.Generated/Model/UIButtonRequest.cs +src/GoIos.Sdk.Generated/Model/UILongPressRequest.cs +src/GoIos.Sdk.Generated/Model/UIOrientationRequest.cs +src/GoIos.Sdk.Generated/Model/UISwipeRequest.cs +src/GoIos.Sdk.Generated/Model/UITapRequest.cs +src/GoIos.Sdk.Generated/Model/UITypeRequest.cs +src/GoIos.Sdk.Generated/Model/UnlockToken.cs +src/GoIos.Sdk.Generated/Model/VoiceOverState.cs +src/GoIos.Sdk.Generated/Model/WdaConfig.cs +src/GoIos.Sdk.Generated/Model/WdaSession.cs +src/GoIos.Sdk.Generated/Model/WebInspectorEvalRequest.cs +src/GoIos.Sdk.Generated/Model/WebInspectorEvalResult.cs +src/GoIos.Sdk.Generated/Model/WebInspectorLaunchRequest.cs +src/GoIos.Sdk.Generated/Model/WebInspectorLaunchResult.cs +src/GoIos.Sdk.Generated/Model/WifiRequest.cs +src/GoIos.Sdk.Generated/Model/ZoomTouchState.cs diff --git a/sdks/packages/csharp/src/Generated/.openapi-generator/VERSION b/sdks/packages/csharp/src/Generated/.openapi-generator/VERSION new file mode 100644 index 000000000..e465da431 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.14.0 diff --git a/sdks/packages/csharp/src/Generated/README.md b/sdks/packages/csharp/src/Generated/README.md new file mode 100644 index 000000000..aafc30d1f --- /dev/null +++ b/sdks/packages/csharp/src/Generated/README.md @@ -0,0 +1,393 @@ +# GoIos.Sdk.Generated - the C# library for the go-ios REST API + +go-ios REST API. + +This is the *ideal* contract for the go-ios REST server. It is authored +spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms +to this document (there is no backward-compatibility constraint yet). + +## Authentication + +Every route under `/api/v1` requires a bearer token: +`Authorization: Bearer `. The server refuses to start unless +either an API key is configured or it is launched with `- -disable-auth`. + +When the server is started with `- -disable-auth`, authentication is **not** +enforced and the `Authorization` header may be omitted. The Swagger UI +(`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is +not modeled here. + +## Device routing + +Device-scoped routes live under `/device/{udid}`. A middleware resolves the +udid: an unknown udid yields `404`, an empty udid yields `422`. The +`/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request +per device). + +## Streaming + +Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, +`/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent +Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 0.1.0 +- SDK version: 0.1.0 +- Generator version: 7.14.0 +- Build package: org.openapitools.codegen.languages.CSharpClientCodegen + + +## Frameworks supported + + +## Dependencies + +- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 13.0.2 or later +- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.8.0 or later + +The DLLs included in the package may not be the latest version. We recommend using [NuGet](https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: +``` +Install-Package Newtonsoft.Json +Install-Package JsonSubTypes +``` + +## Installation +Run the following command to generate the DLL +- [Mac/Linux] `/bin/sh build.sh` +- [Windows] `build.bat` + +Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces: +```csharp +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; +``` + +## Packaging + +A `.nuspec` is included with the project. You can follow the Nuget quickstart to [create](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#create-the-package) and [publish](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#publish-the-package) packages. + +This `.nuspec` uses placeholders from the `.csproj`, so build the `.csproj` directly: + +``` +nuget pack -Build -OutputDirectory out GoIos.Sdk.Generated.csproj +``` + +Then, publish to a [local feed](https://docs.microsoft.com/en-us/nuget/hosting-packages/local-feeds) or [other host](https://docs.microsoft.com/en-us/nuget/hosting-packages/overview) and consume the new package via Nuget as usual. + + +## Usage + +To use the API client with a HTTP proxy, setup a `System.Net.WebProxy` +```csharp +Configuration c = new Configuration(); +System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/"); +webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials; +c.Proxy = webProxy; +``` + +### Connections +Each ApiClass (properly the ApiClient inside it) will create an instance of HttpClient. It will use that for the entire lifecycle and dispose it when called the Dispose method. + +To better manager the connections it's a common practice to reuse the HttpClient and HttpClientHandler (see [here](https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests#issues-with-the-original-httpclient-class-available-in-net) for details). To use your own HttpClient instance just pass it to the ApiClass constructor. + +```csharp +HttpClientHandler yourHandler = new HttpClientHandler(); +HttpClient yourHttpClient = new HttpClient(yourHandler); +var api = new YourApiClass(yourHttpClient, yourHandler); +``` + +If you want to use an HttpClient and don't have access to the handler, for example in a DI context in Asp.net Core when using IHttpClientFactory. + +```csharp +HttpClient yourHttpClient = new HttpClient(); +var api = new YourApiClass(yourHttpClient); +``` +You'll loose some configuration settings, the features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. You need to either manually handle those in your setup of the HttpClient or they won't be available. + +Here an example of DI setup in a sample web project: + +```csharp +services.AddHttpClient(httpClient => + new PetApi(httpClient)); +``` + + + +## Getting Started + +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class Example + { + public static void Main() + { + + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Get accessibility element snapshot + Object result = apiInstance.AccessibilityGetAxSnapshot(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.AccessibilityGetAxSnapshot: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + + } + } +} +``` + + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:60105* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**AccessibilityGetAxSnapshot**](docs/DefaultApi.md#accessibilitygetaxsnapshot) | **GET** /api/v1/device/{udid}/ax | Get accessibility element snapshot +*DefaultApi* | [**AccessibilityGetVoiceOver**](docs/DefaultApi.md#accessibilitygetvoiceover) | **GET** /api/v1/device/{udid}/voiceover | Get VoiceOver state +*DefaultApi* | [**AccessibilityGetZoomTouch**](docs/DefaultApi.md#accessibilitygetzoomtouch) | **GET** /api/v1/device/{udid}/zoom | Get ZoomTouch state +*DefaultApi* | [**AccessibilityRunAxAudit**](docs/DefaultApi.md#accessibilityrunaxaudit) | **POST** /api/v1/device/{udid}/ax/audit | Run accessibility audit +*DefaultApi* | [**AccessibilitySetLocationGpx**](docs/DefaultApi.md#accessibilitysetlocationgpx) | **PUT** /api/v1/device/{udid}/setlocation/gpx | Simulate location from a GPX file +*DefaultApi* | [**AccessibilitySetVoiceOver**](docs/DefaultApi.md#accessibilitysetvoiceover) | **PUT** /api/v1/device/{udid}/voiceover | Set VoiceOver state +*DefaultApi* | [**AccessibilitySetZoomTouch**](docs/DefaultApi.md#accessibilitysetzoomtouch) | **PUT** /api/v1/device/{udid}/zoom | Set ZoomTouch state +*DefaultApi* | [**DevicesActivate**](docs/DefaultApi.md#devicesactivate) | **POST** /api/v1/device/{udid}/activate | Activate device +*DefaultApi* | [**DevicesAddProfile**](docs/DefaultApi.md#devicesaddprofile) | **POST** /api/v1/device/{udid}/profiles | Install profile +*DefaultApi* | [**DevicesCreateWdaSession**](docs/DefaultApi.md#devicescreatewdasession) | **POST** /api/v1/device/{udid}/wda/session | Start WDA session +*DefaultApi* | [**DevicesDeleteWdaSession**](docs/DefaultApi.md#devicesdeletewdasession) | **DELETE** /api/v1/device/{udid}/wda/session/{sessionId} | Stop WDA session +*DefaultApi* | [**DevicesDisableCondition**](docs/DefaultApi.md#devicesdisablecondition) | **POST** /api/v1/device/{udid}/disable-condition | Disable condition +*DefaultApi* | [**DevicesEnableCondition**](docs/DefaultApi.md#devicesenablecondition) | **PUT** /api/v1/device/{udid}/enable-condition | Enable condition +*DefaultApi* | [**DevicesErase**](docs/DefaultApi.md#deviceserase) | **POST** /api/v1/device/{udid}/erase | Erase device +*DefaultApi* | [**DevicesGetAssistiveTouch**](docs/DefaultApi.md#devicesgetassistivetouch) | **GET** /api/v1/device/{udid}/assistivetouch | Get AssistiveTouch +*DefaultApi* | [**DevicesGetBattery**](docs/DefaultApi.md#devicesgetbattery) | **GET** /api/v1/device/{udid}/battery | Get battery info +*DefaultApi* | [**DevicesGetDevMode**](docs/DefaultApi.md#devicesgetdevmode) | **GET** /api/v1/device/{udid}/devmode | Get developer mode +*DefaultApi* | [**DevicesGetDeviceDate**](docs/DefaultApi.md#devicesgetdevicedate) | **GET** /api/v1/device/{udid}/date | Get device date +*DefaultApi* | [**DevicesGetDeviceName**](docs/DefaultApi.md#devicesgetdevicename) | **GET** /api/v1/device/{udid}/devicename | Get device name +*DefaultApi* | [**DevicesGetDiagnostics**](docs/DefaultApi.md#devicesgetdiagnostics) | **GET** /api/v1/device/{udid}/diagnostics | List diagnostics +*DefaultApi* | [**DevicesGetIconLayout**](docs/DefaultApi.md#devicesgeticonlayout) | **GET** /api/v1/device/{udid}/icon-layout | Get icon layout +*DefaultApi* | [**DevicesGetInfo**](docs/DefaultApi.md#devicesgetinfo) | **GET** /api/v1/device/{udid}/info | Get device info +*DefaultApi* | [**DevicesGetJob**](docs/DefaultApi.md#devicesgetjob) | **GET** /api/v1/device/{udid}/jobs/{id} | Get job +*DefaultApi* | [**DevicesGetLanguage**](docs/DefaultApi.md#devicesgetlanguage) | **GET** /api/v1/device/{udid}/lang | Get language +*DefaultApi* | [**DevicesGetLockdownValues**](docs/DefaultApi.md#devicesgetlockdownvalues) | **GET** /api/v1/device/{udid}/lockdown | Get lockdown values +*DefaultApi* | [**DevicesGetMobileGestalt**](docs/DefaultApi.md#devicesgetmobilegestalt) | **GET** /api/v1/device/{udid}/mobilegestalt | Query MobileGestalt +*DefaultApi* | [**DevicesGetPasteboard**](docs/DefaultApi.md#devicesgetpasteboard) | **GET** /api/v1/device/{udid}/pasteboard | Get pasteboard +*DefaultApi* | [**DevicesGetProcesses**](docs/DefaultApi.md#devicesgetprocesses) | **GET** /api/v1/device/{udid}/processes | List processes +*DefaultApi* | [**DevicesGetProfiles**](docs/DefaultApi.md#devicesgetprofiles) | **GET** /api/v1/device/{udid}/profiles | List configuration profiles +*DefaultApi* | [**DevicesGetTimeFormat**](docs/DefaultApi.md#devicesgettimeformat) | **GET** /api/v1/device/{udid}/timeformat | Get time format +*DefaultApi* | [**DevicesGetWallpaper**](docs/DefaultApi.md#devicesgetwallpaper) | **GET** /api/v1/device/{udid}/wallpaper | Get wallpaper +*DefaultApi* | [**DevicesGetWdaSession**](docs/DefaultApi.md#devicesgetwdasession) | **GET** /api/v1/device/{udid}/wda/session/{sessionId} | Get WDA session +*DefaultApi* | [**DevicesInstallApp**](docs/DefaultApi.md#devicesinstallapp) | **POST** /api/v1/device/{udid}/apps/install | Install app +*DefaultApi* | [**DevicesKillApp**](docs/DefaultApi.md#deviceskillapp) | **POST** /api/v1/device/{udid}/apps/kill | Kill app +*DefaultApi* | [**DevicesLaunchApp**](docs/DefaultApi.md#deviceslaunchapp) | **POST** /api/v1/device/{udid}/apps/launch | Launch app +*DefaultApi* | [**DevicesListApps**](docs/DefaultApi.md#deviceslistapps) | **GET** /api/v1/device/{udid}/apps/ | List apps +*DefaultApi* | [**DevicesListConditions**](docs/DefaultApi.md#deviceslistconditions) | **GET** /api/v1/device/{udid}/conditions | List conditions +*DefaultApi* | [**DevicesListCrashes**](docs/DefaultApi.md#deviceslistcrashes) | **GET** /api/v1/device/{udid}/crashes | List crash reports +*DefaultApi* | [**DevicesListFiles**](docs/DefaultApi.md#deviceslistfiles) | **GET** /api/v1/device/{udid}/files | List files +*DefaultApi* | [**DevicesListImages**](docs/DefaultApi.md#deviceslistimages) | **GET** /api/v1/device/{udid}/image | List mounted developer images +*DefaultApi* | [**DevicesListJobs**](docs/DefaultApi.md#deviceslistjobs) | **GET** /api/v1/device/{udid}/jobs | List jobs +*DefaultApi* | [**DevicesListMountedImages**](docs/DefaultApi.md#deviceslistmountedimages) | **GET** /api/v1/device/{udid}/image/list | List mounted images +*DefaultApi* | [**DevicesMdmClearPasscode**](docs/DefaultApi.md#devicesmdmclearpasscode) | **POST** /api/v1/device/{udid}/mdm/clear-passcode | Clear passcode (supervised) +*DefaultApi* | [**DevicesMdmClearScreenTimePassword**](docs/DefaultApi.md#devicesmdmclearscreentimepassword) | **POST** /api/v1/device/{udid}/mdm/clear-screen-time-password | Clear Screen Time password (supervised) +*DefaultApi* | [**DevicesMdmFetchUnlockToken**](docs/DefaultApi.md#devicesmdmfetchunlocktoken) | **POST** /api/v1/device/{udid}/mdm/fetch-unlock-token | Fetch unlock token (supervised) +*DefaultApi* | [**DevicesMdmSecurityInfo**](docs/DefaultApi.md#devicesmdmsecurityinfo) | **POST** /api/v1/device/{udid}/mdm/security-info | Get MDM security info (supervised) +*DefaultApi* | [**DevicesMemLimitOff**](docs/DefaultApi.md#devicesmemlimitoff) | **POST** /api/v1/device/{udid}/memlimitoff | Waive memory limit +*DefaultApi* | [**DevicesMountImage**](docs/DefaultApi.md#devicesmountimage) | **PUT** /api/v1/device/{udid}/image | Mount a developer image +*DefaultApi* | [**DevicesPair**](docs/DefaultApi.md#devicespair) | **POST** /api/v1/device/{udid}/pair | Pair device +*DefaultApi* | [**DevicesPullFile**](docs/DefaultApi.md#devicespullfile) | **GET** /api/v1/device/{udid}/files/pull | Pull file +*DefaultApi* | [**DevicesPushFile**](docs/DefaultApi.md#devicespushfile) | **POST** /api/v1/device/{udid}/files/push | Push file +*DefaultApi* | [**DevicesReboot**](docs/DefaultApi.md#devicesreboot) | **POST** /api/v1/device/{udid}/reboot | Reboot device +*DefaultApi* | [**DevicesRemoveCrashes**](docs/DefaultApi.md#devicesremovecrashes) | **DELETE** /api/v1/device/{udid}/crashes | Delete crash reports +*DefaultApi* | [**DevicesRemoveHttpProxy**](docs/DefaultApi.md#devicesremovehttpproxy) | **DELETE** /api/v1/device/{udid}/httpproxy | Remove HTTP proxy +*DefaultApi* | [**DevicesRemoveProfile**](docs/DefaultApi.md#devicesremoveprofile) | **DELETE** /api/v1/device/{udid}/profiles/{name} | Remove profile +*DefaultApi* | [**DevicesRemoveWifi**](docs/DefaultApi.md#devicesremovewifi) | **DELETE** /api/v1/device/{udid}/wifi | Remove wifi +*DefaultApi* | [**DevicesResetAccessibility**](docs/DefaultApi.md#devicesresetaccessibility) | **POST** /api/v1/device/{udid}/resetaccessibility | Reset accessibility +*DefaultApi* | [**DevicesResetLocation**](docs/DefaultApi.md#devicesresetlocation) | **POST** /api/v1/device/{udid}/resetlocation | Reset simulated location +*DefaultApi* | [**DevicesScreenshot**](docs/DefaultApi.md#devicesscreenshot) | **GET** /api/v1/device/{udid}/screenshot | Capture screenshot +*DefaultApi* | [**DevicesSetAssistiveTouch**](docs/DefaultApi.md#devicessetassistivetouch) | **PUT** /api/v1/device/{udid}/assistivetouch | Set AssistiveTouch +*DefaultApi* | [**DevicesSetDevMode**](docs/DefaultApi.md#devicessetdevmode) | **POST** /api/v1/device/{udid}/devmode | Set developer mode +*DefaultApi* | [**DevicesSetHttpProxy**](docs/DefaultApi.md#devicessethttpproxy) | **PUT** /api/v1/device/{udid}/httpproxy | Set HTTP proxy (supervised) +*DefaultApi* | [**DevicesSetIconLayout**](docs/DefaultApi.md#devicesseticonlayout) | **PUT** /api/v1/device/{udid}/icon-layout | Set icon layout +*DefaultApi* | [**DevicesSetLanguage**](docs/DefaultApi.md#devicessetlanguage) | **PUT** /api/v1/device/{udid}/lang | Set language +*DefaultApi* | [**DevicesSetLocation**](docs/DefaultApi.md#devicessetlocation) | **PUT** /api/v1/device/{udid}/setlocation | Set simulated location +*DefaultApi* | [**DevicesSetPasteboard**](docs/DefaultApi.md#devicessetpasteboard) | **PUT** /api/v1/device/{udid}/pasteboard | Set pasteboard +*DefaultApi* | [**DevicesSetTimeFormat**](docs/DefaultApi.md#devicessettimeformat) | **PUT** /api/v1/device/{udid}/timeformat | Set time format +*DefaultApi* | [**DevicesSetWallpaper**](docs/DefaultApi.md#devicessetwallpaper) | **PUT** /api/v1/device/{udid}/wallpaper | Set wallpaper (supervised) +*DefaultApi* | [**DevicesSetWifi**](docs/DefaultApi.md#devicessetwifi) | **PUT** /api/v1/device/{udid}/wifi | Provision wifi +*DefaultApi* | [**DevicesShutdown**](docs/DefaultApi.md#devicesshutdown) | **POST** /api/v1/device/{udid}/shutdown | Shut down device +*DefaultApi* | [**DevicesStartForward**](docs/DefaultApi.md#devicesstartforward) | **POST** /api/v1/device/{udid}/jobs/forward | Start port forward (job) +*DefaultApi* | [**DevicesStartRunTest**](docs/DefaultApi.md#devicesstartruntest) | **POST** /api/v1/device/{udid}/jobs/runtest | Start test run (job) +*DefaultApi* | [**DevicesStartRunWda**](docs/DefaultApi.md#devicesstartrunwda) | **POST** /api/v1/device/{udid}/jobs/runwda | Start WDA runner (job) +*DefaultApi* | [**DevicesStopJob**](docs/DefaultApi.md#devicesstopjob) | **DELETE** /api/v1/device/{udid}/jobs/{id} | Stop or delete job +*DefaultApi* | [**DevicesStreamJobLogs**](docs/DefaultApi.md#devicesstreamjoblogs) | **GET** /api/v1/device/{udid}/jobs/{id}/logs | Stream job logs (SSE) +*DefaultApi* | [**DevicesStreamListen**](docs/DefaultApi.md#devicesstreamlisten) | **GET** /api/v1/device/{udid}/listen | Stream device attach/detach (SSE) +*DefaultApi* | [**DevicesStreamNotifications**](docs/DefaultApi.md#devicesstreamnotifications) | **GET** /api/v1/device/{udid}/notifications | Stream app-state notifications (SSE) +*DefaultApi* | [**DevicesStreamOsTrace**](docs/DefaultApi.md#devicesstreamostrace) | **GET** /api/v1/device/{udid}/ostrace | Stream os_log trace (SSE) +*DefaultApi* | [**DevicesStreamSyslog**](docs/DefaultApi.md#devicesstreamsyslog) | **GET** /api/v1/device/{udid}/syslog | Stream syslog (SSE) +*DefaultApi* | [**DevicesStreamSysmontap**](docs/DefaultApi.md#devicesstreamsysmontap) | **GET** /api/v1/device/{udid}/sysmontap | Stream CPU usage (SSE) +*DefaultApi* | [**DevicesUninstallApp**](docs/DefaultApi.md#devicesuninstallapp) | **POST** /api/v1/device/{udid}/apps/uninstall | Uninstall app +*DefaultApi* | [**DevicesUnmountImage**](docs/DefaultApi.md#devicesunmountimage) | **DELETE** /api/v1/device/{udid}/image | Unmount developer image +*DefaultApi* | [**DiagnosticsNetGetBatteryRegistry**](docs/DefaultApi.md#diagnosticsnetgetbatteryregistry) | **GET** /api/v1/device/{udid}/battery/registry | Get battery IORegistry +*DefaultApi* | [**DiagnosticsNetGetDeviceIp**](docs/DefaultApi.md#diagnosticsnetgetdeviceip) | **GET** /api/v1/device/{udid}/ip | Get device IP / network info +*DefaultApi* | [**DiagnosticsNetGetDiskSpace**](docs/DefaultApi.md#diagnosticsnetgetdiskspace) | **GET** /api/v1/device/{udid}/diskspace | Get disk space info +*DefaultApi* | [**DiagnosticsNetGetRsdServices**](docs/DefaultApi.md#diagnosticsnetgetrsdservices) | **GET** /api/v1/device/{udid}/rsd | Get RSD service list +*DefaultApi* | [**FsyncFsyncLs**](docs/DefaultApi.md#fsyncfsyncls) | **GET** /api/v1/device/{udid}/fsync/ls | List a directory over AFC +*DefaultApi* | [**FsyncFsyncMkdir**](docs/DefaultApi.md#fsyncfsyncmkdir) | **POST** /api/v1/device/{udid}/fsync/mkdir | Create a directory over AFC +*DefaultApi* | [**FsyncFsyncPull**](docs/DefaultApi.md#fsyncfsyncpull) | **GET** /api/v1/device/{udid}/fsync/pull | Download a file over AFC +*DefaultApi* | [**FsyncFsyncPush**](docs/DefaultApi.md#fsyncfsyncpush) | **POST** /api/v1/device/{udid}/fsync/push | Upload a file over AFC +*DefaultApi* | [**FsyncFsyncRm**](docs/DefaultApi.md#fsyncfsyncrm) | **DELETE** /api/v1/device/{udid}/fsync/rm | Remove a file or directory over AFC +*DefaultApi* | [**FsyncFsyncTree**](docs/DefaultApi.md#fsyncfsynctree) | **GET** /api/v1/device/{udid}/fsync/tree | Recursively list a directory over AFC +*DefaultApi* | [**FsyncGetCloudConfig**](docs/DefaultApi.md#fsyncgetcloudconfig) | **GET** /api/v1/device/{udid}/cloudconfig | Get device cloud configuration +*DefaultApi* | [**GetPrepareSkipOptions**](docs/DefaultApi.md#getprepareskipoptions) | **GET** /api/v1/prepare/skip-options | List setup skip options +*DefaultApi* | [**ListDevices**](docs/DefaultApi.md#listdevices) | **GET** /api/v1/list | List devices +*DefaultApi* | [**ListTunnels**](docs/DefaultApi.md#listtunnels) | **GET** /api/v1/tunnels | List tunnels +*DefaultApi* | [**PrepareCreateCert**](docs/DefaultApi.md#preparecreatecert) | **POST** /api/v1/prepare/create-cert | Generate a supervision certificate +*DefaultApi* | [**PreparePrepareDevice**](docs/DefaultApi.md#preparepreparedevice) | **POST** /api/v1/device/{udid}/prepare | Prepare (and optionally supervise) a device +*DefaultApi* | [**RefreshTunnel**](docs/DefaultApi.md#refreshtunnel) | **POST** /api/v1/tunnels/{udid}/refresh | Refresh tunnel +*DefaultApi* | [**ShutdownTunnelAgent**](docs/DefaultApi.md#shutdowntunnelagent) | **POST** /api/v1/tunnel-agent/shutdown | Shut down tunnel agent +*DefaultApi* | [**SignApp**](docs/DefaultApi.md#signapp) | **POST** /api/v1/sign/app | Resign an app/IPA +*DefaultApi* | [**SignCertificate**](docs/DefaultApi.md#signcertificate) | **POST** /api/v1/sign/certificate | Create a signing certificate +*DefaultApi* | [**SignProvision**](docs/DefaultApi.md#signprovision) | **POST** /api/v1/sign/provision | Create a provisioning profile + P12 +*DefaultApi* | [**StopTunnel**](docs/DefaultApi.md#stoptunnel) | **DELETE** /api/v1/tunnels/{udid} | Stop tunnel +*DefaultApi* | [**StreamsPcap**](docs/DefaultApi.md#streamspcap) | **GET** /api/v1/device/{udid}/pcap | Stream a live pcap capture (binary) +*DefaultApi* | [**StreamsScreenshotStream**](docs/DefaultApi.md#streamsscreenshotstream) | **GET** /api/v1/device/{udid}/screenshot/stream | Stream screenshots as MJPEG (binary) +*DefaultApi* | [**StreamsUiStream**](docs/DefaultApi.md#streamsuistream) | **GET** /api/v1/device/{udid}/ui/stream | Stream UI video (binary) +*DefaultApi* | [**UIUiApi**](docs/DefaultApi.md#uiuiapi) | **POST** /api/v1/device/{udid}/ui/api | Raw backend passthrough +*DefaultApi* | [**UIUiAppForeground**](docs/DefaultApi.md#uiuiappforeground) | **POST** /api/v1/device/{udid}/ui/app/foreground | Foreground app (UI backend) +*DefaultApi* | [**UIUiAppLaunch**](docs/DefaultApi.md#uiuiapplaunch) | **POST** /api/v1/device/{udid}/ui/app/launch | Launch app (UI backend) +*DefaultApi* | [**UIUiAppTerminate**](docs/DefaultApi.md#uiuiappterminate) | **POST** /api/v1/device/{udid}/ui/app/terminate | Terminate app (UI backend) +*DefaultApi* | [**UIUiButton**](docs/DefaultApi.md#uiuibutton) | **POST** /api/v1/device/{udid}/ui/button | Press hardware button +*DefaultApi* | [**UIUiGetOrientation**](docs/DefaultApi.md#uiuigetorientation) | **GET** /api/v1/device/{udid}/ui/orientation | Get orientation +*DefaultApi* | [**UIUiLongPress**](docs/DefaultApi.md#uiuilongpress) | **POST** /api/v1/device/{udid}/ui/longpress | Long press +*DefaultApi* | [**UIUiScreenshot**](docs/DefaultApi.md#uiuiscreenshot) | **GET** /api/v1/device/{udid}/ui/screenshot | UI screenshot (PNG) +*DefaultApi* | [**UIUiSetOrientation**](docs/DefaultApi.md#uiuisetorientation) | **PUT** /api/v1/device/{udid}/ui/orientation | Set orientation +*DefaultApi* | [**UIUiSource**](docs/DefaultApi.md#uiuisource) | **GET** /api/v1/device/{udid}/ui/source | UI source hierarchy +*DefaultApi* | [**UIUiStatus**](docs/DefaultApi.md#uiuistatus) | **GET** /api/v1/device/{udid}/ui/status | UI backend status +*DefaultApi* | [**UIUiSwipe**](docs/DefaultApi.md#uiuiswipe) | **POST** /api/v1/device/{udid}/ui/swipe | Swipe +*DefaultApi* | [**UIUiTap**](docs/DefaultApi.md#uiuitap) | **POST** /api/v1/device/{udid}/ui/tap | Tap +*DefaultApi* | [**UIUiType**](docs/DefaultApi.md#uiuitype) | **POST** /api/v1/device/{udid}/ui/type | Type text +*DefaultApi* | [**UIUiWindowSize**](docs/DefaultApi.md#uiuiwindowsize) | **GET** /api/v1/device/{udid}/ui/size | UI window size +*DefaultApi* | [**WebInspectorWebInspectorEval**](docs/DefaultApi.md#webinspectorwebinspectoreval) | **POST** /api/v1/device/{udid}/webinspector/eval | Evaluate JavaScript in a page +*DefaultApi* | [**WebInspectorWebInspectorLaunch**](docs/DefaultApi.md#webinspectorwebinspectorlaunch) | **POST** /api/v1/device/{udid}/webinspector/launch | Open a URL in a new inspectable page +*DefaultApi* | [**WebInspectorWebInspectorPages**](docs/DefaultApi.md#webinspectorwebinspectorpages) | **GET** /api/v1/device/{udid}/webinspector/pages | List inspectable pages + + + +## Documentation for Models + + - [Model.AXEnabledRequest](docs/AXEnabledRequest.md) + - [Model.AgentShutdown](docs/AgentShutdown.md) + - [Model.AppInfo](docs/AppInfo.md) + - [Model.AppStateNotification](docs/AppStateNotification.md) + - [Model.AssistiveTouchState](docs/AssistiveTouchState.md) + - [Model.AttachDetachEvent](docs/AttachDetachEvent.md) + - [Model.BatteryInfo](docs/BatteryInfo.md) + - [Model.BatteryRegistry](docs/BatteryRegistry.md) + - [Model.CpuUsageSample](docs/CpuUsageSample.md) + - [Model.CrashListing](docs/CrashListing.md) + - [Model.DevModeRequest](docs/DevModeRequest.md) + - [Model.DevModeState](docs/DevModeState.md) + - [Model.DeviceDate](docs/DeviceDate.md) + - [Model.DeviceEntry](docs/DeviceEntry.md) + - [Model.DeviceList](docs/DeviceList.md) + - [Model.DeviceName](docs/DeviceName.md) + - [Model.DeviceProperties](docs/DeviceProperties.md) + - [Model.DevicesGetJob404Response](docs/DevicesGetJob404Response.md) + - [Model.DiskSpaceInfo](docs/DiskSpaceInfo.md) + - [Model.EnabledRequest](docs/EnabledRequest.md) + - [Model.FileDomain](docs/FileDomain.md) + - [Model.FileEntry](docs/FileEntry.md) + - [Model.FileListing](docs/FileListing.md) + - [Model.FilePushResult](docs/FilePushResult.md) + - [Model.ForwardRequest](docs/ForwardRequest.md) + - [Model.FsyncListing](docs/FsyncListing.md) + - [Model.FsyncMessage](docs/FsyncMessage.md) + - [Model.FsyncPushResult](docs/FsyncPushResult.md) + - [Model.FsyncTreeEntry](docs/FsyncTreeEntry.md) + - [Model.FsyncTreeListing](docs/FsyncTreeListing.md) + - [Model.GenericResponse](docs/GenericResponse.md) + - [Model.Job](docs/Job.md) + - [Model.JobLogEvents](docs/JobLogEvents.md) + - [Model.JobLogLine](docs/JobLogLine.md) + - [Model.JobStatus](docs/JobStatus.md) + - [Model.LanguageConfiguration](docs/LanguageConfiguration.md) + - [Model.ListenEvents](docs/ListenEvents.md) + - [Model.MemLimitRequest](docs/MemLimitRequest.md) + - [Model.MemLimitResult](docs/MemLimitResult.md) + - [Model.MountedImages](docs/MountedImages.md) + - [Model.NetworkInfo](docs/NetworkInfo.md) + - [Model.NotificationEvents](docs/NotificationEvents.md) + - [Model.OsTraceEntry](docs/OsTraceEntry.md) + - [Model.OsTraceEvents](docs/OsTraceEvents.md) + - [Model.PasteboardContent](docs/PasteboardContent.md) + - [Model.PrepareResult](docs/PrepareResult.md) + - [Model.PrepareSkipOptions](docs/PrepareSkipOptions.md) + - [Model.ProcessInfo](docs/ProcessInfo.md) + - [Model.Profile](docs/Profile.md) + - [Model.ProfileType](docs/ProfileType.md) + - [Model.ProvisioningResult](docs/ProvisioningResult.md) + - [Model.RsdServiceEntry](docs/RsdServiceEntry.md) + - [Model.RunTestRequest](docs/RunTestRequest.md) + - [Model.SetLanguageRequest](docs/SetLanguageRequest.md) + - [Model.StatusOk](docs/StatusOk.md) + - [Model.SupervisionCert](docs/SupervisionCert.md) + - [Model.SyslogEvents](docs/SyslogEvents.md) + - [Model.SyslogMessage](docs/SyslogMessage.md) + - [Model.SysmontapEvents](docs/SysmontapEvents.md) + - [Model.TimeFormatRequest](docs/TimeFormatRequest.md) + - [Model.TimeFormatState](docs/TimeFormatState.md) + - [Model.Tunnel](docs/Tunnel.md) + - [Model.TunnelStopped](docs/TunnelStopped.md) + - [Model.UIAPIRequest](docs/UIAPIRequest.md) + - [Model.UIAppRequest](docs/UIAppRequest.md) + - [Model.UIButtonRequest](docs/UIButtonRequest.md) + - [Model.UILongPressRequest](docs/UILongPressRequest.md) + - [Model.UIOrientationRequest](docs/UIOrientationRequest.md) + - [Model.UISwipeRequest](docs/UISwipeRequest.md) + - [Model.UITapRequest](docs/UITapRequest.md) + - [Model.UITypeRequest](docs/UITypeRequest.md) + - [Model.UnlockToken](docs/UnlockToken.md) + - [Model.VoiceOverState](docs/VoiceOverState.md) + - [Model.WdaConfig](docs/WdaConfig.md) + - [Model.WdaSession](docs/WdaSession.md) + - [Model.WebInspectorEvalRequest](docs/WebInspectorEvalRequest.md) + - [Model.WebInspectorEvalResult](docs/WebInspectorEvalResult.md) + - [Model.WebInspectorLaunchRequest](docs/WebInspectorLaunchRequest.md) + - [Model.WebInspectorLaunchResult](docs/WebInspectorLaunchResult.md) + - [Model.WifiRequest](docs/WifiRequest.md) + - [Model.ZoomTouchState](docs/ZoomTouchState.md) + + + +## Documentation for Authorization + + +Authentication schemes defined for the API: + +### BearerAuth + +- **Type**: Bearer Authentication + diff --git a/sdks/packages/csharp/src/Generated/api/openapi.yaml b/sdks/packages/csharp/src/Generated/api/openapi.yaml new file mode 100644 index 000000000..ed4066869 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/api/openapi.yaml @@ -0,0 +1,9218 @@ +openapi: 3.1.0 +info: + description: |- + go-ios REST API. + + This is the *ideal* contract for the go-ios REST server. It is authored + spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms + to this document (there is no backward-compatibility constraint yet). + + ## Authentication + + Every route under `/api/v1` requires a bearer token: + `Authorization: Bearer `. The server refuses to start unless + either an API key is configured or it is launched with `--disable-auth`. + + When the server is started with `--disable-auth`, authentication is **not** + enforced and the `Authorization` header may be omitted. The Swagger UI + (`/swagger/*`) is always unauthenticated and lives outside `/api/v1`, so it is + not modeled here. + + ## Device routing + + Device-scoped routes live under `/device/{udid}`. A middleware resolves the + udid: an unknown udid yields `404`, an empty udid yields `422`. The + `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request + per device). + + ## Streaming + + Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, + `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent + Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + license: + name: MIT + url: https://opensource.org/license/mit + title: go-ios REST API + version: 0.1.0 +servers: +- description: Default go-ios REST server + url: http://localhost:60105 +security: +- BearerAuth: [] +paths: + /api/v1/device/{udid}/activate: + post: + description: Activate the device (complete Setup Assistant / activation). + operationId: Devices_activate + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Activate device + /api/v1/device/{udid}/apps/: + get: + description: List installed applications. Each entry is an open Info.plist map. + operationId: Devices_listApps + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + items: + $ref: "#/components/schemas/AppInfo" + type: array + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: List apps + /api/v1/device/{udid}/apps/install: + post: + description: |- + Install an application from an uploaded `.ipa`/`.app` archive. + The multipart `file` part must be 1 byte–200 MB. + operationId: Devices_installApp + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + multipart/form-data: + encoding: + file: + contentType: '*/*' + style: form + schema: + $ref: "#/components/schemas/Devices_installApp_request" + description: Multipart body carrying the app archive to install. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Install app + /api/v1/device/{udid}/apps/kill: + post: + description: Kill a running application by bundle id. + operationId: Devices_killApp + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Bundle id of the app to kill. + explode: false + in: query + name: bundleID + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Kill app + /api/v1/device/{udid}/apps/launch: + post: + description: Launch an application by bundle id. + operationId: Devices_launchApp + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Bundle id of the app to launch. + explode: false + in: query + name: bundleID + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Launch app + /api/v1/device/{udid}/apps/uninstall: + post: + description: Uninstall an application by bundle id. + operationId: Devices_uninstallApp + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Bundle id of the app to uninstall. + explode: false + in: query + name: bundleID + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Uninstall app + /api/v1/device/{udid}/assistivetouch: + get: + description: "Get AssistiveTouch state (CLI: `ios assistivetouch get`)." + operationId: Devices_getAssistiveTouch + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/AssistiveTouchState" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Get AssistiveTouch + put: + description: "Enable/disable AssistiveTouch (CLI: `ios assistivetouch enable|disable`)." + operationId: Devices_setAssistiveTouch + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/EnabledRequest" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/AssistiveTouchState" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Set AssistiveTouch + /api/v1/device/{udid}/ax: + get: + description: |- + Get a snapshot of the currently focused accessibility element + (CLI: `ios ax`). + operationId: Accessibility_getAxSnapshot + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/AXElement" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Get accessibility element snapshot + /api/v1/device/{udid}/ax/audit: + post: + description: |- + Run the accessibility audit against the focused app and return the issues + found (CLI: `ios ax audit`). Bounded by `timeout` (seconds, default 60). + operationId: Accessibility_runAxAudit + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Audit timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + items: + $ref: "#/components/schemas/AXAuditIssue" + type: array + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Run accessibility audit + /api/v1/device/{udid}/battery: + get: + description: "Get battery diagnostics (CLI: `ios batterycheck`)." + operationId: Devices_getBattery + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/BatteryInfo" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Get battery info + /api/v1/device/{udid}/battery/registry: + get: + description: |- + Get the battery IORegistry stats (Temperature, Voltage, CurrentCapacity, + ...) via the diagnostics relay (CLI: `ios diagnostics ioregistry`). + operationId: DiagnosticsNet_getBatteryRegistry + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/BatteryRegistry" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Get battery IORegistry + /api/v1/device/{udid}/cloudconfig: + get: + description: |- + Get the device cloud configuration (supervision status, skip-setup options, + organization info). + operationId: Fsync_getCloudConfig + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/CloudConfig" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Get device cloud configuration + /api/v1/device/{udid}/conditions: + get: + description: List available condition inducer profile types. + operationId: Devices_listConditions + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + items: + $ref: "#/components/schemas/ProfileType" + type: array + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: List conditions + /api/v1/device/{udid}/crashes: + delete: + description: "Delete crash reports (CLI: `ios crash rm`)." + operationId: Devices_removeCrashes + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Working directory on the device. + explode: false + in: query + name: cwd + required: true + schema: + type: string + style: form + - description: Glob pattern of reports to delete. + explode: false + in: query + name: pattern + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Delete crash reports + get: + description: "List crash reports (CLI: `ios crash ls`)." + operationId: Devices_listCrashes + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Optional glob pattern to filter reports. + explode: false + in: query + name: pattern + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/CrashListing" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: List crash reports + /api/v1/device/{udid}/date: + get: + description: "Get the device clock (CLI: `ios date`)." + operationId: Devices_getDeviceDate + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/DeviceDate" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Get device date + /api/v1/device/{udid}/devicename: + get: + description: "Get the device name (CLI: `ios devicename`)." + operationId: Devices_getDeviceName + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/DeviceName" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Get device name + /api/v1/device/{udid}/devmode: + get: + description: "Get developer mode state (CLI: `ios devmode get`)." + operationId: Devices_getDevMode + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/DevModeState" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Get developer mode + post: + description: "Enable or reveal developer mode (CLI: `ios devmode enable|reveal`)." + operationId: Devices_setDevMode + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/DevModeRequest" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Set developer mode + /api/v1/device/{udid}/diagnostics: + get: + description: "List all IORegistry/diagnostic values (CLI: `ios diagnostics list`)." + operationId: Devices_getDiagnostics + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/Diagnostics" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: List diagnostics + /api/v1/device/{udid}/disable-condition: + post: + description: Disable the currently active condition inducer profile. + operationId: Devices_disableCondition + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Disable condition + /api/v1/device/{udid}/diskspace: + get: + description: |- + Get filesystem info for the device (total/free/used bytes, block size) + via AFC (CLI: `ios diskspace`). + operationId: DiagnosticsNet_getDiskSpace + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/DiskSpaceInfo" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Get disk space info + /api/v1/device/{udid}/enable-condition: + put: + description: Enable a condition inducer profile. + operationId: Devices_enableCondition + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Identifier of the condition profile type. + explode: false + in: query + name: profileTypeID + required: true + schema: + type: string + style: form + - description: Identifier of the specific profile to activate. + explode: false + in: query + name: profileID + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Enable condition + /api/v1/device/{udid}/erase: + post: + description: |- + Erase all content and settings (CLI: `ios erase`). Destructive: + requires `confirm=true`. + operationId: Devices_erase + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Must be `true` to proceed with the destructive erase. + explode: false + in: query + name: confirm + required: true + schema: + type: boolean + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Erase device + /api/v1/device/{udid}/files: + get: + description: "List a device directory (CLI: `ios file ls`)." + operationId: Devices_listFiles + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "File service domain: `app`, `app-group`, `crash` or `temp`." + explode: false + in: query + name: domain + required: true + schema: + $ref: "#/components/schemas/FileDomain" + style: form + - description: Bundle/group id for the `app`/`app-group` domains. + explode: false + in: query + name: identifier + required: false + schema: + type: string + style: form + - description: Directory path to list (defaults to `.`). + explode: false + in: query + name: path + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/FileListing" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: List files + /api/v1/device/{udid}/files/pull: + get: + description: |- + Download a file from the device, streamed as the response body + (CLI: `ios file pull`). + operationId: Devices_pullFile + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "File service domain: `app`, `app-group`, `crash` or `temp`." + explode: false + in: query + name: domain + required: true + schema: + $ref: "#/components/schemas/FileDomain" + style: form + - description: Bundle/group id for the `app`/`app-group` domains. + explode: false + in: query + name: identifier + required: false + schema: + type: string + style: form + - description: Remote file path on the device. + explode: false + in: query + name: remote + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/octet-stream: + schema: {} + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Pull file + /api/v1/device/{udid}/files/push: + post: + description: |- + Upload the request body to a device path (CLI: `ios file push`). A + `Content-Length` header is required. + operationId: Devices_pushFile + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "File service domain: `app`, `app-group`, `crash` or `temp`." + explode: false + in: query + name: domain + required: true + schema: + $ref: "#/components/schemas/FileDomain" + style: form + - description: Bundle/group id for the `app`/`app-group` domains. + explode: false + in: query + name: identifier + required: false + schema: + type: string + style: form + - description: Destination path on the device. + explode: false + in: query + name: remote + required: true + schema: + type: string + style: form + requestBody: + content: + application/octet-stream: + schema: {} + description: Raw file bytes to upload. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/FilePushResult" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Push file + /api/v1/device/{udid}/fsync/ls: + get: + description: "List a device directory over AFC (CLI: `ios fsync ls`)." + operationId: Fsync_fsyncLs + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: App bundle id to scope to its container (else the media dir). + explode: false + in: query + name: bundleID + required: false + schema: + type: string + style: form + - description: Device-side path (rejects `..` elements). + explode: false + in: query + name: path + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/FsyncListing" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: List a directory over AFC + /api/v1/device/{udid}/fsync/mkdir: + post: + description: "Create a directory over AFC (CLI: `ios fsync mkdir`)." + operationId: Fsync_fsyncMkdir + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: App bundle id to scope to its container (else the media dir). + explode: false + in: query + name: bundleID + required: false + schema: + type: string + style: form + - description: Directory path to create (required). + explode: false + in: query + name: path + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/FsyncMessage" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Create a directory over AFC + /api/v1/device/{udid}/fsync/pull: + get: + description: |- + Download a file from the device over AFC (CLI: `ios fsync pull`). Returns + the raw file bytes. `path` is required. + operationId: Fsync_fsyncPull + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: App bundle id to scope to its container (else the media dir). + explode: false + in: query + name: bundleID + required: false + schema: + type: string + style: form + - description: Remote file path on the device (required). + explode: false + in: query + name: path + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/octet-stream: + schema: {} + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Download a file over AFC + /api/v1/device/{udid}/fsync/push: + post: + description: |- + Upload a file to the device over AFC (CLI: `ios fsync push`). Accepts either + raw bytes (application/octet-stream) or a multipart form with a `file` + field. `path` is required. Bounded server-side; oversized uploads get `413`. + operationId: Fsync_fsyncPush + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: App bundle id to scope to its container (else the media dir). + explode: false + in: query + name: bundleID + required: false + schema: + type: string + style: form + - description: Destination path on the device (required). + explode: false + in: query + name: path + required: true + schema: + type: string + style: form + requestBody: + content: + application/octet-stream: + schema: {} + description: Raw file bytes to upload (application/octet-stream). + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/FsyncPushResult" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "413": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 413 — the uploaded body exceeded the server's size cap. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Upload a file over AFC + /api/v1/device/{udid}/fsync/rm: + delete: + description: |- + Remove a file or directory over AFC (CLI: `ios fsync rm`). Pass + `recursive=true` to delete a non-empty directory. + operationId: Fsync_fsyncRm + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: App bundle id to scope to its container (else the media dir). + explode: false + in: query + name: bundleID + required: false + schema: + type: string + style: form + - description: Path to remove (required). + explode: false + in: query + name: path + required: true + schema: + type: string + style: form + - description: Remove directory contents recursively. + explode: false + in: query + name: recursive + required: false + schema: + type: boolean + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/FsyncMessage" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Remove a file or directory over AFC + /api/v1/device/{udid}/fsync/tree: + get: + description: "Recursively list a device directory over AFC (CLI: `ios fsync\ + \ tree`)." + operationId: Fsync_fsyncTree + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: App bundle id to scope to its container (else the media dir). + explode: false + in: query + name: bundleID + required: false + schema: + type: string + style: form + - description: Device-side path (rejects `..` elements). + explode: false + in: query + name: path + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/FsyncTreeListing" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Recursively list a directory over AFC + /api/v1/device/{udid}/httpproxy: + delete: + description: "Clear the global HTTP proxy (CLI: `ios httpproxy remove`)." + operationId: Devices_removeHttpProxy + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Remove HTTP proxy + put: + description: |- + Configure a global HTTP proxy (CLI: `ios httpproxy`). Supervised: send + multipart form-data with `host`, `port`, a `p12` supervisor identity and + optional `user`/`pass`/`password` fields. + operationId: Devices_setHttpProxy + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + multipart/form-data: + encoding: + p12: + contentType: '*/*' + style: form + schema: + $ref: "#/components/schemas/Devices_setHttpProxy_request" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Set HTTP proxy (supervised) + /api/v1/device/{udid}/icon-layout: + get: + description: "Get the SpringBoard icon layout (CLI: `ios get-icon-layout`)." + operationId: Devices_getIconLayout + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/IconLayout" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Get icon layout + put: + description: |- + Restore a SpringBoard icon layout (CLI: `ios set-icon-layout`). Body is the + layout JSON as returned by GET. + operationId: Devices_setIconLayout + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/IconLayout" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Set icon layout + /api/v1/device/{udid}/image: + delete: + description: "Unmount the developer disk image (CLI: `ios image unmount`)." + operationId: Devices_unmountImage + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Unmount developer image + get: + description: List the hex signatures of Developer Disk Images mounted on the + device. + operationId: Devices_listImages + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + items: + type: string + type: array + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: List mounted developer images + put: + description: |- + Mount a Developer Disk Image. + + Either let the server auto-resolve and download the correct image + (`auto=true`, optionally with `basedir`), or stream the image bytes as the + raw request body (up to 2 GiB). + operationId: Devices_mountImage + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Auto-resolve and download the matching DDI for the device. + explode: false + in: query + name: auto + required: false + schema: + type: boolean + style: form + - description: Base directory the server uses to cache/lookup DDIs when `auto=true`. + explode: false + in: query + name: basedir + required: false + schema: + type: string + style: form + requestBody: + content: + application/octet-stream: + schema: {} + description: |- + Raw Developer Disk Image bytes (used when not auto-resolving). + Content up to 2 GiB. + required: false + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Mount a developer image + /api/v1/device/{udid}/image/list: + get: + description: "List mounted developer image signatures (CLI: `ios image list`)." + operationId: Devices_listMountedImages + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/MountedImages" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: List mounted images + /api/v1/device/{udid}/info: + get: + description: |- + Get lockdown values plus `instruments:*` keys for the device. + Returns an open dictionary of heterogeneous values. + operationId: Devices_getInfo + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/DeviceInfo" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Get device info + /api/v1/device/{udid}/ip: + get: + description: |- + Resolve the device's network addresses (MAC/IPv4/IPv6) by sniffing pcapd + (CLI: `ios ip`). + operationId: DiagnosticsNet_getDeviceIp + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/NetworkInfo" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Get device IP / network info + /api/v1/device/{udid}/jobs: + get: + description: List jobs for a device. + operationId: Devices_listJobs + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + items: + $ref: "#/components/schemas/Job" + type: array + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: List jobs + /api/v1/device/{udid}/jobs/forward: + post: + description: "Start a TCP port forward host→device as an async job (CLI: `ios\ + \ forward`)." + operationId: Devices_startForward + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/ForwardRequest" + required: true + responses: + "202": + content: + application/json: + schema: + $ref: "#/components/schemas/Job" + description: "The request has been accepted for processing, but processing\ + \ has not yet completed." + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Start port forward (job) + /api/v1/device/{udid}/jobs/runtest: + post: + description: |- + Start an XCUITest/unit-test run as an async job (CLI: `ios runtest`). + Returns `202` with the created job. + operationId: Devices_startRunTest + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/RunTestRequest" + required: true + responses: + "202": + content: + application/json: + schema: + $ref: "#/components/schemas/Job" + description: "The request has been accepted for processing, but processing\ + \ has not yet completed." + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Start test run (job) + /api/v1/device/{udid}/jobs/runwda: + post: + description: |- + Start the WebDriverAgent runner as an async job (CLI: `ios runwda`). Body + fields are optional and default to the standard WDA bundle id and config. + operationId: Devices_startRunWda + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/RunTestRequest" + required: false + responses: + "202": + content: + application/json: + schema: + $ref: "#/components/schemas/Job" + description: "The request has been accepted for processing, but processing\ + \ has not yet completed." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Start WDA runner (job) + /api/v1/device/{udid}/jobs/{id}: + delete: + description: |- + Stop a running job, or purge an already-terminal one from the registry + (CLI: Ctrl-C on the equivalent command). + operationId: Devices_stopJob + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: The job id. + explode: false + in: path + name: id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/Devices_getJob_404_response" + description: 404 — the requested resource (e.g. a job) was not found for + this device. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Stop or delete job + get: + description: Get a job's status. Returns `404` for an unknown job on this device. + operationId: Devices_getJob + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: The job id. + explode: false + in: path + name: id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/Job" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/Devices_getJob_404_response" + description: 404 — the requested resource (e.g. a job) was not found for + this device. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Get job + /api/v1/device/{udid}/jobs/{id}/logs: + get: + description: |- + Stream a job's log output as Server-Sent Events: the buffered history first, + then live lines until the job ends or the client disconnects. + operationId: Devices_streamJobLogs + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: The job id. + explode: false + in: path + name: id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + text/event-stream: + schema: + type: string + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/Devices_getJob_404_response" + description: 404 — the requested resource (e.g. a job) was not found for + this device. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Stream job logs (SSE) + x-sse-events: + schema: JobLogEvents + events: + log: JobLogLine + heartbeat: Heartbeat + /api/v1/device/{udid}/lang: + get: + description: "Get the device language/locale configuration (CLI: `ios lang`)." + operationId: Devices_getLanguage + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/LanguageConfiguration" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Get language + put: + description: |- + Set the device language and/or locale (CLI: `ios lang --setlang --setlocale`). + Returns the resulting configuration. + operationId: Devices_setLanguage + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/SetLanguageRequest" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/LanguageConfiguration" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Set language + /api/v1/device/{udid}/listen: + get: + description: Stream device attach/detach events as Server-Sent Events. + operationId: Devices_streamListen + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + text/event-stream: + schema: + type: string + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Stream device attach/detach (SSE) + x-sse-events: + schema: ListenEvents + events: + attachdetach: AttachDetachEvent + heartbeat: Heartbeat + /api/v1/device/{udid}/lockdown: + get: + description: |- + Get lockdown values (CLI: `ios lockdown get`). Without `domain` the full set + is returned; with `domain` the values are scoped to that lockdown domain. + operationId: Devices_getLockdownValues + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Optional lockdown domain to scope the returned values. + explode: false + in: query + name: domain + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/LockdownValues" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Get lockdown values + /api/v1/device/{udid}/mdm/clear-passcode: + post: + description: |- + Clear the device passcode (CLI: `ios mdm clear-passcode`). Requires the + base64 unlock token as an additional `token` form field. + operationId: Devices_mdmClearPasscode + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + multipart/form-data: + encoding: + p12: + contentType: '*/*' + style: form + schema: + $ref: "#/components/schemas/Devices_mdmClearPasscode_request" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOk" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Clear passcode (supervised) + /api/v1/device/{udid}/mdm/clear-screen-time-password: + post: + description: "Clear the Screen Time password (CLI: `ios mdm clear-screen-time-password`)." + operationId: Devices_mdmClearScreenTimePassword + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + multipart/form-data: + encoding: + p12: + contentType: '*/*' + style: form + schema: + $ref: "#/components/schemas/Devices_mdmClearScreenTimePassword_request" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/StatusOk" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Clear Screen Time password (supervised) + /api/v1/device/{udid}/mdm/fetch-unlock-token: + post: + description: |- + Fetch the escrow unlock token, base64-encoded (CLI: + `ios mdm fetch-unlock-token`). + operationId: Devices_mdmFetchUnlockToken + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + multipart/form-data: + encoding: + p12: + contentType: '*/*' + style: form + schema: + $ref: "#/components/schemas/Devices_mdmClearScreenTimePassword_request" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/UnlockToken" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Fetch unlock token (supervised) + /api/v1/device/{udid}/mdm/security-info: + post: + description: "Get device security info (CLI: `ios mdm security-info`)." + operationId: Devices_mdmSecurityInfo + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + multipart/form-data: + encoding: + p12: + contentType: '*/*' + style: form + schema: + $ref: "#/components/schemas/Devices_mdmClearScreenTimePassword_request" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/SecurityInfo" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Get MDM security info (supervised) + /api/v1/device/{udid}/memlimitoff: + post: + description: |- + Waive the memory limit for a process (CLI: `ios memlimitoff`). The process + name may be given via the `process` query param or the JSON body. + operationId: Devices_memLimitOff + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Process name whose memory limit should be waived. + explode: false + in: query + name: process + required: false + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/MemLimitRequest" + required: false + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/MemLimitResult" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Waive memory limit + /api/v1/device/{udid}/mobilegestalt: + get: + description: |- + Query one or more MobileGestalt keys (CLI: `ios mobilegestalt ...`). + Pass repeated `key` query params. + operationId: Devices_getMobileGestalt + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: One or more MobileGestalt keys to query. + explode: false + in: query + name: key + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/MobileGestalt" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Query MobileGestalt + /api/v1/device/{udid}/notifications: + get: + description: Stream application state-change notifications as Server-Sent Events. + operationId: Devices_streamNotifications + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + text/event-stream: + schema: + type: string + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Stream app-state notifications (SSE) + x-sse-events: + schema: NotificationEvents + events: + appstate: AppStateNotification + heartbeat: Heartbeat + /api/v1/device/{udid}/ostrace: + get: + description: |- + Stream structured os_log trace entries as Server-Sent Events. + All filters are optional and combine with AND semantics. + operationId: Devices_streamOsTrace + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Only include entries from this process id. + explode: false + in: query + name: pid + required: false + schema: + format: int32 + type: integer + style: form + - description: "Minimum log level to include (e.g. `info`, `debug`, `error`)." + explode: false + in: query + name: level + required: false + schema: + type: string + style: form + - description: Only include entries from this subsystem. + explode: false + in: query + name: subsystem + required: false + schema: + type: string + style: form + - description: Only include entries whose message matches this substring/pattern. + explode: false + in: query + name: match + required: false + schema: + type: string + style: form + - description: Exclude entries whose message matches this substring/pattern. + explode: false + in: query + name: exclude + required: false + schema: + type: string + style: form + responses: + "200": + content: + text/event-stream: + schema: + type: string + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Stream os_log trace (SSE) + x-sse-events: + schema: OsTraceEvents + events: + ostrace: OsTraceEntry + heartbeat: Heartbeat + /api/v1/device/{udid}/pair: + post: + description: |- + Pair with the device. + + For a supervised pairing (`supervised=true`) upload the supervision + identity as `p12file` (multipart) and supply the passphrase in the + `Supervision-Password` header. + + Returns `423` when the device is locked and pairing cannot proceed. + operationId: Devices_pair + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Whether this is a supervised pairing. + explode: false + in: query + name: supervised + required: true + schema: + type: boolean + style: form + - description: Supervision identity passphrase (required when supervised). + explode: false + in: header + name: Supervision-Password + required: false + schema: + type: string + style: simple + requestBody: + content: + multipart/form-data: + encoding: + p12file: + contentType: '*/*' + style: form + schema: + $ref: "#/components/schemas/Devices_pair_request" + description: |- + Multipart body carrying the supervision identity (`.p12`) when + `supervised=true`. Omit for unsupervised pairing. + required: false + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "423": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 423 — device is locked; pairing cannot proceed. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Pair device + /api/v1/device/{udid}/pasteboard: + get: + description: "Get the pasteboard (clipboard) text (CLI: `ios pasteboard get`)." + operationId: Devices_getPasteboard + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/PasteboardContent" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Get pasteboard + put: + description: "Set the pasteboard text from the raw request body (CLI: `ios pasteboard\ + \ set`)." + operationId: Devices_setPasteboard + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + text/plain: + schema: + type: string + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Set pasteboard + /api/v1/device/{udid}/pcap: + get: + description: |- + Stream a live packet capture from the device as a libpcap byte stream + (pipeable into wireshark/tshark). Runs until `timeout` (seconds) elapses, + the default timeout is reached, or the client disconnects. + operationId: Streams_pcap + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Capture duration in seconds (default 60, max 3600)." + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + responses: + "200": + content: + application/vnd.tcpdump.pcap: + schema: {} + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Stream a live pcap capture (binary) + /api/v1/device/{udid}/prepare: + post: + description: |- + Run the device preparation/provisioning flow (CLI: `ios prepare`). Send + multipart/form-data. To supervise the device include a `cert` file + (DER/PEM/P12 supervision identity) and optional `p12password`; without a + cert the device is prepared without supervision. + operationId: Prepare_prepareDevice + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + multipart/form-data: + encoding: + cert: + contentType: '*/*' + style: form + skip: + contentType: text/plain + style: form + schema: + $ref: "#/components/schemas/Prepare_prepareDevice_request" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/PrepareResult" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Prepare (and optionally supervise) a device + /api/v1/device/{udid}/processes: + get: + description: "List running processes (CLI: `ios ps [--apps]`)." + operationId: Devices_getProcesses + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Only return application processes. + explode: false + in: query + name: apps + required: false + schema: + type: boolean + style: form + responses: + "200": + content: + application/json: + schema: + items: + $ref: "#/components/schemas/ProcessInfo" + type: array + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: List processes + /api/v1/device/{udid}/profiles: + get: + description: List installed configuration profiles. Returns an open dictionary. + operationId: Devices_getProfiles + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/InstalledProfiles" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: List configuration profiles + post: + description: |- + Install a configuration profile (CLI: `ios profile add`). Send the profile as + the raw request body, or as multipart with a `profile` file plus an optional + `p12` supervisor identity and `password` for a supervised install. + operationId: Devices_addProfile + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + multipart/form-data: + encoding: + profile: + contentType: '*/*' + style: form + p12: + contentType: '*/*' + style: form + schema: + $ref: "#/components/schemas/Devices_addProfile_request" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Install profile + /api/v1/device/{udid}/profiles/{name}: + delete: + description: "Remove a configuration profile by identifier (CLI: `ios profile\ + \ remove`)." + operationId: Devices_removeProfile + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: The profile identifier to remove. + explode: false + in: path + name: name + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Remove profile + /api/v1/device/{udid}/reboot: + post: + description: "Reboot the device (CLI: `ios reboot`)." + operationId: Devices_reboot + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Reboot device + /api/v1/device/{udid}/resetaccessibility: + post: + description: Reset accessibility settings on the device. + operationId: Devices_resetAccessibility + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Reset accessibility + /api/v1/device/{udid}/resetlocation: + post: + description: Reset the simulated location back to the device's real GPS location. + operationId: Devices_resetLocation + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Reset simulated location + /api/v1/device/{udid}/rsd: + get: + description: |- + Get the device's RSD (Remote Service Discovery) service list + (CLI: `ios rsd ls`). Requires a running tunnel (iOS 17+); devices without + RSD return `400`. + operationId: DiagnosticsNet_getRsdServices + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RsdServices" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Get RSD service list + /api/v1/device/{udid}/screenshot: + get: + description: Capture a screenshot. Returns raw PNG bytes (`image/png`). + operationId: Devices_screenshot + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + image/png: + schema: {} + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Capture screenshot + /api/v1/device/{udid}/screenshot/stream: + get: + description: |- + Serve an MJPEG (multipart/x-mixed-replace) stream of device screenshots + captured via the instruments screenshot service. Streams until the client + disconnects or the source fails. + operationId: Streams_screenshotStream + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Optional JPEG quality (1–100, default 80)." + explode: false + in: query + name: quality + required: false + schema: + format: int32 + type: integer + style: form + responses: + "200": + content: + image/jpeg: + schema: {} + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Stream screenshots as MJPEG (binary) + /api/v1/device/{udid}/setlocation: + put: + description: |- + Simulate a GPS location on the device. + + NOTE: the longitude parameter was historically misspelled `longtitude` on + the wire. This spec fixes it to `longitude`; the go-ios server accepts + `longitude` (and may keep `longtitude` as a deprecated alias). + operationId: Devices_setLocation + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Latitude in decimal degrees. + explode: false + in: query + name: latitude + required: true + schema: + type: string + style: form + - description: Longitude in decimal degrees. + explode: false + in: query + name: longitude + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Set simulated location + /api/v1/device/{udid}/setlocation/gpx: + put: + description: |- + Simulate live location tracking from an uploaded GPX file + (CLI: `ios setlocationgpx`). Send multipart/form-data with a `gpx` file. + operationId: Accessibility_setLocationGpx + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + multipart/form-data: + encoding: + gpx: + contentType: '*/*' + style: form + schema: + $ref: "#/components/schemas/Accessibility_setLocationGpx_request" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Simulate location from a GPX file + /api/v1/device/{udid}/shutdown: + post: + description: "Shut down the device (CLI: `ios shutdown`)." + operationId: Devices_shutdown + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Shut down device + /api/v1/device/{udid}/syslog: + get: + description: Stream device syslog lines as Server-Sent Events. + operationId: Devices_streamSyslog + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + text/event-stream: + schema: + type: string + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Stream syslog (SSE) + x-sse-events: + schema: SyslogEvents + events: + syslog: SyslogMessage + heartbeat: Heartbeat + /api/v1/device/{udid}/sysmontap: + get: + description: "Stream CPU-usage samples as Server-Sent Events (CLI: `ios sysmontap`)." + operationId: Devices_streamSysmontap + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + text/event-stream: + schema: + type: string + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Stream CPU usage (SSE) + x-sse-events: + schema: SysmontapEvents + events: + sample: CpuUsageSample + heartbeat: Heartbeat + /api/v1/device/{udid}/timeformat: + get: + description: "Get the 24-hour clock state (CLI: `ios timeformat get`)." + operationId: Devices_getTimeFormat + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/TimeFormatState" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Get time format + put: + description: "Set 24-hour / 12-hour clock (CLI: `ios timeformat 24h|12h`)." + operationId: Devices_setTimeFormat + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/TimeFormatRequest" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/TimeFormatState" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Set time format + /api/v1/device/{udid}/ui/api: + post: + description: |- + Raw passthrough to the backend. For WDA supply `method`/`path`/`body`; for + DeviceKit supply `rpcMethod`/`rpcParams`. The backend response is forwarded + verbatim. + operationId: UI_uiApi + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Backend to target: `wda` (default) or `devicekit`." + explode: false + in: query + name: backend + required: false + schema: + type: string + style: form + - description: Forwarded backend base URL (defaults per backend). + explode: false + in: query + name: wdaUrl + required: false + schema: + type: string + style: form + - description: Per-request HTTP timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/UIAPIRequest" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/UIResponse" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + "501": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 501 — the selected UI-automation backend does not support this + operation. + "502": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Raw backend passthrough + /api/v1/device/{udid}/ui/app/foreground: + post: + description: |- + Bring the backgrounded app to the foreground. Only the devicekit backend + supports this; WDA returns `501`. The request body is ignored. + operationId: UI_uiAppForeground + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Backend to target: `wda` (default) or `devicekit`." + explode: false + in: query + name: backend + required: false + schema: + type: string + style: form + - description: Forwarded backend base URL (defaults per backend). + explode: false + in: query + name: wdaUrl + required: false + schema: + type: string + style: form + - description: Per-request HTTP timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/UIResponse" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + "501": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 501 — the selected UI-automation backend does not support this + operation. + "502": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Foreground app (UI backend) + /api/v1/device/{udid}/ui/app/launch: + post: + description: Launch the app identified by `bundleId`. + operationId: UI_uiAppLaunch + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Backend to target: `wda` (default) or `devicekit`." + explode: false + in: query + name: backend + required: false + schema: + type: string + style: form + - description: Forwarded backend base URL (defaults per backend). + explode: false + in: query + name: wdaUrl + required: false + schema: + type: string + style: form + - description: Per-request HTTP timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/UIAppRequest" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/UIResponse" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + "501": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 501 — the selected UI-automation backend does not support this + operation. + "502": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Launch app (UI backend) + /api/v1/device/{udid}/ui/app/terminate: + post: + description: Terminate the app identified by `bundleId`. + operationId: UI_uiAppTerminate + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Backend to target: `wda` (default) or `devicekit`." + explode: false + in: query + name: backend + required: false + schema: + type: string + style: form + - description: Forwarded backend base URL (defaults per backend). + explode: false + in: query + name: wdaUrl + required: false + schema: + type: string + style: form + - description: Per-request HTTP timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/UIAppRequest" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/UIResponse" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + "501": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 501 — the selected UI-automation backend does not support this + operation. + "502": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Terminate app (UI backend) + /api/v1/device/{udid}/ui/button: + post: + description: Press a hardware button by name (WDA supports only `home`). + operationId: UI_uiButton + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Backend to target: `wda` (default) or `devicekit`." + explode: false + in: query + name: backend + required: false + schema: + type: string + style: form + - description: Forwarded backend base URL (defaults per backend). + explode: false + in: query + name: wdaUrl + required: false + schema: + type: string + style: form + - description: Per-request HTTP timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/UIButtonRequest" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/UIResponse" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + "501": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 501 — the selected UI-automation backend does not support this + operation. + "502": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Press hardware button + /api/v1/device/{udid}/ui/longpress: + post: + description: "Press and hold at (x,y)." + operationId: UI_uiLongPress + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Backend to target: `wda` (default) or `devicekit`." + explode: false + in: query + name: backend + required: false + schema: + type: string + style: form + - description: Forwarded backend base URL (defaults per backend). + explode: false + in: query + name: wdaUrl + required: false + schema: + type: string + style: form + - description: Per-request HTTP timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/UILongPressRequest" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/UIResponse" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + "501": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 501 — the selected UI-automation backend does not support this + operation. + "502": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Long press + /api/v1/device/{udid}/ui/orientation: + get: + description: Get the current device orientation payload. + operationId: UI_uiGetOrientation + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Backend to target: `wda` (default) or `devicekit`." + explode: false + in: query + name: backend + required: false + schema: + type: string + style: form + - description: Forwarded backend base URL (defaults per backend). + explode: false + in: query + name: wdaUrl + required: false + schema: + type: string + style: form + - description: Per-request HTTP timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/UIResponse" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + "501": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 501 — the selected UI-automation backend does not support this + operation. + "502": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Get orientation + put: + description: Set the device orientation. + operationId: UI_uiSetOrientation + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Backend to target: `wda` (default) or `devicekit`." + explode: false + in: query + name: backend + required: false + schema: + type: string + style: form + - description: Forwarded backend base URL (defaults per backend). + explode: false + in: query + name: wdaUrl + required: false + schema: + type: string + style: form + - description: Per-request HTTP timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/UIOrientationRequest" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/UIResponse" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + "501": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 501 — the selected UI-automation backend does not support this + operation. + "502": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Set orientation + /api/v1/device/{udid}/ui/screenshot: + get: + description: Capture the screen and return raw PNG bytes. + operationId: UI_uiScreenshot + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Backend to target: `wda` (default) or `devicekit`." + explode: false + in: query + name: backend + required: false + schema: + type: string + style: form + - description: Forwarded backend base URL (defaults per backend). + explode: false + in: query + name: wdaUrl + required: false + schema: + type: string + style: form + - description: Per-request HTTP timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + responses: + "200": + content: + image/png: + schema: {} + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + "501": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 501 — the selected UI-automation backend does not support this + operation. + "502": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: UI screenshot (PNG) + /api/v1/device/{udid}/ui/size: + get: + description: "Return the device window/screen size payload (typically {width,height})." + operationId: UI_uiWindowSize + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Backend to target: `wda` (default) or `devicekit`." + explode: false + in: query + name: backend + required: false + schema: + type: string + style: form + - description: Forwarded backend base URL (defaults per backend). + explode: false + in: query + name: wdaUrl + required: false + schema: + type: string + style: form + - description: Per-request HTTP timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/UIResponse" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + "501": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 501 — the selected UI-automation backend does not support this + operation. + "502": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: UI window size + /api/v1/device/{udid}/ui/source: + get: + description: Return the current view hierarchy (XML for WDA; backend Content-Type + preserved). + operationId: UI_uiSource + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Backend to target: `wda` (default) or `devicekit`." + explode: false + in: query + name: backend + required: false + schema: + type: string + style: form + - description: Forwarded backend base URL (defaults per backend). + explode: false + in: query + name: wdaUrl + required: false + schema: + type: string + style: form + - description: Per-request HTTP timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + responses: + "200": + content: + application/xml: + schema: {} + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + "501": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 501 — the selected UI-automation backend does not support this + operation. + "502": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: UI source hierarchy + /api/v1/device/{udid}/ui/status: + get: + description: Return the backend status/health payload (WDA /status or DeviceKit + /health). + operationId: UI_uiStatus + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Backend to target: `wda` (default) or `devicekit`." + explode: false + in: query + name: backend + required: false + schema: + type: string + style: form + - description: Forwarded backend base URL (defaults per backend). + explode: false + in: query + name: wdaUrl + required: false + schema: + type: string + style: form + - description: Per-request HTTP timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/UIResponse" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + "501": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 501 — the selected UI-automation backend does not support this + operation. + "502": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: UI backend status + /api/v1/device/{udid}/ui/stream: + get: + description: |- + Open a live UI video stream against a forwarded WDA/DeviceKit backend and + pipe it straight through to the client. Default codec is MJPEG + (multipart/x-mixed-replace); `codec=h264` returns an H.264 elementary + stream (requires the devicekit backend). Streams until the client + disconnects or the backend ends. + + Requires a running, forwarded WDA/DeviceKit backend (see the UI routes). + operationId: Streams_uiStream + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Backend to target: `wda` (default) or `devicekit`." + explode: false + in: query + name: backend + required: false + schema: + type: string + style: form + - description: Forwarded backend base URL (defaults per backend). + explode: false + in: query + name: wdaUrl + required: false + schema: + type: string + style: form + - description: Per-request HTTP timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + - description: "Video codec: `mjpeg` (default) or `h264` (devicekit backend\ + \ only)." + explode: false + in: query + name: codec + required: false + schema: + type: string + style: form + - description: Target frames per second (backend-dependent). + explode: false + in: query + name: fps + required: false + schema: + type: string + style: form + - description: JPEG quality for the mjpeg codec. + explode: false + in: query + name: quality + required: false + schema: + type: string + style: form + - description: Scale factor (backend-dependent). + explode: false + in: query + name: scale + required: false + schema: + type: string + style: form + - description: Target bitrate for the h264 codec. + explode: false + in: query + name: bitrate + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/octet-stream: + schema: {} + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + "501": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 501 — the selected UI-automation backend does not support this + operation. + "502": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Stream UI video (binary) + /api/v1/device/{udid}/ui/swipe: + post: + description: "Drag from (x1,y1) to (x2,y2)." + operationId: UI_uiSwipe + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Backend to target: `wda` (default) or `devicekit`." + explode: false + in: query + name: backend + required: false + schema: + type: string + style: form + - description: Forwarded backend base URL (defaults per backend). + explode: false + in: query + name: wdaUrl + required: false + schema: + type: string + style: form + - description: Per-request HTTP timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/UISwipeRequest" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/UIResponse" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + "501": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 501 — the selected UI-automation backend does not support this + operation. + "502": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Swipe + /api/v1/device/{udid}/ui/tap: + post: + description: Tap at absolute coordinates. + operationId: UI_uiTap + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Backend to target: `wda` (default) or `devicekit`." + explode: false + in: query + name: backend + required: false + schema: + type: string + style: form + - description: Forwarded backend base URL (defaults per backend). + explode: false + in: query + name: wdaUrl + required: false + schema: + type: string + style: form + - description: Per-request HTTP timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/UITapRequest" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/UIResponse" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + "501": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 501 — the selected UI-automation backend does not support this + operation. + "502": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Tap + /api/v1/device/{udid}/ui/type: + post: + description: Send text as keyboard input. + operationId: UI_uiType + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Backend to target: `wda` (default) or `devicekit`." + explode: false + in: query + name: backend + required: false + schema: + type: string + style: form + - description: Forwarded backend base URL (defaults per backend). + explode: false + in: query + name: wdaUrl + required: false + schema: + type: string + style: form + - description: Per-request HTTP timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/UITypeRequest" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/UIResponse" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + "501": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 501 — the selected UI-automation backend does not support this + operation. + "502": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Type text + /api/v1/device/{udid}/voiceover: + get: + description: "Get VoiceOver enabled state (CLI: `ios voiceover get`)." + operationId: Accessibility_getVoiceOver + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/VoiceOverState" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Get VoiceOver state + put: + description: |- + Enable/disable VoiceOver (CLI: `ios voiceover enable|disable`). The desired + state comes from the JSON body or the `enabled` query param. + operationId: Accessibility_setVoiceOver + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Desired state (alternative to the request body). + explode: false + in: query + name: enabled + required: false + schema: + type: boolean + style: form + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/AXEnabledRequest" + required: false + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/VoiceOverState" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Set VoiceOver state + /api/v1/device/{udid}/wallpaper: + get: + description: "Get the home-screen wallpaper as PNG (CLI: `ios get-wallpaper`)." + operationId: Devices_getWallpaper + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + image/png: + schema: {} + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Get wallpaper + put: + description: |- + Set the wallpaper (CLI: `ios set-wallpaper`). Supervised: upload the image + and a `.p12` supervisor identity as multipart form-data. + operationId: Devices_setWallpaper + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + multipart/form-data: + encoding: + image: + contentType: '*/*' + style: form + p12: + contentType: '*/*' + style: form + schema: + $ref: "#/components/schemas/Devices_setWallpaper_request" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Set wallpaper (supervised) + /api/v1/device/{udid}/wda/session: + post: + description: Start a WebDriverAgent (XCUITest) session. + operationId: Devices_createWdaSession + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/WdaConfig" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/WdaSession" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Start WDA session + /api/v1/device/{udid}/wda/session/{sessionId}: + delete: + description: Stop a running WebDriverAgent session. + operationId: Devices_deleteWdaSession + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: The WDA session id. + explode: false + in: path + name: sessionId + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/WdaSession" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/Devices_getJob_404_response" + description: 404 — WDA session id not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Stop WDA session + get: + description: Get a running WebDriverAgent session. Returns `404` for an unknown + session. + operationId: Devices_getWdaSession + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: The WDA session id. + explode: false + in: path + name: sessionId + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/WdaSession" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/Devices_getJob_404_response" + description: 404 — WDA session id not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Get WDA session + /api/v1/device/{udid}/webinspector/eval: + post: + description: |- + Evaluate JavaScript in an inspectable page and return the result + (CLI: `ios webinspector eval`). `404` when no matching page exists. + operationId: WebInspector_webInspectorEval + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/WebInspectorEvalRequest" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/WebInspectorEvalResult" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/Devices_getJob_404_response" + description: 404 — the requested resource (e.g. a job) was not found for + this device. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "424": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: |- + 424 — a device-side prerequisite is missing. Used by the WebInspector routes + when Web Inspector / Remote Automation is not enabled on the device. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Evaluate JavaScript in a page + /api/v1/device/{udid}/webinspector/launch: + post: + description: |- + Open a URL in a new inspectable page via a remote automation session + (CLI: `ios webinspector launch `). `url` may be a query param or in + the body; `bundleId` defaults to Safari. + operationId: WebInspector_webInspectorLaunch + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: URL to open (alternative to the request body). + explode: false + in: query + name: url + required: false + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/WebInspectorLaunchRequest" + required: false + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/WebInspectorLaunchResult" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "424": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: |- + 424 — a device-side prerequisite is missing. Used by the WebInspector routes + when Web Inspector / Remote Automation is not enabled on the device. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Open a URL in a new inspectable page + /api/v1/device/{udid}/webinspector/pages: + get: + description: "List inspectable pages reported by the device (CLI: `ios webinspector\ + \ list`)." + operationId: WebInspector_webInspectorPages + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + items: + $ref: "#/components/schemas/WebInspectorPage" + type: array + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "424": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: |- + 424 — a device-side prerequisite is missing. Used by the WebInspector routes + when Web Inspector / Remote Automation is not enabled on the device. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: List inspectable pages + /api/v1/device/{udid}/wifi: + delete: + description: "Remove a provisioned wifi network (CLI: `ios wifi --remove`)." + operationId: Devices_removeWifi + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: SSID of the network to remove. + explode: false + in: query + name: ssid + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Remove wifi + put: + description: "Provision a wifi network (CLI: `ios wifi`)." + operationId: Devices_setWifi + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/WifiRequest" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Provision wifi + /api/v1/device/{udid}/zoom: + get: + description: "Get ZoomTouch enabled state (CLI: `ios zoomtouch get`)." + operationId: Accessibility_getZoomTouch + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ZoomTouchState" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Get ZoomTouch state + put: + description: |- + Enable/disable ZoomTouch (CLI: `ios zoomtouch enable|disable`). The desired + state comes from the JSON body or the `enabled` query param. + operationId: Accessibility_setZoomTouch + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Desired state (alternative to the request body). + explode: false + in: query + name: enabled + required: false + schema: + type: boolean + style: form + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/AXEnabledRequest" + required: false + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ZoomTouchState" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Set ZoomTouch state + /api/v1/list: + get: + description: List all attached / reachable devices. + operationId: listDevices + parameters: [] + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/DeviceList" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: List devices + /api/v1/prepare/create-cert: + post: + description: |- + Generate a self-signed supervision identity (CLI: `ios prepare create-cert`) + and return the DER (base64) and PEM for both the certificate and private key. + Host-scoped (device-free). + operationId: prepareCreateCert + parameters: [] + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/SupervisionCert" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Generate a supervision certificate + /api/v1/prepare/skip-options: + get: + description: |- + List all setup-pane skip options usable when preparing a device + (CLI: `ios prepare printskip`). Static, device-free list. + operationId: getPrepareSkipOptions + parameters: [] + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/PrepareSkipOptions" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: List setup skip options + /api/v1/sign/app: + post: + description: |- + Resign an uploaded app/IPA with an uploaded P12 identity and provisioning + profile, returning the signed IPA. Synchronous. Host-scoped. + operationId: signApp + parameters: [] + requestBody: + content: + multipart/form-data: + encoding: + ipa: + contentType: '*/*' + style: form + p12file: + contentType: '*/*' + style: form + profile: + contentType: '*/*' + style: form + schema: + $ref: "#/components/schemas/signApp_request" + required: true + responses: + "200": + content: + application/octet-stream: + schema: {} + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + summary: Resign an app/IPA + /api/v1/sign/certificate: + post: + description: |- + Create one App Store Connect signing certificate and return its P12 + (certificate + private key) as a downloadable `application/x-pkcs12` file. The + P12 password is echoed in the `X-P12-Password` response header and the + certificate resource id in `X-Certificate-Id`. Host-scoped (device-free). + operationId: signCertificate + parameters: [] + requestBody: + content: + multipart/form-data: + encoding: + asc-private-key: + contentType: '*/*' + style: form + schema: + $ref: "#/components/schemas/signCertificate_request" + required: true + responses: + "200": + content: + application/x-pkcs12: + schema: {} + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + "502": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Create a signing certificate + /api/v1/sign/provision: + post: + description: |- + Create a bundle id, development certificate and provisioning profile via App + Store Connect and return both artifacts base64-encoded in a JSON envelope. + The target device udid is supplied as a form field. Host-scoped. + operationId: signProvision + parameters: [] + requestBody: + content: + multipart/form-data: + encoding: + asc-private-key: + contentType: '*/*' + style: form + schema: + $ref: "#/components/schemas/signProvision_request" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ProvisioningResult" + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 500 — internal error while talking to the device. + "502": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Create a provisioning profile + P12 + /api/v1/tunnel-agent/shutdown: + post: + description: "Shut down the tunnel agent (CLI: `ios tunnel stopagent`)." + operationId: shutdownTunnelAgent + parameters: [] + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/AgentShutdown" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "502": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Shut down tunnel agent + /api/v1/tunnels: + get: + description: "List running device tunnels (CLI: `ios tunnel ls`)." + operationId: listTunnels + parameters: [] + responses: + "200": + content: + application/json: + schema: + items: + $ref: "#/components/schemas/Tunnel" + type: array + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "502": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: List tunnels + /api/v1/tunnels/{udid}: + delete: + description: "Stop the tunnel for a device (CLI: `ios tunnel stop --udid`)." + operationId: stopTunnel + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/TunnelStopped" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "502": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Stop tunnel + /api/v1/tunnels/{udid}/refresh: + post: + description: |- + Restart the tunnel for a device and wait for it to come up + (CLI: `ios tunnel refresh`). + operationId: refreshTunnel + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/Tunnel" + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 401 — missing/invalid bearer token (when auth is enabled). + "502": + content: + application/json: + schema: + $ref: "#/components/schemas/GenericResponse" + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Refresh tunnel +components: + schemas: + AXAuditIssue: + description: |- + One accessibility audit issue (`accessibility.AXAuditIssue`) from + `POST /device/{udid}/ax/audit`. Open map — shape depends on the audit type. + type: object + AXElement: + description: |- + `GET /device/{udid}/ax` — a snapshot of the currently focused accessibility + element. Open map (backend-defined element attributes). + type: object + AXEnabledRequest: + description: |- + Body for the accessibility toggle PUTs (`/voiceover`, `/zoom`). The desired + state may also be supplied as an `enabled` query param; a parseable body wins. + example: + enabled: true + properties: + enabled: + type: boolean + required: + - enabled + AgentShutdown: + description: '`POST /tunnel-agent/shutdown` — acknowledgement.' + example: + status: status + properties: + status: + description: Always `agent shutdown requested`. + type: string + required: + - status + AppInfo: + description: |- + Installed application metadata. This is an open map: keys come straight from + the app's Info.plist. Common keys are surfaced for discoverability but any + additional keys may be present. + example: + Path: Path + CFBundleShortVersionString: CFBundleShortVersionString + UIFileSharingEnabled: true + CFBundleIdentifier: CFBundleIdentifier + CFBundleName: CFBundleName + CFBundleExecutable: CFBundleExecutable + properties: + CFBundleIdentifier: + type: string + CFBundleExecutable: + type: string + CFBundleName: + type: string + CFBundleShortVersionString: + type: string + Path: + type: string + UIFileSharingEnabled: + type: boolean + AppStateNotification: + description: An app foreground/background/lifecycle state change. + properties: + bundleId: + description: Bundle id of the app whose state changed. + type: string + state: + description: |- + New application state. + Typical values: `foreground`, `background`, `suspended`, `terminated`, + `unknown`. + type: string + timestamp: + description: Unix epoch milliseconds when the change was observed. + format: int64 + type: integer + required: + - bundleId + - state + AssistiveTouchState: + description: "`GET /device/{udid}/assistivetouch` — AssistiveTouch state." + example: + AssistiveTouchEnabled: true + properties: + AssistiveTouchEnabled: + type: boolean + required: + - AssistiveTouchEnabled + AttachDetachEvent: + description: A device was attached to or detached from the host. + properties: + event: + description: |- + Event kind. + `attached` when a device connects, `detached` when it disconnects, + `paired` when a pairing record appears. + type: string + deviceID: + description: usbmuxd device id. + format: int32 + type: integer + udid: + description: "The device udid (serial number), when known." + type: string + properties: + $ref: "#/components/schemas/DeviceProperties" + required: + - event + BatteryInfo: + description: |- + `GET /device/{udid}/battery` — battery diagnostics (`ios.BatteryInfo`). + Open map; commonly-present keys are surfaced for discoverability. + example: + FullyCharged: true + Temperature: 6 + IsCharging: true + CurrentCapacity: 0 + ExternalConnected: true + properties: + CurrentCapacity: + format: int32 + type: integer + ExternalConnected: + type: boolean + FullyCharged: + type: boolean + IsCharging: + type: boolean + Temperature: + format: int32 + type: integer + BatteryRegistry: + description: |- + `GET /device/{udid}/battery/registry` — battery IORegistry stats + (`diagnostics.IORegistry`). Open map; common keys surfaced. + example: + FullyCharged: true + Temperature: 0 + Voltage: 6 + InstantAmperage: 5 + IsCharging: true + CurrentCapacity: 1 + properties: + Temperature: + format: int32 + type: integer + Voltage: + format: int32 + type: integer + CurrentCapacity: + format: int32 + type: integer + InstantAmperage: + format: int64 + type: integer + IsCharging: + type: boolean + FullyCharged: + type: boolean + CloudConfig: + description: |- + `GET /device/{udid}/cloudconfig` — the device cloud configuration + (`mcinstall` GetCloudConfiguration): supervision status, skip-setup options + and organization info. Open map. + type: object + CpuUsageSample: + description: A single sysmontap CPU-usage sample. Open map; sampler keys vary + by OS. + properties: + CPU_TotalLoad: + description: Total CPU load across all cores (0–100). + format: double + type: number + SystemLoad: + description: System (kernel) CPU load. + format: double + type: number + UserLoad: + description: User CPU load. + format: double + type: number + CrashListing: + description: "`GET /device/{udid}/crashes` — crash report names." + example: + count: 0 + files: + - files + - files + properties: + files: + items: + type: string + type: array + count: + format: int32 + type: integer + required: + - count + - files + DevModeRequest: + description: "`POST /device/{udid}/devmode` request." + example: + action: action + enablePostRestart: true + properties: + action: + description: "`enable` to turn developer mode on, `reveal` to expose the\ + \ settings menu." + type: string + enablePostRestart: + description: "When enabling, also arm developer mode to persist across the\ + \ next reboot." + type: boolean + required: + - action + DevModeState: + description: "`GET /device/{udid}/devmode` — developer mode state." + example: + DeveloperModeEnabled: true + properties: + DeveloperModeEnabled: + type: boolean + required: + - DeveloperModeEnabled + DeviceDate: + description: "`GET /device/{udid}/date`." + example: + TimeIntervalSince1970: 0.8008281904610115 + formatedDate: formatedDate + properties: + formatedDate: + description: Human-readable RFC850 date on the device. + type: string + TimeIntervalSince1970: + description: Device clock as Unix epoch seconds. + format: double + type: number + required: + - TimeIntervalSince1970 + - formatedDate + DeviceEntry: + description: A single device as returned by `GET /list`. + example: + address: address + messageType: messageType + userspaceTUNPort: 2 + userspaceTUN: true + userspaceTUNHost: userspaceTUNHost + deviceID: 0 + properties: + serialNumber: serialNumber + productID: 5 + locationID: 5 + connectionSpeed: 6 + connectionType: connectionType + deviceID: 1 + properties: + deviceID: + format: int32 + type: integer + messageType: + type: string + properties: + $ref: "#/components/schemas/DeviceProperties" + address: + description: Network address for a device reached over the network / tunnel. + type: string + userspaceTUN: + description: True if reachable via the userspace TUN tunnel. + type: boolean + userspaceTUNHost: + type: string + userspaceTUNPort: + format: int32 + type: integer + required: + - deviceID + - properties + DeviceInfo: + description: |- + `GET /device/{udid}/info` — lockdown values plus `instruments:*` keys. + Open dictionary; values are heterogeneous. + type: object + DeviceList: + description: Response of `GET /list`. + example: + deviceList: + - address: address + messageType: messageType + userspaceTUNPort: 2 + userspaceTUN: true + userspaceTUNHost: userspaceTUNHost + deviceID: 0 + properties: + serialNumber: serialNumber + productID: 5 + locationID: 5 + connectionSpeed: 6 + connectionType: connectionType + deviceID: 1 + - address: address + messageType: messageType + userspaceTUNPort: 2 + userspaceTUN: true + userspaceTUNHost: userspaceTUNHost + deviceID: 0 + properties: + serialNumber: serialNumber + productID: 5 + locationID: 5 + connectionSpeed: 6 + connectionType: connectionType + deviceID: 1 + properties: + deviceList: + items: + $ref: "#/components/schemas/DeviceEntry" + type: array + required: + - deviceList + DeviceName: + description: "`GET /device/{udid}/devicename`." + example: + devicename: devicename + properties: + devicename: + type: string + required: + - devicename + DeviceProperties: + description: Low-level device properties reported by usbmuxd / lockdown. + example: + serialNumber: serialNumber + productID: 5 + locationID: 5 + connectionSpeed: 6 + connectionType: connectionType + deviceID: 1 + properties: + connectionSpeed: + format: int32 + type: integer + connectionType: + type: string + deviceID: + format: int32 + type: integer + locationID: + format: int32 + type: integer + productID: + format: int32 + type: integer + serialNumber: + description: The device udid (serial number). This is what device-scoped + routes key on. + type: string + required: + - serialNumber + Diagnostics: + description: "`GET /device/{udid}/diagnostics` — all IORegistry/diagnostic values.\ + \ Open map." + type: object + DiskSpaceInfo: + description: |- + `GET /device/{udid}/diskspace` — AFC filesystem info (`afc.DeviceInfo`). + Total/free/used bytes and block size. Open map; common keys surfaced. + example: + Model: Model + FSBlockSize: 1 + FSFreeBytes: 6 + FSTotalBytes: 0 + properties: + FSTotalBytes: + description: Total filesystem capacity in bytes. + format: int64 + type: integer + FSFreeBytes: + description: Free filesystem space in bytes. + format: int64 + type: integer + FSBlockSize: + description: Filesystem block size in bytes. + format: int64 + type: integer + Model: + description: AFC model identifier reported by the device. + type: string + EnabledRequest: + description: Request body for the `enabled`-toggle settings endpoints. + example: + enabled: true + properties: + enabled: + type: boolean + required: + - enabled + FileDomain: + anyOf: + - type: string + - enum: + - app + - app-group + - crash + - temp + type: string + description: Domain of the on-device file service. + FileEntry: + description: A single entry in a device directory listing. + example: + path: path + size: 0 + name: name + isDir: true + properties: + name: + type: string + path: + type: string + isDir: + type: boolean + size: + format: int64 + type: integer + FileListing: + description: "`GET /device/{udid}/files` — directory listing." + example: + path: path + count: 6 + files: + - path: path + size: 0 + name: name + isDir: true + - path: path + size: 0 + name: name + isDir: true + properties: + path: + type: string + files: + items: + $ref: "#/components/schemas/FileEntry" + type: array + count: + format: int32 + type: integer + required: + - count + - files + - path + FilePushResult: + description: "`POST /device/{udid}/files/push` — acknowledgement." + example: + size: 0 + remote: remote + properties: + remote: + type: string + size: + format: int64 + type: integer + required: + - remote + - size + ForwardRequest: + description: "`POST /device/{udid}/jobs/forward` request." + example: + hostPort: 0 + targetPort: 6 + properties: + hostPort: + description: Local (host) TCP port to listen on. + format: uint16 + type: integer + targetPort: + description: Device TCP port to forward to. + format: uint16 + type: integer + required: + - hostPort + - targetPort + FsyncListing: + description: "`GET /device/{udid}/fsync/ls` — a directory listing over AFC." + example: + path: path + count: 0 + files: + - files + - files + properties: + path: + description: The listed (cleaned) device path. + type: string + files: + description: File/directory names in the listed directory. + items: + type: string + type: array + count: + description: Number of entries. + format: int32 + type: integer + required: + - count + - files + - path + FsyncMessage: + description: |- + `POST /device/{udid}/fsync/mkdir` and `DELETE /device/{udid}/fsync/rm` — + simple message + path acknowledgement. + example: + path: path + message: message + properties: + message: + description: "Human-readable result message (e.g. `created`, `removed`)." + type: string + path: + description: The (cleaned) device path acted on. + type: string + required: + - message + - path + FsyncPushResult: + description: "`POST /device/{udid}/fsync/push` — result of an upload over AFC." + example: + path: path + size: 0 + properties: + path: + description: Destination device path written. + type: string + size: + description: Number of bytes written. + format: int64 + type: integer + required: + - path + - size + FsyncTreeEntry: + description: "One entry returned by the recursive `GET /device/{udid}/fsync/tree`\ + \ walk." + example: + path: path + size: 0 + name: name + isDir: true + properties: + path: + description: Full device-side path of this entry. + type: string + name: + description: Base name of the entry. + type: string + isDir: + description: Whether the entry is a directory. + type: boolean + size: + description: Size in bytes. + format: int64 + type: integer + required: + - isDir + - name + - path + - size + FsyncTreeListing: + description: "`GET /device/{udid}/fsync/tree` — a recursive directory walk over\ + \ AFC." + example: + path: path + entries: + - path: path + size: 0 + name: name + isDir: true + - path: path + size: 0 + name: name + isDir: true + count: 6 + properties: + path: + description: The root (cleaned) device path. + type: string + entries: + description: Flattened list of entries in the subtree. + items: + $ref: "#/components/schemas/FsyncTreeEntry" + type: array + count: + description: Number of entries. + format: int32 + type: integer + required: + - count + - entries + - path + GenericResponse: + description: |- + The dominant response envelope used across the API. Success responses set + `message`; error responses set `error`. Streaming/middleware paths that emit + `gin.H{"error"|"message"}` are compatible with this shape. + example: + message: message + error: error + properties: + message: + description: Human-readable success or status message. + type: string + error: + description: Human-readable error message. Present on failures. + type: string + Heartbeat: + description: Periodic keep-alive frame emitted on every stream. Payload is empty. + type: object + IconLayout: + description: "`GET /device/{udid}/icon-layout` — SpringBoard icon layout. Open\ + \ structure." + type: object + InstalledProfiles: + description: |- + `GET /device/{udid}/profiles` — installed configuration profiles. + Open dictionary; values are heterogeneous. + type: object + Job: + description: |- + A long-running operation started via the REST API (test run, WDA runner, + port forward). Mirrors the server's `jobView`. + example: + result: "" + kind: kind + startedAt: 2000-01-23T04:56:07.000+00:00 + id: id + udid: udid + error: error + status: JobStatus + finishedAt: 2000-01-23T04:56:07.000+00:00 + properties: + id: + description: "Opaque job id, e.g. `runtest-3`." + type: string + kind: + description: "Job kind: `runtest`, `runwda` or `forward`." + type: string + udid: + description: The device udid the job runs on. + type: string + status: + $ref: "#/components/schemas/JobStatus" + startedAt: + description: When the job started (ISO-8601). + format: date-time + type: string + finishedAt: + description: When the job reached a terminal state (absent while running). + format: date-time + type: string + error: + description: Error message when `status` is `failed`. + type: string + result: {} + required: + - id + - kind + - startedAt + - status + - udid + JobLogEvents: + anyOf: + - $ref: "#/components/schemas/JobLogLine" + - $ref: "#/components/schemas/Heartbeat" + JobLogLine: + description: A single line of a job's log output. + properties: + line: + description: The raw log line (already newline-terminated in the buffer). + type: string + required: + - line + JobStatus: + anyOf: + - type: string + - enum: + - running + - succeeded + - failed + - stopped + type: string + description: Job lifecycle state. + LanguageConfiguration: + description: |- + Language/locale configuration (`ios.LanguageConfiguration`), returned by + `GET/PUT /device/{udid}/lang`. + example: + Locale: Locale + SupportedLanguages: + - SupportedLanguages + - SupportedLanguages + Language: Language + SupportedLocales: + - SupportedLocales + - SupportedLocales + properties: + Language: + type: string + Locale: + type: string + SupportedLocales: + description: Supported locales advertised by the device. + items: + type: string + type: array + SupportedLanguages: + description: Supported UI languages advertised by the device. + items: + type: string + type: array + ListenEvents: + anyOf: + - $ref: "#/components/schemas/AttachDetachEvent" + - $ref: "#/components/schemas/Heartbeat" + LockdownValues: + description: "`GET /device/{udid}/lockdown` — all lockdown values. Open map." + type: object + MemLimitRequest: + description: "`POST /device/{udid}/memlimitoff` request." + example: + process: process + properties: + process: + description: Process name whose memory limit should be waived. + type: string + required: + - process + MemLimitResult: + description: "`POST /device/{udid}/memlimitoff` response." + example: + process: process + pid: 0 + disabled: true + properties: + process: + type: string + pid: + format: int32 + type: integer + disabled: + type: boolean + required: + - disabled + - pid + - process + MobileGestalt: + description: "`GET /device/{udid}/mobilegestalt` — queried MobileGestalt keys.\ + \ Open map." + type: object + MountedImages: + description: "`GET /device/{udid}/image/list` — mounted DDI signatures." + example: + count: 0 + signatures: + - signatures + - signatures + properties: + signatures: + description: Hex-encoded image signatures. + items: + type: string + type: array + count: + format: int32 + type: integer + required: + - count + - signatures + NetworkInfo: + description: |- + `GET /device/{udid}/ip` — device network info discovered over pcapd + (`pcap.NetworkInfo`). + example: + IPv6: IPv6 + IPv4: IPv4 + MacAddress: MacAddress + properties: + MacAddress: + description: Hardware (MAC) address. + type: string + IPv4: + description: "IPv4 address, when discovered." + type: string + IPv6: + description: "IPv6 address, when discovered." + type: string + NotificationEvents: + anyOf: + - $ref: "#/components/schemas/AppStateNotification" + - $ref: "#/components/schemas/Heartbeat" + OsTraceEntry: + description: A structured os_log trace entry. + properties: + pid: + description: Process id that emitted the entry. + format: int32 + type: integer + processName: + description: Emitting process/executable name. + type: string + level: + description: "Log level, e.g. `default`, `info`, `debug`, `error`, `fault`." + type: string + subsystem: + description: Subsystem string (e.g. `com.apple.network`). + type: string + category: + description: Category within the subsystem. + type: string + message: + description: The formatted log message. + type: string + timestamp: + description: "Unix epoch milliseconds when the entry was emitted, if known." + format: int64 + type: integer + required: + - message + OsTraceEvents: + anyOf: + - $ref: "#/components/schemas/OsTraceEntry" + - $ref: "#/components/schemas/Heartbeat" + PasteboardContent: + description: "`GET /device/{udid}/pasteboard` — clipboard contents." + example: + text: text + present: true + properties: + present: + description: Whether any text was present on the pasteboard. + type: boolean + text: + description: The clipboard text (empty when `present` is false). + type: string + required: + - present + - text + PrepareResult: + description: "`POST /device/{udid}/prepare` — device preparation acknowledgement." + example: + supervised: true + status: status + properties: + status: + description: Always `prepared`. + type: string + supervised: + description: Whether the device was supervised (a supervision cert was supplied). + type: boolean + required: + - status + - supervised + PrepareSkipOptions: + description: |- + `GET /prepare/skip-options` — the static list of setup-pane skip options + usable when preparing a device. Host-scoped (device-free). + example: + options: + - options + - options + count: 0 + properties: + options: + description: All available skip-option identifiers. + items: + type: string + type: array + count: + description: Number of options. + format: int32 + type: integer + required: + - count + - options + ProcessInfo: + description: |- + A running process entry (`instruments.ProcessInfo`) from + `GET /device/{udid}/processes`. + example: + name: name + pid: 0 + isApplication: true + startDate: 2000-01-23T04:56:07.000+00:00 + realAppName: realAppName + properties: + pid: + format: int32 + type: integer + name: + type: string + realAppName: + type: string + isApplication: + type: boolean + startDate: + description: "Process start time, ISO-8601." + format: date-time + type: string + required: + - name + - pid + Profile: + description: A single condition profile within a `ProfileType`. + example: + identifier: identifier + name: name + description: description + properties: + description: + type: string + identifier: + type: string + name: + type: string + required: + - identifier + - name + ProfileType: + description: "A condition inducer profile type (e.g. thermal, network) with\ + \ its variants." + example: + isInternal: true + identifier: identifier + activeProfile: activeProfile + name: name + profiles: + - identifier: identifier + name: name + description: description + - identifier: identifier + name: name + description: description + isDestructive: true + profilesSorted: true + isActive: true + properties: + activeProfile: + type: string + identifier: + type: string + profilesSorted: + type: boolean + isActive: + type: boolean + name: + type: string + isDestructive: + type: boolean + isInternal: + type: boolean + profiles: + items: + $ref: "#/components/schemas/Profile" + type: array + required: + - identifier + - name + - profiles + ProvisioningResult: + description: |- + `POST /sign/provision` — provisioning assets envelope. The mobileprovision + (and optionally the P12) are base64-encoded so one JSON response can carry + both binary artifacts. Host-scoped (device-free). + example: + p12Password: p12Password + certificateId: certificateId + bundleId: bundleId + mobileprovisionBase64: mobileprovisionBase64 + p12Base64: p12Base64 + properties: + bundleId: + description: The app bundle identifier registered with App Store Connect. + type: string + certificateId: + description: The signing certificate resource id. + type: string + mobileprovisionBase64: + description: "The `.mobileprovision`, base64-encoded." + type: string + p12Base64: + description: "The generated `.p12`, base64-encoded (absent when reusing\ + \ a certificate)." + type: string + p12Password: + description: "The password protecting `p12Base64`, echoed back (client-supplied)." + type: string + required: + - bundleId + - certificateId + - mobileprovisionBase64 + RsdServiceEntry: + description: A single RSD (Remote Service Discovery) service entry. + properties: + Port: + description: TCP port the service is reachable on over the tunnel. + format: int32 + type: integer + ProtocolType: + description: Wire protocol (e.g. `tcp`). + type: string + RsdServices: + description: |- + `GET /device/{udid}/rsd` — the device's Remote Service Discovery service list + keyed by service name. Requires a running tunnel (iOS 17+); devices without + RSD return `400`. + type: object + RunTestRequest: + description: "`POST /device/{udid}/jobs/runtest` (and `runwda`) request." + example: + args: + - args + - args + xctestConfig: xctestConfig + testsToSkip: + - testsToSkip + - testsToSkip + xctest: true + testRunnerBundleId: testRunnerBundleId + bundleId: bundleId + env: "{}" + testsToRun: + - testsToRun + - testsToRun + properties: + bundleId: + description: Bundle id of the app under test. + type: string + testRunnerBundleId: + description: Bundle id of the test runner. Defaults to `bundleId` if omitted. + type: string + xctestConfig: + description: Name of the `.xctestconfiguration`. + type: string + env: + description: Extra environment variables for the test runner. + type: object + args: + description: Extra process arguments for the test runner. + items: + type: string + type: array + testsToRun: + description: Only run these tests (`Class/method` identifiers). + items: + type: string + type: array + testsToSkip: + description: Skip these tests. + items: + type: string + type: array + xctest: + description: Run as a plain XCTest (vs XCUITest). + type: boolean + SecurityInfo: + description: "`POST /device/{udid}/mdm/security-info` — device security info.\ + \ Open map." + type: object + SetLanguageRequest: + description: "`PUT /device/{udid}/lang` request." + example: + language: language + locale: locale + properties: + language: + type: string + locale: + type: string + StatusOk: + description: "Simple `{ \"status\": \"ok\" }` acknowledgement used by MDM clear\ + \ operations." + example: + status: status + properties: + status: + type: string + required: + - status + SupervisionCert: + description: |- + `POST /prepare/create-cert` — a generated self-signed supervision identity, + returned as DER (base64) and PEM for both the certificate and private key. + Host-scoped (device-free). + example: + privateKeyDerBase64: privateKeyDerBase64 + privateKeyPem: privateKeyPem + certPem: certPem + certDerBase64: certDerBase64 + properties: + certDerBase64: + description: "Certificate in DER form, base64-encoded." + type: string + certPem: + description: Certificate in PEM form. + type: string + privateKeyDerBase64: + description: "Private key in DER form, base64-encoded." + type: string + privateKeyPem: + description: Private key in PEM form. + type: string + required: + - certDerBase64 + - certPem + - privateKeyDerBase64 + - privateKeyPem + SyslogEvents: + anyOf: + - $ref: "#/components/schemas/SyslogMessage" + - $ref: "#/components/schemas/Heartbeat" + SyslogMessage: + description: A single syslog line from the device. + properties: + message: + description: The raw log message text. + type: string + timestamp: + description: "Unix epoch milliseconds when the line was emitted, if known." + format: int64 + type: integer + required: + - message + SysmontapEvents: + anyOf: + - $ref: "#/components/schemas/CpuUsageSample" + - $ref: "#/components/schemas/Heartbeat" + TimeFormatRequest: + description: "`PUT /device/{udid}/timeformat` request." + example: + uses24Hour: true + properties: + uses24Hour: + type: boolean + required: + - uses24Hour + TimeFormatState: + description: "`GET /device/{udid}/timeformat` — 24-hour clock state." + example: + Uses24HourClock: true + properties: + Uses24HourClock: + type: boolean + required: + - Uses24HourClock + Tunnel: + description: |- + A running device tunnel as reported by the tunnel agent + (`GET /tunnels`, `POST /tunnels/{udid}/refresh`). Mirrors `tunnel.Tunnel`. + example: + Udid: Udid + Address: Address + UserspaceTUN: true + RsdPort: 0 + UserspaceTUNPort: 6 + properties: + Udid: + description: The device udid this tunnel serves. + type: string + Address: + description: Tunnel address (IPv6) reachable for RemoteXPC/RSD. + type: string + RsdPort: + description: RemoteServiceDiscovery port on the tunnel. + format: int32 + type: integer + UserspaceTUN: + description: Whether this tunnel is a userspace TUN. + type: boolean + UserspaceTUNPort: + description: "Userspace TUN port, when `UserspaceTUN` is true." + format: int32 + type: integer + required: + - Address + - RsdPort + - Udid + TunnelStopped: + description: "`DELETE /tunnels/{udid}` — acknowledgement that the tunnel was\ + \ stopped." + example: + udid: udid + status: status + properties: + udid: + type: string + status: + description: Always `stopped`. + type: string + required: + - status + - udid + UIAPIRequest: + description: |- + `POST /device/{udid}/ui/api` request — raw passthrough to the backend + (`uidriver.APIRequest`). For WDA supply `method`/`path`/`body`; for DeviceKit + supply `rpcMethod`/`rpcParams`. + example: + path: path + method: method + rpcMethod: rpcMethod + body: body + rpcParams: "" + properties: + method: + description: HTTP method for a WDA passthrough (defaults to GET). + type: string + path: + description: HTTP path for a WDA passthrough (required for the wda backend). + type: string + body: + description: Raw HTTP request body for a WDA passthrough (base64 bytes on + the wire). + type: string + rpcMethod: + description: JSON-RPC method name for a DeviceKit passthrough. + type: string + rpcParams: {} + UIAppRequest: + description: "`POST /device/{udid}/ui/app/{launch,terminate}` request." + example: + bundleId: bundleId + properties: + bundleId: + type: string + required: + - bundleId + UIButtonRequest: + description: "`POST /device/{udid}/ui/button` request — hardware button by name." + example: + name: name + properties: + name: + description: "Button name (e.g. `home`, `volumeup`). WDA supports only `home`." + type: string + required: + - name + UILongPressRequest: + description: "`POST /device/{udid}/ui/longpress` request — press and hold at\ + \ (x,y)." + example: + duration: 1.4658129805029452 + x: 0 + "y": 6 + properties: + x: + format: int32 + type: integer + "y": + format: int32 + type: integer + duration: + description: Hold duration in seconds. + format: double + type: number + required: + - x + - "y" + UIOrientationRequest: + description: "`PUT /device/{udid}/ui/orientation` request." + example: + orientation: orientation + properties: + orientation: + description: "Target orientation (e.g. `PORTRAIT`, `LANDSCAPE`)." + type: string + required: + - orientation + UIResponse: + description: |- + A backend passthrough response. The body and content-type are forwarded from + WDA/DeviceKit verbatim, so the shape is backend-defined (open map). + type: object + UISwipeRequest: + description: "`POST /device/{udid}/ui/swipe` request — drag from (x1,y1) to\ + \ (x2,y2)." + example: + duration: 5.637376656633329 + y1: 6 + x1: 0 + y2: 5 + x2: 1 + properties: + x1: + format: int32 + type: integer + y1: + format: int32 + type: integer + x2: + format: int32 + type: integer + y2: + format: int32 + type: integer + duration: + description: Gesture duration in seconds. + format: double + type: number + required: + - x1 + - x2 + - y1 + - y2 + UITapRequest: + description: "`POST /device/{udid}/ui/tap` request — absolute coordinates." + example: + x: 0 + "y": 6 + properties: + x: + format: int32 + type: integer + "y": + format: int32 + type: integer + required: + - x + - "y" + UITypeRequest: + description: "`POST /device/{udid}/ui/type` request — keyboard input." + example: + text: text + properties: + text: + type: string + required: + - text + UnlockToken: + description: "`POST /device/{udid}/mdm/fetch-unlock-token` — base64 escrow unlock\ + \ token." + example: + token: token + properties: + token: + description: Base64-encoded escrow unlock token. + type: string + required: + - token + VoiceOverState: + description: "`GET|PUT /device/{udid}/voiceover` — VoiceOver enabled state." + example: + VoiceOverEnabled: true + properties: + VoiceOverEnabled: + type: boolean + required: + - VoiceOverEnabled + WdaConfig: + description: Configuration for launching a WebDriverAgent (XCUITest) runner + session. + example: + args: + - args + - args + xcTestConfig: xcTestConfig + testBundleId: testBundleId + bundleId: bundleId + env: "{}" + properties: + bundleId: + description: Bundle id of the WDA runner host app (e.g. `com.facebook.WebDriverAgentRunner.xctrunner`). + type: string + testBundleId: + description: Bundle id of the XCTest test bundle. + type: string + xcTestConfig: + description: Path/name of the `.xctestconfiguration` to use. + type: string + args: + description: Extra process arguments passed to the runner. + items: + type: string + type: array + env: + description: Extra environment variables passed to the runner. + type: object + required: + - bundleId + - testBundleId + - xcTestConfig + WdaSession: + description: A running WebDriverAgent session. + example: + sessionId: sessionId + udid: udid + config: + args: + - args + - args + xcTestConfig: xcTestConfig + testBundleId: testBundleId + bundleId: bundleId + env: "{}" + properties: + config: + $ref: "#/components/schemas/WdaConfig" + sessionId: + description: Opaque session identifier. + type: string + udid: + description: The device udid the session runs on. + type: string + required: + - config + - sessionId + - udid + WebInspectorEvalRequest: + description: "`POST /device/{udid}/webinspector/eval` request body." + example: + bundleId: bundleId + page: page + script: script + properties: + page: + description: |- + Inspectable page key. When empty the first matching web/javascript page + (optionally scoped by `bundleId`) is used. + type: string + bundleId: + description: Optional bundle id to scope page selection. + type: string + script: + description: JavaScript source to evaluate. Required. + type: string + required: + - script + WebInspectorEvalResult: + description: "`POST /device/{udid}/webinspector/eval` — evaluation result." + example: + result: "" + page: page + properties: + page: + description: The page key the script ran in. + type: string + result: {} + required: + - page + - result + WebInspectorLaunchRequest: + description: "`POST /device/{udid}/webinspector/launch` request body." + example: + bundleId: bundleId + url: url + properties: + url: + description: URL to open. May alternatively be supplied as the `url` query + param. + type: string + bundleId: + description: Bundle id to open the URL in. Defaults to Safari. + type: string + WebInspectorLaunchResult: + description: "`POST /device/{udid}/webinspector/launch` — result of opening\ + \ a URL." + example: + bundleId: bundleId + title: title + url: url + properties: + bundleId: + description: Bundle id the page was opened in. + type: string + url: + description: The resolved current URL after navigation. + type: string + title: + description: The page title after navigation. + type: string + required: + - bundleId + - title + - url + WebInspectorPage: + description: |- + One inspectable page (`webinspector.ApplicationPage`) from + `GET /device/{udid}/webinspector/pages`. Open map — carries the application + and page descriptors as the device reports them. + type: object + WifiRequest: + description: "`PUT /device/{udid}/wifi` request." + example: + encType: encType + password: password + ssid: ssid + properties: + ssid: + type: string + password: + type: string + encType: + description: "Encryption type, e.g. `WPA2`, `WPA`, `WEP`, `None`." + type: string + required: + - ssid + ZoomTouchState: + description: "`GET|PUT /device/{udid}/zoom` — ZoomTouch enabled state." + example: + ZoomTouchEnabled: true + properties: + ZoomTouchEnabled: + type: boolean + required: + - ZoomTouchEnabled + Devices_installApp_request: + properties: + file: {} + required: + - file + Devices_setHttpProxy_request: + properties: + host: + description: Proxy host. + type: string + port: + description: Proxy port. + type: string + p12: {} + user: + description: Proxy username. + type: string + pass: + description: Proxy password. + type: string + password: + description: Passphrase for the `.p12` identity. + type: string + required: + - host + - p12 + - port + Devices_getJob_404_response: + anyOf: + - $ref: "#/components/schemas/GenericResponse" + - $ref: "#/components/schemas/GenericResponse" + Devices_mdmClearPasscode_request: + properties: + p12: {} + password: + description: Passphrase for the `.p12` identity. + type: string + token: + description: Base64-encoded escrow unlock token. + type: string + required: + - p12 + - token + Devices_mdmClearScreenTimePassword_request: + properties: + p12: {} + password: + description: Passphrase for the `.p12` identity. + type: string + required: + - p12 + Devices_pair_request: + properties: + p12file: {} + required: + - p12file + Prepare_prepareDevice_request: + properties: + cert: {} + p12password: + description: P12 password (when `cert` is a P12). + type: string + skip: + description: Setup panes to skip (see /prepare/skip-options). Repeatable. + items: + type: string + type: array + orgname: + description: Supervision organization name. + type: string + locale: + description: Device locale (default en_US). + type: string + lang: + description: Device language (default en). + type: string + Devices_addProfile_request: + properties: + profile: {} + p12: {} + password: + description: Passphrase for the `.p12` identity. + type: string + required: + - profile + Accessibility_setLocationGpx_request: + properties: + gpx: {} + required: + - gpx + Devices_setWallpaper_request: + properties: + image: {} + p12: {} + password: + description: Passphrase for the `.p12` identity. + type: string + screen: + description: "Target screen (`home`, `lock`, `both`)." + type: string + required: + - image + - p12 + signApp_request: + properties: + ipa: {} + p12file: {} + profile: {} + p12password: + description: P12 password. + type: string + bundleid: + description: Override bundle id. + type: string + required: + - ipa + - p12file + - profile + signCertificate_request: + properties: + asc-private-key: {} + asc-key-id: + description: App Store Connect key id. + type: string + asc-issuer-id: + description: App Store Connect issuer id. + type: string + revoke-existing: + description: Revoke existing iOS Development certificates first. + type: string + p12password: + description: Password to protect the generated P12. + type: string + required: + - asc-issuer-id + - asc-key-id + - asc-private-key + signProvision_request: + properties: + asc-private-key: {} + asc-key-id: + description: App Store Connect key id. + type: string + asc-issuer-id: + description: App Store Connect issuer id. + type: string + bundleid: + description: App bundle identifier. + type: string + udid: + description: Target device udid to register against the profile. + type: string + bundlename: + description: Bundle display name. + type: string + profilename: + description: Provisioning profile name. + type: string + devicename: + description: Device display name. + type: string + certificate-id: + description: Reuse an existing certificate (no new P12 is generated). + type: string + revoke-existing: + description: Revoke existing certificates first. + type: string + p12password: + description: Password to protect the generated P12. + type: string + required: + - asc-issuer-id + - asc-key-id + - asc-private-key + - bundleid + - udid + securitySchemes: + BearerAuth: + scheme: Bearer + type: http + diff --git a/sdks/packages/csharp/src/Generated/appveyor.yml b/sdks/packages/csharp/src/Generated/appveyor.yml new file mode 100644 index 000000000..ab925ff51 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/appveyor.yml @@ -0,0 +1,9 @@ +# auto-generated by OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator) +# +image: Visual Studio 2019 +clone_depth: 1 +build_script: +- dotnet build -c Release +- dotnet test -c Release +after_build: +- dotnet pack .\src\GoIos.Sdk.Generated\GoIos.Sdk.Generated.csproj -o ../../output -c Release --no-build diff --git a/sdks/packages/csharp/src/Generated/docs/AXEnabledRequest.md b/sdks/packages/csharp/src/Generated/docs/AXEnabledRequest.md new file mode 100644 index 000000000..0746385ee --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/AXEnabledRequest.md @@ -0,0 +1,11 @@ +# GoIos.Sdk.Generated.Model.AXEnabledRequest +Body for the accessibility toggle PUTs (`/voiceover`, `/zoom`). The desired state may also be supplied as an `enabled` query param; a parseable body wins. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enabled** | **bool** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/AgentShutdown.md b/sdks/packages/csharp/src/Generated/docs/AgentShutdown.md new file mode 100644 index 000000000..fb9d1046f --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/AgentShutdown.md @@ -0,0 +1,11 @@ +# GoIos.Sdk.Generated.Model.AgentShutdown +`POST /tunnel-agent/shutdown` — acknowledgement. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Status** | **string** | Always `agent shutdown requested`. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/AppInfo.md b/sdks/packages/csharp/src/Generated/docs/AppInfo.md new file mode 100644 index 000000000..519bf51a6 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/AppInfo.md @@ -0,0 +1,16 @@ +# GoIos.Sdk.Generated.Model.AppInfo +Installed application metadata. This is an open map: keys come straight from the app's Info.plist. Common keys are surfaced for discoverability but any additional keys may be present. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CFBundleIdentifier** | **string** | | [optional] +**CFBundleExecutable** | **string** | | [optional] +**CFBundleName** | **string** | | [optional] +**CFBundleShortVersionString** | **string** | | [optional] +**Path** | **string** | | [optional] +**UIFileSharingEnabled** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/AppStateNotification.md b/sdks/packages/csharp/src/Generated/docs/AppStateNotification.md new file mode 100644 index 000000000..e62c16fda --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/AppStateNotification.md @@ -0,0 +1,13 @@ +# GoIos.Sdk.Generated.Model.AppStateNotification +An app foreground/background/lifecycle state change. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BundleId** | **string** | Bundle id of the app whose state changed. | +**State** | **string** | New application state. Typical values: `foreground`, `background`, `suspended`, `terminated`, `unknown`. | +**Timestamp** | **long** | Unix epoch milliseconds when the change was observed. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/AssistiveTouchState.md b/sdks/packages/csharp/src/Generated/docs/AssistiveTouchState.md new file mode 100644 index 000000000..d77e8218d --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/AssistiveTouchState.md @@ -0,0 +1,11 @@ +# GoIos.Sdk.Generated.Model.AssistiveTouchState +`GET /device/{udid}/assistivetouch` — AssistiveTouch state. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AssistiveTouchEnabled** | **bool** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/AttachDetachEvent.md b/sdks/packages/csharp/src/Generated/docs/AttachDetachEvent.md new file mode 100644 index 000000000..972b465d1 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/AttachDetachEvent.md @@ -0,0 +1,14 @@ +# GoIos.Sdk.Generated.Model.AttachDetachEvent +A device was attached to or detached from the host. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Event** | **string** | Event kind. `attached` when a device connects, `detached` when it disconnects, `paired` when a pairing record appears. | +**DeviceID** | **int** | usbmuxd device id. | [optional] +**Udid** | **string** | The device udid (serial number), when known. | [optional] +**Properties** | [**DeviceProperties**](DeviceProperties.md) | Full device properties, present on `attached`. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/BatteryInfo.md b/sdks/packages/csharp/src/Generated/docs/BatteryInfo.md new file mode 100644 index 000000000..ccb1ad683 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/BatteryInfo.md @@ -0,0 +1,15 @@ +# GoIos.Sdk.Generated.Model.BatteryInfo +`GET /device/{udid}/battery` — battery diagnostics (`ios.BatteryInfo`). Open map; commonly-present keys are surfaced for discoverability. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CurrentCapacity** | **int** | | [optional] +**ExternalConnected** | **bool** | | [optional] +**FullyCharged** | **bool** | | [optional] +**IsCharging** | **bool** | | [optional] +**Temperature** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/BatteryRegistry.md b/sdks/packages/csharp/src/Generated/docs/BatteryRegistry.md new file mode 100644 index 000000000..5df510408 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/BatteryRegistry.md @@ -0,0 +1,16 @@ +# GoIos.Sdk.Generated.Model.BatteryRegistry +`GET /device/{udid}/battery/registry` — battery IORegistry stats (`diagnostics.IORegistry`). Open map; common keys surfaced. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Temperature** | **int** | | [optional] +**Voltage** | **int** | | [optional] +**CurrentCapacity** | **int** | | [optional] +**InstantAmperage** | **long** | | [optional] +**IsCharging** | **bool** | | [optional] +**FullyCharged** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/CpuUsageSample.md b/sdks/packages/csharp/src/Generated/docs/CpuUsageSample.md new file mode 100644 index 000000000..041083da1 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/CpuUsageSample.md @@ -0,0 +1,13 @@ +# GoIos.Sdk.Generated.Model.CpuUsageSample +A single sysmontap CPU-usage sample. Open map; sampler keys vary by OS. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CPUTotalLoad** | **double** | Total CPU load across all cores (0–100). | [optional] +**SystemLoad** | **double** | System (kernel) CPU load. | [optional] +**UserLoad** | **double** | User CPU load. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/CrashListing.md b/sdks/packages/csharp/src/Generated/docs/CrashListing.md new file mode 100644 index 000000000..d3cac8974 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/CrashListing.md @@ -0,0 +1,12 @@ +# GoIos.Sdk.Generated.Model.CrashListing +`GET /device/{udid}/crashes` — crash report names. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Files** | **List<string>** | | +**Count** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/DefaultApi.md b/sdks/packages/csharp/src/Generated/docs/DefaultApi.md new file mode 100644 index 000000000..2c2229820 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/DefaultApi.md @@ -0,0 +1,13321 @@ +# GoIos.Sdk.Generated.Api.DefaultApi + +All URIs are relative to *http://localhost:60105* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**AccessibilityGetAxSnapshot**](DefaultApi.md#accessibilitygetaxsnapshot) | **GET** /api/v1/device/{udid}/ax | Get accessibility element snapshot | +| [**AccessibilityGetVoiceOver**](DefaultApi.md#accessibilitygetvoiceover) | **GET** /api/v1/device/{udid}/voiceover | Get VoiceOver state | +| [**AccessibilityGetZoomTouch**](DefaultApi.md#accessibilitygetzoomtouch) | **GET** /api/v1/device/{udid}/zoom | Get ZoomTouch state | +| [**AccessibilityRunAxAudit**](DefaultApi.md#accessibilityrunaxaudit) | **POST** /api/v1/device/{udid}/ax/audit | Run accessibility audit | +| [**AccessibilitySetLocationGpx**](DefaultApi.md#accessibilitysetlocationgpx) | **PUT** /api/v1/device/{udid}/setlocation/gpx | Simulate location from a GPX file | +| [**AccessibilitySetVoiceOver**](DefaultApi.md#accessibilitysetvoiceover) | **PUT** /api/v1/device/{udid}/voiceover | Set VoiceOver state | +| [**AccessibilitySetZoomTouch**](DefaultApi.md#accessibilitysetzoomtouch) | **PUT** /api/v1/device/{udid}/zoom | Set ZoomTouch state | +| [**DevicesActivate**](DefaultApi.md#devicesactivate) | **POST** /api/v1/device/{udid}/activate | Activate device | +| [**DevicesAddProfile**](DefaultApi.md#devicesaddprofile) | **POST** /api/v1/device/{udid}/profiles | Install profile | +| [**DevicesCreateWdaSession**](DefaultApi.md#devicescreatewdasession) | **POST** /api/v1/device/{udid}/wda/session | Start WDA session | +| [**DevicesDeleteWdaSession**](DefaultApi.md#devicesdeletewdasession) | **DELETE** /api/v1/device/{udid}/wda/session/{sessionId} | Stop WDA session | +| [**DevicesDisableCondition**](DefaultApi.md#devicesdisablecondition) | **POST** /api/v1/device/{udid}/disable-condition | Disable condition | +| [**DevicesEnableCondition**](DefaultApi.md#devicesenablecondition) | **PUT** /api/v1/device/{udid}/enable-condition | Enable condition | +| [**DevicesErase**](DefaultApi.md#deviceserase) | **POST** /api/v1/device/{udid}/erase | Erase device | +| [**DevicesGetAssistiveTouch**](DefaultApi.md#devicesgetassistivetouch) | **GET** /api/v1/device/{udid}/assistivetouch | Get AssistiveTouch | +| [**DevicesGetBattery**](DefaultApi.md#devicesgetbattery) | **GET** /api/v1/device/{udid}/battery | Get battery info | +| [**DevicesGetDevMode**](DefaultApi.md#devicesgetdevmode) | **GET** /api/v1/device/{udid}/devmode | Get developer mode | +| [**DevicesGetDeviceDate**](DefaultApi.md#devicesgetdevicedate) | **GET** /api/v1/device/{udid}/date | Get device date | +| [**DevicesGetDeviceName**](DefaultApi.md#devicesgetdevicename) | **GET** /api/v1/device/{udid}/devicename | Get device name | +| [**DevicesGetDiagnostics**](DefaultApi.md#devicesgetdiagnostics) | **GET** /api/v1/device/{udid}/diagnostics | List diagnostics | +| [**DevicesGetIconLayout**](DefaultApi.md#devicesgeticonlayout) | **GET** /api/v1/device/{udid}/icon-layout | Get icon layout | +| [**DevicesGetInfo**](DefaultApi.md#devicesgetinfo) | **GET** /api/v1/device/{udid}/info | Get device info | +| [**DevicesGetJob**](DefaultApi.md#devicesgetjob) | **GET** /api/v1/device/{udid}/jobs/{id} | Get job | +| [**DevicesGetLanguage**](DefaultApi.md#devicesgetlanguage) | **GET** /api/v1/device/{udid}/lang | Get language | +| [**DevicesGetLockdownValues**](DefaultApi.md#devicesgetlockdownvalues) | **GET** /api/v1/device/{udid}/lockdown | Get lockdown values | +| [**DevicesGetMobileGestalt**](DefaultApi.md#devicesgetmobilegestalt) | **GET** /api/v1/device/{udid}/mobilegestalt | Query MobileGestalt | +| [**DevicesGetPasteboard**](DefaultApi.md#devicesgetpasteboard) | **GET** /api/v1/device/{udid}/pasteboard | Get pasteboard | +| [**DevicesGetProcesses**](DefaultApi.md#devicesgetprocesses) | **GET** /api/v1/device/{udid}/processes | List processes | +| [**DevicesGetProfiles**](DefaultApi.md#devicesgetprofiles) | **GET** /api/v1/device/{udid}/profiles | List configuration profiles | +| [**DevicesGetTimeFormat**](DefaultApi.md#devicesgettimeformat) | **GET** /api/v1/device/{udid}/timeformat | Get time format | +| [**DevicesGetWallpaper**](DefaultApi.md#devicesgetwallpaper) | **GET** /api/v1/device/{udid}/wallpaper | Get wallpaper | +| [**DevicesGetWdaSession**](DefaultApi.md#devicesgetwdasession) | **GET** /api/v1/device/{udid}/wda/session/{sessionId} | Get WDA session | +| [**DevicesInstallApp**](DefaultApi.md#devicesinstallapp) | **POST** /api/v1/device/{udid}/apps/install | Install app | +| [**DevicesKillApp**](DefaultApi.md#deviceskillapp) | **POST** /api/v1/device/{udid}/apps/kill | Kill app | +| [**DevicesLaunchApp**](DefaultApi.md#deviceslaunchapp) | **POST** /api/v1/device/{udid}/apps/launch | Launch app | +| [**DevicesListApps**](DefaultApi.md#deviceslistapps) | **GET** /api/v1/device/{udid}/apps/ | List apps | +| [**DevicesListConditions**](DefaultApi.md#deviceslistconditions) | **GET** /api/v1/device/{udid}/conditions | List conditions | +| [**DevicesListCrashes**](DefaultApi.md#deviceslistcrashes) | **GET** /api/v1/device/{udid}/crashes | List crash reports | +| [**DevicesListFiles**](DefaultApi.md#deviceslistfiles) | **GET** /api/v1/device/{udid}/files | List files | +| [**DevicesListImages**](DefaultApi.md#deviceslistimages) | **GET** /api/v1/device/{udid}/image | List mounted developer images | +| [**DevicesListJobs**](DefaultApi.md#deviceslistjobs) | **GET** /api/v1/device/{udid}/jobs | List jobs | +| [**DevicesListMountedImages**](DefaultApi.md#deviceslistmountedimages) | **GET** /api/v1/device/{udid}/image/list | List mounted images | +| [**DevicesMdmClearPasscode**](DefaultApi.md#devicesmdmclearpasscode) | **POST** /api/v1/device/{udid}/mdm/clear-passcode | Clear passcode (supervised) | +| [**DevicesMdmClearScreenTimePassword**](DefaultApi.md#devicesmdmclearscreentimepassword) | **POST** /api/v1/device/{udid}/mdm/clear-screen-time-password | Clear Screen Time password (supervised) | +| [**DevicesMdmFetchUnlockToken**](DefaultApi.md#devicesmdmfetchunlocktoken) | **POST** /api/v1/device/{udid}/mdm/fetch-unlock-token | Fetch unlock token (supervised) | +| [**DevicesMdmSecurityInfo**](DefaultApi.md#devicesmdmsecurityinfo) | **POST** /api/v1/device/{udid}/mdm/security-info | Get MDM security info (supervised) | +| [**DevicesMemLimitOff**](DefaultApi.md#devicesmemlimitoff) | **POST** /api/v1/device/{udid}/memlimitoff | Waive memory limit | +| [**DevicesMountImage**](DefaultApi.md#devicesmountimage) | **PUT** /api/v1/device/{udid}/image | Mount a developer image | +| [**DevicesPair**](DefaultApi.md#devicespair) | **POST** /api/v1/device/{udid}/pair | Pair device | +| [**DevicesPullFile**](DefaultApi.md#devicespullfile) | **GET** /api/v1/device/{udid}/files/pull | Pull file | +| [**DevicesPushFile**](DefaultApi.md#devicespushfile) | **POST** /api/v1/device/{udid}/files/push | Push file | +| [**DevicesReboot**](DefaultApi.md#devicesreboot) | **POST** /api/v1/device/{udid}/reboot | Reboot device | +| [**DevicesRemoveCrashes**](DefaultApi.md#devicesremovecrashes) | **DELETE** /api/v1/device/{udid}/crashes | Delete crash reports | +| [**DevicesRemoveHttpProxy**](DefaultApi.md#devicesremovehttpproxy) | **DELETE** /api/v1/device/{udid}/httpproxy | Remove HTTP proxy | +| [**DevicesRemoveProfile**](DefaultApi.md#devicesremoveprofile) | **DELETE** /api/v1/device/{udid}/profiles/{name} | Remove profile | +| [**DevicesRemoveWifi**](DefaultApi.md#devicesremovewifi) | **DELETE** /api/v1/device/{udid}/wifi | Remove wifi | +| [**DevicesResetAccessibility**](DefaultApi.md#devicesresetaccessibility) | **POST** /api/v1/device/{udid}/resetaccessibility | Reset accessibility | +| [**DevicesResetLocation**](DefaultApi.md#devicesresetlocation) | **POST** /api/v1/device/{udid}/resetlocation | Reset simulated location | +| [**DevicesScreenshot**](DefaultApi.md#devicesscreenshot) | **GET** /api/v1/device/{udid}/screenshot | Capture screenshot | +| [**DevicesSetAssistiveTouch**](DefaultApi.md#devicessetassistivetouch) | **PUT** /api/v1/device/{udid}/assistivetouch | Set AssistiveTouch | +| [**DevicesSetDevMode**](DefaultApi.md#devicessetdevmode) | **POST** /api/v1/device/{udid}/devmode | Set developer mode | +| [**DevicesSetHttpProxy**](DefaultApi.md#devicessethttpproxy) | **PUT** /api/v1/device/{udid}/httpproxy | Set HTTP proxy (supervised) | +| [**DevicesSetIconLayout**](DefaultApi.md#devicesseticonlayout) | **PUT** /api/v1/device/{udid}/icon-layout | Set icon layout | +| [**DevicesSetLanguage**](DefaultApi.md#devicessetlanguage) | **PUT** /api/v1/device/{udid}/lang | Set language | +| [**DevicesSetLocation**](DefaultApi.md#devicessetlocation) | **PUT** /api/v1/device/{udid}/setlocation | Set simulated location | +| [**DevicesSetPasteboard**](DefaultApi.md#devicessetpasteboard) | **PUT** /api/v1/device/{udid}/pasteboard | Set pasteboard | +| [**DevicesSetTimeFormat**](DefaultApi.md#devicessettimeformat) | **PUT** /api/v1/device/{udid}/timeformat | Set time format | +| [**DevicesSetWallpaper**](DefaultApi.md#devicessetwallpaper) | **PUT** /api/v1/device/{udid}/wallpaper | Set wallpaper (supervised) | +| [**DevicesSetWifi**](DefaultApi.md#devicessetwifi) | **PUT** /api/v1/device/{udid}/wifi | Provision wifi | +| [**DevicesShutdown**](DefaultApi.md#devicesshutdown) | **POST** /api/v1/device/{udid}/shutdown | Shut down device | +| [**DevicesStartForward**](DefaultApi.md#devicesstartforward) | **POST** /api/v1/device/{udid}/jobs/forward | Start port forward (job) | +| [**DevicesStartRunTest**](DefaultApi.md#devicesstartruntest) | **POST** /api/v1/device/{udid}/jobs/runtest | Start test run (job) | +| [**DevicesStartRunWda**](DefaultApi.md#devicesstartrunwda) | **POST** /api/v1/device/{udid}/jobs/runwda | Start WDA runner (job) | +| [**DevicesStopJob**](DefaultApi.md#devicesstopjob) | **DELETE** /api/v1/device/{udid}/jobs/{id} | Stop or delete job | +| [**DevicesStreamJobLogs**](DefaultApi.md#devicesstreamjoblogs) | **GET** /api/v1/device/{udid}/jobs/{id}/logs | Stream job logs (SSE) | +| [**DevicesStreamListen**](DefaultApi.md#devicesstreamlisten) | **GET** /api/v1/device/{udid}/listen | Stream device attach/detach (SSE) | +| [**DevicesStreamNotifications**](DefaultApi.md#devicesstreamnotifications) | **GET** /api/v1/device/{udid}/notifications | Stream app-state notifications (SSE) | +| [**DevicesStreamOsTrace**](DefaultApi.md#devicesstreamostrace) | **GET** /api/v1/device/{udid}/ostrace | Stream os_log trace (SSE) | +| [**DevicesStreamSyslog**](DefaultApi.md#devicesstreamsyslog) | **GET** /api/v1/device/{udid}/syslog | Stream syslog (SSE) | +| [**DevicesStreamSysmontap**](DefaultApi.md#devicesstreamsysmontap) | **GET** /api/v1/device/{udid}/sysmontap | Stream CPU usage (SSE) | +| [**DevicesUninstallApp**](DefaultApi.md#devicesuninstallapp) | **POST** /api/v1/device/{udid}/apps/uninstall | Uninstall app | +| [**DevicesUnmountImage**](DefaultApi.md#devicesunmountimage) | **DELETE** /api/v1/device/{udid}/image | Unmount developer image | +| [**DiagnosticsNetGetBatteryRegistry**](DefaultApi.md#diagnosticsnetgetbatteryregistry) | **GET** /api/v1/device/{udid}/battery/registry | Get battery IORegistry | +| [**DiagnosticsNetGetDeviceIp**](DefaultApi.md#diagnosticsnetgetdeviceip) | **GET** /api/v1/device/{udid}/ip | Get device IP / network info | +| [**DiagnosticsNetGetDiskSpace**](DefaultApi.md#diagnosticsnetgetdiskspace) | **GET** /api/v1/device/{udid}/diskspace | Get disk space info | +| [**DiagnosticsNetGetRsdServices**](DefaultApi.md#diagnosticsnetgetrsdservices) | **GET** /api/v1/device/{udid}/rsd | Get RSD service list | +| [**FsyncFsyncLs**](DefaultApi.md#fsyncfsyncls) | **GET** /api/v1/device/{udid}/fsync/ls | List a directory over AFC | +| [**FsyncFsyncMkdir**](DefaultApi.md#fsyncfsyncmkdir) | **POST** /api/v1/device/{udid}/fsync/mkdir | Create a directory over AFC | +| [**FsyncFsyncPull**](DefaultApi.md#fsyncfsyncpull) | **GET** /api/v1/device/{udid}/fsync/pull | Download a file over AFC | +| [**FsyncFsyncPush**](DefaultApi.md#fsyncfsyncpush) | **POST** /api/v1/device/{udid}/fsync/push | Upload a file over AFC | +| [**FsyncFsyncRm**](DefaultApi.md#fsyncfsyncrm) | **DELETE** /api/v1/device/{udid}/fsync/rm | Remove a file or directory over AFC | +| [**FsyncFsyncTree**](DefaultApi.md#fsyncfsynctree) | **GET** /api/v1/device/{udid}/fsync/tree | Recursively list a directory over AFC | +| [**FsyncGetCloudConfig**](DefaultApi.md#fsyncgetcloudconfig) | **GET** /api/v1/device/{udid}/cloudconfig | Get device cloud configuration | +| [**GetPrepareSkipOptions**](DefaultApi.md#getprepareskipoptions) | **GET** /api/v1/prepare/skip-options | List setup skip options | +| [**ListDevices**](DefaultApi.md#listdevices) | **GET** /api/v1/list | List devices | +| [**ListTunnels**](DefaultApi.md#listtunnels) | **GET** /api/v1/tunnels | List tunnels | +| [**PrepareCreateCert**](DefaultApi.md#preparecreatecert) | **POST** /api/v1/prepare/create-cert | Generate a supervision certificate | +| [**PreparePrepareDevice**](DefaultApi.md#preparepreparedevice) | **POST** /api/v1/device/{udid}/prepare | Prepare (and optionally supervise) a device | +| [**RefreshTunnel**](DefaultApi.md#refreshtunnel) | **POST** /api/v1/tunnels/{udid}/refresh | Refresh tunnel | +| [**ShutdownTunnelAgent**](DefaultApi.md#shutdowntunnelagent) | **POST** /api/v1/tunnel-agent/shutdown | Shut down tunnel agent | +| [**SignApp**](DefaultApi.md#signapp) | **POST** /api/v1/sign/app | Resign an app/IPA | +| [**SignCertificate**](DefaultApi.md#signcertificate) | **POST** /api/v1/sign/certificate | Create a signing certificate | +| [**SignProvision**](DefaultApi.md#signprovision) | **POST** /api/v1/sign/provision | Create a provisioning profile + P12 | +| [**StopTunnel**](DefaultApi.md#stoptunnel) | **DELETE** /api/v1/tunnels/{udid} | Stop tunnel | +| [**StreamsPcap**](DefaultApi.md#streamspcap) | **GET** /api/v1/device/{udid}/pcap | Stream a live pcap capture (binary) | +| [**StreamsScreenshotStream**](DefaultApi.md#streamsscreenshotstream) | **GET** /api/v1/device/{udid}/screenshot/stream | Stream screenshots as MJPEG (binary) | +| [**StreamsUiStream**](DefaultApi.md#streamsuistream) | **GET** /api/v1/device/{udid}/ui/stream | Stream UI video (binary) | +| [**UIUiApi**](DefaultApi.md#uiuiapi) | **POST** /api/v1/device/{udid}/ui/api | Raw backend passthrough | +| [**UIUiAppForeground**](DefaultApi.md#uiuiappforeground) | **POST** /api/v1/device/{udid}/ui/app/foreground | Foreground app (UI backend) | +| [**UIUiAppLaunch**](DefaultApi.md#uiuiapplaunch) | **POST** /api/v1/device/{udid}/ui/app/launch | Launch app (UI backend) | +| [**UIUiAppTerminate**](DefaultApi.md#uiuiappterminate) | **POST** /api/v1/device/{udid}/ui/app/terminate | Terminate app (UI backend) | +| [**UIUiButton**](DefaultApi.md#uiuibutton) | **POST** /api/v1/device/{udid}/ui/button | Press hardware button | +| [**UIUiGetOrientation**](DefaultApi.md#uiuigetorientation) | **GET** /api/v1/device/{udid}/ui/orientation | Get orientation | +| [**UIUiLongPress**](DefaultApi.md#uiuilongpress) | **POST** /api/v1/device/{udid}/ui/longpress | Long press | +| [**UIUiScreenshot**](DefaultApi.md#uiuiscreenshot) | **GET** /api/v1/device/{udid}/ui/screenshot | UI screenshot (PNG) | +| [**UIUiSetOrientation**](DefaultApi.md#uiuisetorientation) | **PUT** /api/v1/device/{udid}/ui/orientation | Set orientation | +| [**UIUiSource**](DefaultApi.md#uiuisource) | **GET** /api/v1/device/{udid}/ui/source | UI source hierarchy | +| [**UIUiStatus**](DefaultApi.md#uiuistatus) | **GET** /api/v1/device/{udid}/ui/status | UI backend status | +| [**UIUiSwipe**](DefaultApi.md#uiuiswipe) | **POST** /api/v1/device/{udid}/ui/swipe | Swipe | +| [**UIUiTap**](DefaultApi.md#uiuitap) | **POST** /api/v1/device/{udid}/ui/tap | Tap | +| [**UIUiType**](DefaultApi.md#uiuitype) | **POST** /api/v1/device/{udid}/ui/type | Type text | +| [**UIUiWindowSize**](DefaultApi.md#uiuiwindowsize) | **GET** /api/v1/device/{udid}/ui/size | UI window size | +| [**WebInspectorWebInspectorEval**](DefaultApi.md#webinspectorwebinspectoreval) | **POST** /api/v1/device/{udid}/webinspector/eval | Evaluate JavaScript in a page | +| [**WebInspectorWebInspectorLaunch**](DefaultApi.md#webinspectorwebinspectorlaunch) | **POST** /api/v1/device/{udid}/webinspector/launch | Open a URL in a new inspectable page | +| [**WebInspectorWebInspectorPages**](DefaultApi.md#webinspectorwebinspectorpages) | **GET** /api/v1/device/{udid}/webinspector/pages | List inspectable pages | + + +# **AccessibilityGetAxSnapshot** +> Object AccessibilityGetAxSnapshot (string udid) + +Get accessibility element snapshot + +Get a snapshot of the currently focused accessibility element (CLI: `ios ax`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class AccessibilityGetAxSnapshotExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Get accessibility element snapshot + Object result = apiInstance.AccessibilityGetAxSnapshot(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.AccessibilityGetAxSnapshot: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the AccessibilityGetAxSnapshotWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get accessibility element snapshot + ApiResponse response = apiInstance.AccessibilityGetAxSnapshotWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.AccessibilityGetAxSnapshotWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **AccessibilityGetVoiceOver** +> VoiceOverState AccessibilityGetVoiceOver (string udid) + +Get VoiceOver state + +Get VoiceOver enabled state (CLI: `ios voiceover get`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class AccessibilityGetVoiceOverExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Get VoiceOver state + VoiceOverState result = apiInstance.AccessibilityGetVoiceOver(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.AccessibilityGetVoiceOver: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the AccessibilityGetVoiceOverWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get VoiceOver state + ApiResponse response = apiInstance.AccessibilityGetVoiceOverWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.AccessibilityGetVoiceOverWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +[**VoiceOverState**](VoiceOverState.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **AccessibilityGetZoomTouch** +> ZoomTouchState AccessibilityGetZoomTouch (string udid) + +Get ZoomTouch state + +Get ZoomTouch enabled state (CLI: `ios zoomtouch get`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class AccessibilityGetZoomTouchExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Get ZoomTouch state + ZoomTouchState result = apiInstance.AccessibilityGetZoomTouch(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.AccessibilityGetZoomTouch: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the AccessibilityGetZoomTouchWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get ZoomTouch state + ApiResponse response = apiInstance.AccessibilityGetZoomTouchWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.AccessibilityGetZoomTouchWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +[**ZoomTouchState**](ZoomTouchState.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **AccessibilityRunAxAudit** +> List<Object> AccessibilityRunAxAudit (string udid, int? timeout = null) + +Run accessibility audit + +Run the accessibility audit against the focused app and return the issues found (CLI: `ios ax audit`). Bounded by `timeout` (seconds, default 60). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class AccessibilityRunAxAuditExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var timeout = 56; // int? | Audit timeout in seconds (default 60). (optional) + + try + { + // Run accessibility audit + List result = apiInstance.AccessibilityRunAxAudit(udid, timeout); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.AccessibilityRunAxAudit: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the AccessibilityRunAxAuditWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Run accessibility audit + ApiResponse> response = apiInstance.AccessibilityRunAxAuditWithHttpInfo(udid, timeout); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.AccessibilityRunAxAuditWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **timeout** | **int?** | Audit timeout in seconds (default 60). | [optional] | + +### Return type + +**List** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **AccessibilitySetLocationGpx** +> GenericResponse AccessibilitySetLocationGpx (string udid, Object gpx) + +Simulate location from a GPX file + +Simulate live location tracking from an uploaded GPX file (CLI: `ios setlocationgpx`). Send multipart/form-data with a `gpx` file. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class AccessibilitySetLocationGpxExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var gpx = new Object(); // Object | + + try + { + // Simulate location from a GPX file + GenericResponse result = apiInstance.AccessibilitySetLocationGpx(udid, gpx); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.AccessibilitySetLocationGpx: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the AccessibilitySetLocationGpxWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Simulate location from a GPX file + ApiResponse response = apiInstance.AccessibilitySetLocationGpxWithHttpInfo(udid, gpx); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.AccessibilitySetLocationGpxWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **gpx** | [**Object**](Object.md) | | | + +### Return type + +[**GenericResponse**](GenericResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **AccessibilitySetVoiceOver** +> VoiceOverState AccessibilitySetVoiceOver (string udid, bool? enabled = null, AXEnabledRequest? aXEnabledRequest = null) + +Set VoiceOver state + +Enable/disable VoiceOver (CLI: `ios voiceover enable|disable`). The desired state comes from the JSON body or the `enabled` query param. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class AccessibilitySetVoiceOverExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var enabled = true; // bool? | Desired state (alternative to the request body). (optional) + var aXEnabledRequest = new AXEnabledRequest?(); // AXEnabledRequest? | (optional) + + try + { + // Set VoiceOver state + VoiceOverState result = apiInstance.AccessibilitySetVoiceOver(udid, enabled, aXEnabledRequest); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.AccessibilitySetVoiceOver: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the AccessibilitySetVoiceOverWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Set VoiceOver state + ApiResponse response = apiInstance.AccessibilitySetVoiceOverWithHttpInfo(udid, enabled, aXEnabledRequest); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.AccessibilitySetVoiceOverWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **enabled** | **bool?** | Desired state (alternative to the request body). | [optional] | +| **aXEnabledRequest** | [**AXEnabledRequest?**](AXEnabledRequest?.md) | | [optional] | + +### Return type + +[**VoiceOverState**](VoiceOverState.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **AccessibilitySetZoomTouch** +> ZoomTouchState AccessibilitySetZoomTouch (string udid, bool? enabled = null, AXEnabledRequest? aXEnabledRequest = null) + +Set ZoomTouch state + +Enable/disable ZoomTouch (CLI: `ios zoomtouch enable|disable`). The desired state comes from the JSON body or the `enabled` query param. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class AccessibilitySetZoomTouchExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var enabled = true; // bool? | Desired state (alternative to the request body). (optional) + var aXEnabledRequest = new AXEnabledRequest?(); // AXEnabledRequest? | (optional) + + try + { + // Set ZoomTouch state + ZoomTouchState result = apiInstance.AccessibilitySetZoomTouch(udid, enabled, aXEnabledRequest); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.AccessibilitySetZoomTouch: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the AccessibilitySetZoomTouchWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Set ZoomTouch state + ApiResponse response = apiInstance.AccessibilitySetZoomTouchWithHttpInfo(udid, enabled, aXEnabledRequest); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.AccessibilitySetZoomTouchWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **enabled** | **bool?** | Desired state (alternative to the request body). | [optional] | +| **aXEnabledRequest** | [**AXEnabledRequest?**](AXEnabledRequest?.md) | | [optional] | + +### Return type + +[**ZoomTouchState**](ZoomTouchState.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesActivate** +> GenericResponse DevicesActivate (string udid) + +Activate device + +Activate the device (complete Setup Assistant / activation). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesActivateExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Activate device + GenericResponse result = apiInstance.DevicesActivate(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesActivate: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesActivateWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Activate device + ApiResponse response = apiInstance.DevicesActivateWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesActivateWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +[**GenericResponse**](GenericResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesAddProfile** +> GenericResponse DevicesAddProfile (string udid, Object profile, Object? p12 = null, string? password = null) + +Install profile + +Install a configuration profile (CLI: `ios profile add`). Send the profile as the raw request body, or as multipart with a `profile` file plus an optional `p12` supervisor identity and `password` for a supervised install. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesAddProfileExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var profile = new Object(); // Object | + var p12 = new Object?(); // Object? | (optional) + var password = "password_example"; // string? | Passphrase for the `.p12` identity. (optional) + + try + { + // Install profile + GenericResponse result = apiInstance.DevicesAddProfile(udid, profile, p12, password); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesAddProfile: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesAddProfileWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Install profile + ApiResponse response = apiInstance.DevicesAddProfileWithHttpInfo(udid, profile, p12, password); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesAddProfileWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **profile** | [**Object**](Object.md) | | | +| **p12** | [**Object?**](Object?.md) | | [optional] | +| **password** | **string?** | Passphrase for the `.p12` identity. | [optional] | + +### Return type + +[**GenericResponse**](GenericResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesCreateWdaSession** +> WdaSession DevicesCreateWdaSession (string udid, WdaConfig wdaConfig) + +Start WDA session + +Start a WebDriverAgent (XCUITest) session. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesCreateWdaSessionExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var wdaConfig = new WdaConfig(); // WdaConfig | + + try + { + // Start WDA session + WdaSession result = apiInstance.DevicesCreateWdaSession(udid, wdaConfig); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesCreateWdaSession: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesCreateWdaSessionWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Start WDA session + ApiResponse response = apiInstance.DevicesCreateWdaSessionWithHttpInfo(udid, wdaConfig); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesCreateWdaSessionWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **wdaConfig** | [**WdaConfig**](WdaConfig.md) | | | + +### Return type + +[**WdaSession**](WdaSession.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesDeleteWdaSession** +> WdaSession DevicesDeleteWdaSession (string udid, string sessionId) + +Stop WDA session + +Stop a running WebDriverAgent session. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesDeleteWdaSessionExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var sessionId = "sessionId_example"; // string | The WDA session id. + + try + { + // Stop WDA session + WdaSession result = apiInstance.DevicesDeleteWdaSession(udid, sessionId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesDeleteWdaSession: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesDeleteWdaSessionWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Stop WDA session + ApiResponse response = apiInstance.DevicesDeleteWdaSessionWithHttpInfo(udid, sessionId); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesDeleteWdaSessionWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **sessionId** | **string** | The WDA session id. | | + +### Return type + +[**WdaSession**](WdaSession.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — WDA session id not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesDisableCondition** +> GenericResponse DevicesDisableCondition (string udid) + +Disable condition + +Disable the currently active condition inducer profile. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesDisableConditionExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Disable condition + GenericResponse result = apiInstance.DevicesDisableCondition(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesDisableCondition: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesDisableConditionWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Disable condition + ApiResponse response = apiInstance.DevicesDisableConditionWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesDisableConditionWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +[**GenericResponse**](GenericResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesEnableCondition** +> GenericResponse DevicesEnableCondition (string udid, string profileTypeID, string profileID) + +Enable condition + +Enable a condition inducer profile. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesEnableConditionExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var profileTypeID = "profileTypeID_example"; // string | Identifier of the condition profile type. + var profileID = "profileID_example"; // string | Identifier of the specific profile to activate. + + try + { + // Enable condition + GenericResponse result = apiInstance.DevicesEnableCondition(udid, profileTypeID, profileID); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesEnableCondition: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesEnableConditionWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Enable condition + ApiResponse response = apiInstance.DevicesEnableConditionWithHttpInfo(udid, profileTypeID, profileID); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesEnableConditionWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **profileTypeID** | **string** | Identifier of the condition profile type. | | +| **profileID** | **string** | Identifier of the specific profile to activate. | | + +### Return type + +[**GenericResponse**](GenericResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesErase** +> GenericResponse DevicesErase (string udid, bool confirm) + +Erase device + +Erase all content and settings (CLI: `ios erase`). Destructive: requires `confirm=true`. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesEraseExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var confirm = true; // bool | Must be `true` to proceed with the destructive erase. + + try + { + // Erase device + GenericResponse result = apiInstance.DevicesErase(udid, confirm); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesErase: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesEraseWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Erase device + ApiResponse response = apiInstance.DevicesEraseWithHttpInfo(udid, confirm); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesEraseWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **confirm** | **bool** | Must be `true` to proceed with the destructive erase. | | + +### Return type + +[**GenericResponse**](GenericResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesGetAssistiveTouch** +> AssistiveTouchState DevicesGetAssistiveTouch (string udid) + +Get AssistiveTouch + +Get AssistiveTouch state (CLI: `ios assistivetouch get`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesGetAssistiveTouchExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Get AssistiveTouch + AssistiveTouchState result = apiInstance.DevicesGetAssistiveTouch(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesGetAssistiveTouch: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesGetAssistiveTouchWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get AssistiveTouch + ApiResponse response = apiInstance.DevicesGetAssistiveTouchWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesGetAssistiveTouchWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +[**AssistiveTouchState**](AssistiveTouchState.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesGetBattery** +> BatteryInfo DevicesGetBattery (string udid) + +Get battery info + +Get battery diagnostics (CLI: `ios batterycheck`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesGetBatteryExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Get battery info + BatteryInfo result = apiInstance.DevicesGetBattery(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesGetBattery: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesGetBatteryWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get battery info + ApiResponse response = apiInstance.DevicesGetBatteryWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesGetBatteryWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +[**BatteryInfo**](BatteryInfo.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesGetDevMode** +> DevModeState DevicesGetDevMode (string udid) + +Get developer mode + +Get developer mode state (CLI: `ios devmode get`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesGetDevModeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Get developer mode + DevModeState result = apiInstance.DevicesGetDevMode(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesGetDevMode: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesGetDevModeWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get developer mode + ApiResponse response = apiInstance.DevicesGetDevModeWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesGetDevModeWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +[**DevModeState**](DevModeState.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesGetDeviceDate** +> DeviceDate DevicesGetDeviceDate (string udid) + +Get device date + +Get the device clock (CLI: `ios date`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesGetDeviceDateExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Get device date + DeviceDate result = apiInstance.DevicesGetDeviceDate(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesGetDeviceDate: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesGetDeviceDateWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get device date + ApiResponse response = apiInstance.DevicesGetDeviceDateWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesGetDeviceDateWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +[**DeviceDate**](DeviceDate.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesGetDeviceName** +> DeviceName DevicesGetDeviceName (string udid) + +Get device name + +Get the device name (CLI: `ios devicename`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesGetDeviceNameExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Get device name + DeviceName result = apiInstance.DevicesGetDeviceName(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesGetDeviceName: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesGetDeviceNameWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get device name + ApiResponse response = apiInstance.DevicesGetDeviceNameWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesGetDeviceNameWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +[**DeviceName**](DeviceName.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesGetDiagnostics** +> Object DevicesGetDiagnostics (string udid) + +List diagnostics + +List all IORegistry/diagnostic values (CLI: `ios diagnostics list`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesGetDiagnosticsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // List diagnostics + Object result = apiInstance.DevicesGetDiagnostics(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesGetDiagnostics: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesGetDiagnosticsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // List diagnostics + ApiResponse response = apiInstance.DevicesGetDiagnosticsWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesGetDiagnosticsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesGetIconLayout** +> Object DevicesGetIconLayout (string udid) + +Get icon layout + +Get the SpringBoard icon layout (CLI: `ios get-icon-layout`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesGetIconLayoutExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Get icon layout + Object result = apiInstance.DevicesGetIconLayout(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesGetIconLayout: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesGetIconLayoutWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get icon layout + ApiResponse response = apiInstance.DevicesGetIconLayoutWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesGetIconLayoutWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesGetInfo** +> Object DevicesGetInfo (string udid) + +Get device info + +Get lockdown values plus `instruments:*` keys for the device. Returns an open dictionary of heterogeneous values. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesGetInfoExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Get device info + Object result = apiInstance.DevicesGetInfo(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesGetInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesGetInfoWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get device info + ApiResponse response = apiInstance.DevicesGetInfoWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesGetInfoWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesGetJob** +> Job DevicesGetJob (string udid, string id) + +Get job + +Get a job's status. Returns `404` for an unknown job on this device. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesGetJobExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var id = "id_example"; // string | The job id. + + try + { + // Get job + Job result = apiInstance.DevicesGetJob(udid, id); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesGetJob: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesGetJobWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get job + ApiResponse response = apiInstance.DevicesGetJobWithHttpInfo(udid, id); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesGetJobWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **id** | **string** | The job id. | | + +### Return type + +[**Job**](Job.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — the requested resource (e.g. a job) was not found for this device. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesGetLanguage** +> LanguageConfiguration DevicesGetLanguage (string udid) + +Get language + +Get the device language/locale configuration (CLI: `ios lang`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesGetLanguageExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Get language + LanguageConfiguration result = apiInstance.DevicesGetLanguage(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesGetLanguage: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesGetLanguageWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get language + ApiResponse response = apiInstance.DevicesGetLanguageWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesGetLanguageWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +[**LanguageConfiguration**](LanguageConfiguration.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesGetLockdownValues** +> Object DevicesGetLockdownValues (string udid, string? domain = null) + +Get lockdown values + +Get lockdown values (CLI: `ios lockdown get`). Without `domain` the full set is returned; with `domain` the values are scoped to that lockdown domain. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesGetLockdownValuesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var domain = "domain_example"; // string? | Optional lockdown domain to scope the returned values. (optional) + + try + { + // Get lockdown values + Object result = apiInstance.DevicesGetLockdownValues(udid, domain); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesGetLockdownValues: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesGetLockdownValuesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get lockdown values + ApiResponse response = apiInstance.DevicesGetLockdownValuesWithHttpInfo(udid, domain); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesGetLockdownValuesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **domain** | **string?** | Optional lockdown domain to scope the returned values. | [optional] | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesGetMobileGestalt** +> Object DevicesGetMobileGestalt (string udid, List key) + +Query MobileGestalt + +Query one or more MobileGestalt keys (CLI: `ios mobilegestalt ...`). Pass repeated `key` query params. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesGetMobileGestaltExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var key = new List(); // List | One or more MobileGestalt keys to query. + + try + { + // Query MobileGestalt + Object result = apiInstance.DevicesGetMobileGestalt(udid, key); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesGetMobileGestalt: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesGetMobileGestaltWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Query MobileGestalt + ApiResponse response = apiInstance.DevicesGetMobileGestaltWithHttpInfo(udid, key); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesGetMobileGestaltWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **key** | [**List<string>**](string.md) | One or more MobileGestalt keys to query. | | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesGetPasteboard** +> PasteboardContent DevicesGetPasteboard (string udid) + +Get pasteboard + +Get the pasteboard (clipboard) text (CLI: `ios pasteboard get`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesGetPasteboardExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Get pasteboard + PasteboardContent result = apiInstance.DevicesGetPasteboard(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesGetPasteboard: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesGetPasteboardWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get pasteboard + ApiResponse response = apiInstance.DevicesGetPasteboardWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesGetPasteboardWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +[**PasteboardContent**](PasteboardContent.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesGetProcesses** +> List<ProcessInfo> DevicesGetProcesses (string udid, bool? apps = null) + +List processes + +List running processes (CLI: `ios ps [- -apps]`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesGetProcessesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var apps = true; // bool? | Only return application processes. (optional) + + try + { + // List processes + List result = apiInstance.DevicesGetProcesses(udid, apps); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesGetProcesses: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesGetProcessesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // List processes + ApiResponse> response = apiInstance.DevicesGetProcessesWithHttpInfo(udid, apps); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesGetProcessesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **apps** | **bool?** | Only return application processes. | [optional] | + +### Return type + +[**List<ProcessInfo>**](ProcessInfo.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesGetProfiles** +> Object DevicesGetProfiles (string udid) + +List configuration profiles + +List installed configuration profiles. Returns an open dictionary. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesGetProfilesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // List configuration profiles + Object result = apiInstance.DevicesGetProfiles(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesGetProfiles: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesGetProfilesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // List configuration profiles + ApiResponse response = apiInstance.DevicesGetProfilesWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesGetProfilesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesGetTimeFormat** +> TimeFormatState DevicesGetTimeFormat (string udid) + +Get time format + +Get the 24-hour clock state (CLI: `ios timeformat get`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesGetTimeFormatExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Get time format + TimeFormatState result = apiInstance.DevicesGetTimeFormat(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesGetTimeFormat: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesGetTimeFormatWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get time format + ApiResponse response = apiInstance.DevicesGetTimeFormatWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesGetTimeFormatWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +[**TimeFormatState**](TimeFormatState.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesGetWallpaper** +> Object DevicesGetWallpaper (string udid) + +Get wallpaper + +Get the home-screen wallpaper as PNG (CLI: `ios get-wallpaper`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesGetWallpaperExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Get wallpaper + Object result = apiInstance.DevicesGetWallpaper(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesGetWallpaper: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesGetWallpaperWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get wallpaper + ApiResponse response = apiInstance.DevicesGetWallpaperWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesGetWallpaperWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: image/png, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesGetWdaSession** +> WdaSession DevicesGetWdaSession (string udid, string sessionId) + +Get WDA session + +Get a running WebDriverAgent session. Returns `404` for an unknown session. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesGetWdaSessionExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var sessionId = "sessionId_example"; // string | The WDA session id. + + try + { + // Get WDA session + WdaSession result = apiInstance.DevicesGetWdaSession(udid, sessionId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesGetWdaSession: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesGetWdaSessionWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get WDA session + ApiResponse response = apiInstance.DevicesGetWdaSessionWithHttpInfo(udid, sessionId); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesGetWdaSessionWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **sessionId** | **string** | The WDA session id. | | + +### Return type + +[**WdaSession**](WdaSession.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — WDA session id not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesInstallApp** +> GenericResponse DevicesInstallApp (string udid, Object file) + +Install app + +Install an application from an uploaded `.ipa`/`.app` archive. The multipart `file` part must be 1 byte–200 MB. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesInstallAppExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var file = new Object(); // Object | + + try + { + // Install app + GenericResponse result = apiInstance.DevicesInstallApp(udid, file); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesInstallApp: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesInstallAppWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Install app + ApiResponse response = apiInstance.DevicesInstallAppWithHttpInfo(udid, file); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesInstallAppWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **file** | [**Object**](Object.md) | | | + +### Return type + +[**GenericResponse**](GenericResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesKillApp** +> GenericResponse DevicesKillApp (string udid, string bundleID) + +Kill app + +Kill a running application by bundle id. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesKillAppExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var bundleID = "bundleID_example"; // string | Bundle id of the app to kill. + + try + { + // Kill app + GenericResponse result = apiInstance.DevicesKillApp(udid, bundleID); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesKillApp: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesKillAppWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Kill app + ApiResponse response = apiInstance.DevicesKillAppWithHttpInfo(udid, bundleID); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesKillAppWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **bundleID** | **string** | Bundle id of the app to kill. | | + +### Return type + +[**GenericResponse**](GenericResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesLaunchApp** +> GenericResponse DevicesLaunchApp (string udid, string bundleID) + +Launch app + +Launch an application by bundle id. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesLaunchAppExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var bundleID = "bundleID_example"; // string | Bundle id of the app to launch. + + try + { + // Launch app + GenericResponse result = apiInstance.DevicesLaunchApp(udid, bundleID); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesLaunchApp: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesLaunchAppWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Launch app + ApiResponse response = apiInstance.DevicesLaunchAppWithHttpInfo(udid, bundleID); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesLaunchAppWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **bundleID** | **string** | Bundle id of the app to launch. | | + +### Return type + +[**GenericResponse**](GenericResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesListApps** +> List<AppInfo> DevicesListApps (string udid) + +List apps + +List installed applications. Each entry is an open Info.plist map. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesListAppsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // List apps + List result = apiInstance.DevicesListApps(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesListApps: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesListAppsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // List apps + ApiResponse> response = apiInstance.DevicesListAppsWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesListAppsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +[**List<AppInfo>**](AppInfo.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesListConditions** +> List<ProfileType> DevicesListConditions (string udid) + +List conditions + +List available condition inducer profile types. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesListConditionsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // List conditions + List result = apiInstance.DevicesListConditions(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesListConditions: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesListConditionsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // List conditions + ApiResponse> response = apiInstance.DevicesListConditionsWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesListConditionsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +[**List<ProfileType>**](ProfileType.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesListCrashes** +> CrashListing DevicesListCrashes (string udid, string? pattern = null) + +List crash reports + +List crash reports (CLI: `ios crash ls`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesListCrashesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var pattern = "pattern_example"; // string? | Optional glob pattern to filter reports. (optional) + + try + { + // List crash reports + CrashListing result = apiInstance.DevicesListCrashes(udid, pattern); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesListCrashes: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesListCrashesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // List crash reports + ApiResponse response = apiInstance.DevicesListCrashesWithHttpInfo(udid, pattern); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesListCrashesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **pattern** | **string?** | Optional glob pattern to filter reports. | [optional] | + +### Return type + +[**CrashListing**](CrashListing.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesListFiles** +> FileListing DevicesListFiles (string udid, FileDomain domain, string? identifier = null, string? path = null) + +List files + +List a device directory (CLI: `ios file ls`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesListFilesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var domain = new FileDomain(); // FileDomain | File service domain: `app`, `app-group`, `crash` or `temp`. + var identifier = "identifier_example"; // string? | Bundle/group id for the `app`/`app-group` domains. (optional) + var path = "path_example"; // string? | Directory path to list (defaults to `.`). (optional) + + try + { + // List files + FileListing result = apiInstance.DevicesListFiles(udid, domain, identifier, path); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesListFiles: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesListFilesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // List files + ApiResponse response = apiInstance.DevicesListFilesWithHttpInfo(udid, domain, identifier, path); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesListFilesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **domain** | [**FileDomain**](FileDomain.md) | File service domain: `app`, `app-group`, `crash` or `temp`. | | +| **identifier** | **string?** | Bundle/group id for the `app`/`app-group` domains. | [optional] | +| **path** | **string?** | Directory path to list (defaults to `.`). | [optional] | + +### Return type + +[**FileListing**](FileListing.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesListImages** +> List<string> DevicesListImages (string udid) + +List mounted developer images + +List the hex signatures of Developer Disk Images mounted on the device. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesListImagesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // List mounted developer images + List result = apiInstance.DevicesListImages(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesListImages: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesListImagesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // List mounted developer images + ApiResponse> response = apiInstance.DevicesListImagesWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesListImagesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +**List** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesListJobs** +> List<Job> DevicesListJobs (string udid) + +List jobs + +List jobs for a device. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesListJobsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // List jobs + List result = apiInstance.DevicesListJobs(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesListJobs: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesListJobsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // List jobs + ApiResponse> response = apiInstance.DevicesListJobsWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesListJobsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +[**List<Job>**](Job.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesListMountedImages** +> MountedImages DevicesListMountedImages (string udid) + +List mounted images + +List mounted developer image signatures (CLI: `ios image list`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesListMountedImagesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // List mounted images + MountedImages result = apiInstance.DevicesListMountedImages(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesListMountedImages: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesListMountedImagesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // List mounted images + ApiResponse response = apiInstance.DevicesListMountedImagesWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesListMountedImagesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +[**MountedImages**](MountedImages.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesMdmClearPasscode** +> StatusOk DevicesMdmClearPasscode (string udid, Object p12, string token, string? password = null) + +Clear passcode (supervised) + +Clear the device passcode (CLI: `ios mdm clear-passcode`). Requires the base64 unlock token as an additional `token` form field. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesMdmClearPasscodeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var p12 = new Object(); // Object | + var token = "token_example"; // string | Base64-encoded escrow unlock token. + var password = "password_example"; // string? | Passphrase for the `.p12` identity. (optional) + + try + { + // Clear passcode (supervised) + StatusOk result = apiInstance.DevicesMdmClearPasscode(udid, p12, token, password); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesMdmClearPasscode: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesMdmClearPasscodeWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Clear passcode (supervised) + ApiResponse response = apiInstance.DevicesMdmClearPasscodeWithHttpInfo(udid, p12, token, password); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesMdmClearPasscodeWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **p12** | [**Object**](Object.md) | | | +| **token** | **string** | Base64-encoded escrow unlock token. | | +| **password** | **string?** | Passphrase for the `.p12` identity. | [optional] | + +### Return type + +[**StatusOk**](StatusOk.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesMdmClearScreenTimePassword** +> StatusOk DevicesMdmClearScreenTimePassword (string udid, Object p12, string? password = null) + +Clear Screen Time password (supervised) + +Clear the Screen Time password (CLI: `ios mdm clear-screen-time-password`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesMdmClearScreenTimePasswordExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var p12 = new Object(); // Object | + var password = "password_example"; // string? | Passphrase for the `.p12` identity. (optional) + + try + { + // Clear Screen Time password (supervised) + StatusOk result = apiInstance.DevicesMdmClearScreenTimePassword(udid, p12, password); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesMdmClearScreenTimePassword: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesMdmClearScreenTimePasswordWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Clear Screen Time password (supervised) + ApiResponse response = apiInstance.DevicesMdmClearScreenTimePasswordWithHttpInfo(udid, p12, password); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesMdmClearScreenTimePasswordWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **p12** | [**Object**](Object.md) | | | +| **password** | **string?** | Passphrase for the `.p12` identity. | [optional] | + +### Return type + +[**StatusOk**](StatusOk.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesMdmFetchUnlockToken** +> UnlockToken DevicesMdmFetchUnlockToken (string udid, Object p12, string? password = null) + +Fetch unlock token (supervised) + +Fetch the escrow unlock token, base64-encoded (CLI: `ios mdm fetch-unlock-token`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesMdmFetchUnlockTokenExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var p12 = new Object(); // Object | + var password = "password_example"; // string? | Passphrase for the `.p12` identity. (optional) + + try + { + // Fetch unlock token (supervised) + UnlockToken result = apiInstance.DevicesMdmFetchUnlockToken(udid, p12, password); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesMdmFetchUnlockToken: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesMdmFetchUnlockTokenWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Fetch unlock token (supervised) + ApiResponse response = apiInstance.DevicesMdmFetchUnlockTokenWithHttpInfo(udid, p12, password); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesMdmFetchUnlockTokenWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **p12** | [**Object**](Object.md) | | | +| **password** | **string?** | Passphrase for the `.p12` identity. | [optional] | + +### Return type + +[**UnlockToken**](UnlockToken.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesMdmSecurityInfo** +> Object DevicesMdmSecurityInfo (string udid, Object p12, string? password = null) + +Get MDM security info (supervised) + +Get device security info (CLI: `ios mdm security-info`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesMdmSecurityInfoExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var p12 = new Object(); // Object | + var password = "password_example"; // string? | Passphrase for the `.p12` identity. (optional) + + try + { + // Get MDM security info (supervised) + Object result = apiInstance.DevicesMdmSecurityInfo(udid, p12, password); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesMdmSecurityInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesMdmSecurityInfoWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get MDM security info (supervised) + ApiResponse response = apiInstance.DevicesMdmSecurityInfoWithHttpInfo(udid, p12, password); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesMdmSecurityInfoWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **p12** | [**Object**](Object.md) | | | +| **password** | **string?** | Passphrase for the `.p12` identity. | [optional] | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesMemLimitOff** +> MemLimitResult DevicesMemLimitOff (string udid, string? process = null, MemLimitRequest? memLimitRequest = null) + +Waive memory limit + +Waive the memory limit for a process (CLI: `ios memlimitoff`). The process name may be given via the `process` query param or the JSON body. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesMemLimitOffExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var process = "process_example"; // string? | Process name whose memory limit should be waived. (optional) + var memLimitRequest = new MemLimitRequest?(); // MemLimitRequest? | (optional) + + try + { + // Waive memory limit + MemLimitResult result = apiInstance.DevicesMemLimitOff(udid, process, memLimitRequest); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesMemLimitOff: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesMemLimitOffWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Waive memory limit + ApiResponse response = apiInstance.DevicesMemLimitOffWithHttpInfo(udid, process, memLimitRequest); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesMemLimitOffWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **process** | **string?** | Process name whose memory limit should be waived. | [optional] | +| **memLimitRequest** | [**MemLimitRequest?**](MemLimitRequest?.md) | | [optional] | + +### Return type + +[**MemLimitResult**](MemLimitResult.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesMountImage** +> GenericResponse DevicesMountImage (string udid, bool? auto = null, string? basedir = null, Object? body = null) + +Mount a developer image + +Mount a Developer Disk Image. Either let the server auto-resolve and download the correct image (`auto=true`, optionally with `basedir`), or stream the image bytes as the raw request body (up to 2 GiB). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesMountImageExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var auto = true; // bool? | Auto-resolve and download the matching DDI for the device. (optional) + var basedir = "basedir_example"; // string? | Base directory the server uses to cache/lookup DDIs when `auto=true`. (optional) + var body = null; // Object? | Raw Developer Disk Image bytes (used when not auto-resolving). Content up to 2 GiB. (optional) + + try + { + // Mount a developer image + GenericResponse result = apiInstance.DevicesMountImage(udid, auto, basedir, body); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesMountImage: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesMountImageWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Mount a developer image + ApiResponse response = apiInstance.DevicesMountImageWithHttpInfo(udid, auto, basedir, body); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesMountImageWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **auto** | **bool?** | Auto-resolve and download the matching DDI for the device. | [optional] | +| **basedir** | **string?** | Base directory the server uses to cache/lookup DDIs when `auto=true`. | [optional] | +| **body** | **Object?** | Raw Developer Disk Image bytes (used when not auto-resolving). Content up to 2 GiB. | [optional] | + +### Return type + +[**GenericResponse**](GenericResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/octet-stream + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesPair** +> GenericResponse DevicesPair (string udid, bool supervised, Object p12file, string? supervisionPassword = null) + +Pair device + +Pair with the device. For a supervised pairing (`supervised=true`) upload the supervision identity as `p12file` (multipart) and supply the passphrase in the `Supervision-Password` header. Returns `423` when the device is locked and pairing cannot proceed. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesPairExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var supervised = true; // bool | Whether this is a supervised pairing. + var p12file = new Object(); // Object | + var supervisionPassword = "supervisionPassword_example"; // string? | Supervision identity passphrase (required when supervised). (optional) + + try + { + // Pair device + GenericResponse result = apiInstance.DevicesPair(udid, supervised, p12file, supervisionPassword); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesPair: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesPairWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Pair device + ApiResponse response = apiInstance.DevicesPairWithHttpInfo(udid, supervised, p12file, supervisionPassword); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesPairWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **supervised** | **bool** | Whether this is a supervised pairing. | | +| **p12file** | [**Object**](Object.md) | | | +| **supervisionPassword** | **string?** | Supervision identity passphrase (required when supervised). | [optional] | + +### Return type + +[**GenericResponse**](GenericResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **423** | 423 — device is locked; pairing cannot proceed. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesPullFile** +> Object DevicesPullFile (string udid, FileDomain domain, string remote, string? identifier = null) + +Pull file + +Download a file from the device, streamed as the response body (CLI: `ios file pull`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesPullFileExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var domain = new FileDomain(); // FileDomain | File service domain: `app`, `app-group`, `crash` or `temp`. + var remote = "remote_example"; // string | Remote file path on the device. + var identifier = "identifier_example"; // string? | Bundle/group id for the `app`/`app-group` domains. (optional) + + try + { + // Pull file + Object result = apiInstance.DevicesPullFile(udid, domain, remote, identifier); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesPullFile: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesPullFileWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Pull file + ApiResponse response = apiInstance.DevicesPullFileWithHttpInfo(udid, domain, remote, identifier); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesPullFileWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **domain** | [**FileDomain**](FileDomain.md) | File service domain: `app`, `app-group`, `crash` or `temp`. | | +| **remote** | **string** | Remote file path on the device. | | +| **identifier** | **string?** | Bundle/group id for the `app`/`app-group` domains. | [optional] | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/octet-stream, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesPushFile** +> FilePushResult DevicesPushFile (string udid, FileDomain domain, string remote, Object body, string? identifier = null) + +Push file + +Upload the request body to a device path (CLI: `ios file push`). A `Content-Length` header is required. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesPushFileExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var domain = new FileDomain(); // FileDomain | File service domain: `app`, `app-group`, `crash` or `temp`. + var remote = "remote_example"; // string | Destination path on the device. + var body = null; // Object | Raw file bytes to upload. + var identifier = "identifier_example"; // string? | Bundle/group id for the `app`/`app-group` domains. (optional) + + try + { + // Push file + FilePushResult result = apiInstance.DevicesPushFile(udid, domain, remote, body, identifier); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesPushFile: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesPushFileWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Push file + ApiResponse response = apiInstance.DevicesPushFileWithHttpInfo(udid, domain, remote, body, identifier); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesPushFileWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **domain** | [**FileDomain**](FileDomain.md) | File service domain: `app`, `app-group`, `crash` or `temp`. | | +| **remote** | **string** | Destination path on the device. | | +| **body** | **Object** | Raw file bytes to upload. | | +| **identifier** | **string?** | Bundle/group id for the `app`/`app-group` domains. | [optional] | + +### Return type + +[**FilePushResult**](FilePushResult.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/octet-stream + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesReboot** +> GenericResponse DevicesReboot (string udid) + +Reboot device + +Reboot the device (CLI: `ios reboot`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesRebootExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Reboot device + GenericResponse result = apiInstance.DevicesReboot(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesReboot: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesRebootWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Reboot device + ApiResponse response = apiInstance.DevicesRebootWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesRebootWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +[**GenericResponse**](GenericResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesRemoveCrashes** +> GenericResponse DevicesRemoveCrashes (string udid, string cwd, string pattern) + +Delete crash reports + +Delete crash reports (CLI: `ios crash rm`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesRemoveCrashesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var cwd = "cwd_example"; // string | Working directory on the device. + var pattern = "pattern_example"; // string | Glob pattern of reports to delete. + + try + { + // Delete crash reports + GenericResponse result = apiInstance.DevicesRemoveCrashes(udid, cwd, pattern); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesRemoveCrashes: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesRemoveCrashesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Delete crash reports + ApiResponse response = apiInstance.DevicesRemoveCrashesWithHttpInfo(udid, cwd, pattern); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesRemoveCrashesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **cwd** | **string** | Working directory on the device. | | +| **pattern** | **string** | Glob pattern of reports to delete. | | + +### Return type + +[**GenericResponse**](GenericResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesRemoveHttpProxy** +> GenericResponse DevicesRemoveHttpProxy (string udid) + +Remove HTTP proxy + +Clear the global HTTP proxy (CLI: `ios httpproxy remove`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesRemoveHttpProxyExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Remove HTTP proxy + GenericResponse result = apiInstance.DevicesRemoveHttpProxy(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesRemoveHttpProxy: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesRemoveHttpProxyWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Remove HTTP proxy + ApiResponse response = apiInstance.DevicesRemoveHttpProxyWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesRemoveHttpProxyWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +[**GenericResponse**](GenericResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesRemoveProfile** +> GenericResponse DevicesRemoveProfile (string udid, string name) + +Remove profile + +Remove a configuration profile by identifier (CLI: `ios profile remove`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesRemoveProfileExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var name = "name_example"; // string | The profile identifier to remove. + + try + { + // Remove profile + GenericResponse result = apiInstance.DevicesRemoveProfile(udid, name); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesRemoveProfile: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesRemoveProfileWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Remove profile + ApiResponse response = apiInstance.DevicesRemoveProfileWithHttpInfo(udid, name); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesRemoveProfileWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **name** | **string** | The profile identifier to remove. | | + +### Return type + +[**GenericResponse**](GenericResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesRemoveWifi** +> GenericResponse DevicesRemoveWifi (string udid, string ssid) + +Remove wifi + +Remove a provisioned wifi network (CLI: `ios wifi - -remove`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesRemoveWifiExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var ssid = "ssid_example"; // string | SSID of the network to remove. + + try + { + // Remove wifi + GenericResponse result = apiInstance.DevicesRemoveWifi(udid, ssid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesRemoveWifi: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesRemoveWifiWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Remove wifi + ApiResponse response = apiInstance.DevicesRemoveWifiWithHttpInfo(udid, ssid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesRemoveWifiWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **ssid** | **string** | SSID of the network to remove. | | + +### Return type + +[**GenericResponse**](GenericResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesResetAccessibility** +> GenericResponse DevicesResetAccessibility (string udid) + +Reset accessibility + +Reset accessibility settings on the device. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesResetAccessibilityExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Reset accessibility + GenericResponse result = apiInstance.DevicesResetAccessibility(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesResetAccessibility: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesResetAccessibilityWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Reset accessibility + ApiResponse response = apiInstance.DevicesResetAccessibilityWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesResetAccessibilityWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +[**GenericResponse**](GenericResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesResetLocation** +> GenericResponse DevicesResetLocation (string udid) + +Reset simulated location + +Reset the simulated location back to the device's real GPS location. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesResetLocationExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Reset simulated location + GenericResponse result = apiInstance.DevicesResetLocation(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesResetLocation: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesResetLocationWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Reset simulated location + ApiResponse response = apiInstance.DevicesResetLocationWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesResetLocationWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +[**GenericResponse**](GenericResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesScreenshot** +> Object DevicesScreenshot (string udid) + +Capture screenshot + +Capture a screenshot. Returns raw PNG bytes (`image/png`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesScreenshotExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Capture screenshot + Object result = apiInstance.DevicesScreenshot(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesScreenshot: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesScreenshotWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Capture screenshot + ApiResponse response = apiInstance.DevicesScreenshotWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesScreenshotWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: image/png, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesSetAssistiveTouch** +> AssistiveTouchState DevicesSetAssistiveTouch (string udid, EnabledRequest enabledRequest) + +Set AssistiveTouch + +Enable/disable AssistiveTouch (CLI: `ios assistivetouch enable|disable`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesSetAssistiveTouchExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var enabledRequest = new EnabledRequest(); // EnabledRequest | + + try + { + // Set AssistiveTouch + AssistiveTouchState result = apiInstance.DevicesSetAssistiveTouch(udid, enabledRequest); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesSetAssistiveTouch: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesSetAssistiveTouchWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Set AssistiveTouch + ApiResponse response = apiInstance.DevicesSetAssistiveTouchWithHttpInfo(udid, enabledRequest); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesSetAssistiveTouchWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **enabledRequest** | [**EnabledRequest**](EnabledRequest.md) | | | + +### Return type + +[**AssistiveTouchState**](AssistiveTouchState.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesSetDevMode** +> GenericResponse DevicesSetDevMode (string udid, DevModeRequest devModeRequest) + +Set developer mode + +Enable or reveal developer mode (CLI: `ios devmode enable|reveal`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesSetDevModeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var devModeRequest = new DevModeRequest(); // DevModeRequest | + + try + { + // Set developer mode + GenericResponse result = apiInstance.DevicesSetDevMode(udid, devModeRequest); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesSetDevMode: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesSetDevModeWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Set developer mode + ApiResponse response = apiInstance.DevicesSetDevModeWithHttpInfo(udid, devModeRequest); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesSetDevModeWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **devModeRequest** | [**DevModeRequest**](DevModeRequest.md) | | | + +### Return type + +[**GenericResponse**](GenericResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesSetHttpProxy** +> GenericResponse DevicesSetHttpProxy (string udid, string host, string port, Object p12, string? user = null, string? pass = null, string? password = null) + +Set HTTP proxy (supervised) + +Configure a global HTTP proxy (CLI: `ios httpproxy`). Supervised: send multipart form-data with `host`, `port`, a `p12` supervisor identity and optional `user`/`pass`/`password` fields. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesSetHttpProxyExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var host = "host_example"; // string | Proxy host. + var port = "port_example"; // string | Proxy port. + var p12 = new Object(); // Object | + var user = "user_example"; // string? | Proxy username. (optional) + var pass = "pass_example"; // string? | Proxy password. (optional) + var password = "password_example"; // string? | Passphrase for the `.p12` identity. (optional) + + try + { + // Set HTTP proxy (supervised) + GenericResponse result = apiInstance.DevicesSetHttpProxy(udid, host, port, p12, user, pass, password); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesSetHttpProxy: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesSetHttpProxyWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Set HTTP proxy (supervised) + ApiResponse response = apiInstance.DevicesSetHttpProxyWithHttpInfo(udid, host, port, p12, user, pass, password); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesSetHttpProxyWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **host** | **string** | Proxy host. | | +| **port** | **string** | Proxy port. | | +| **p12** | [**Object**](Object.md) | | | +| **user** | **string?** | Proxy username. | [optional] | +| **pass** | **string?** | Proxy password. | [optional] | +| **password** | **string?** | Passphrase for the `.p12` identity. | [optional] | + +### Return type + +[**GenericResponse**](GenericResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesSetIconLayout** +> GenericResponse DevicesSetIconLayout (string udid, Object body) + +Set icon layout + +Restore a SpringBoard icon layout (CLI: `ios set-icon-layout`). Body is the layout JSON as returned by GET. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesSetIconLayoutExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var body = null; // Object | + + try + { + // Set icon layout + GenericResponse result = apiInstance.DevicesSetIconLayout(udid, body); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesSetIconLayout: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesSetIconLayoutWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Set icon layout + ApiResponse response = apiInstance.DevicesSetIconLayoutWithHttpInfo(udid, body); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesSetIconLayoutWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **body** | **Object** | | | + +### Return type + +[**GenericResponse**](GenericResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesSetLanguage** +> LanguageConfiguration DevicesSetLanguage (string udid, SetLanguageRequest setLanguageRequest) + +Set language + +Set the device language and/or locale (CLI: `ios lang - -setlang - -setlocale`). Returns the resulting configuration. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesSetLanguageExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var setLanguageRequest = new SetLanguageRequest(); // SetLanguageRequest | + + try + { + // Set language + LanguageConfiguration result = apiInstance.DevicesSetLanguage(udid, setLanguageRequest); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesSetLanguage: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesSetLanguageWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Set language + ApiResponse response = apiInstance.DevicesSetLanguageWithHttpInfo(udid, setLanguageRequest); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesSetLanguageWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **setLanguageRequest** | [**SetLanguageRequest**](SetLanguageRequest.md) | | | + +### Return type + +[**LanguageConfiguration**](LanguageConfiguration.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesSetLocation** +> GenericResponse DevicesSetLocation (string udid, string latitude, string longitude) + +Set simulated location + +Simulate a GPS location on the device. NOTE: the longitude parameter was historically misspelled `longtitude` on the wire. This spec fixes it to `longitude`; the go-ios server accepts `longitude` (and may keep `longtitude` as a deprecated alias). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesSetLocationExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var latitude = "latitude_example"; // string | Latitude in decimal degrees. + var longitude = "longitude_example"; // string | Longitude in decimal degrees. + + try + { + // Set simulated location + GenericResponse result = apiInstance.DevicesSetLocation(udid, latitude, longitude); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesSetLocation: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesSetLocationWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Set simulated location + ApiResponse response = apiInstance.DevicesSetLocationWithHttpInfo(udid, latitude, longitude); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesSetLocationWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **latitude** | **string** | Latitude in decimal degrees. | | +| **longitude** | **string** | Longitude in decimal degrees. | | + +### Return type + +[**GenericResponse**](GenericResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesSetPasteboard** +> GenericResponse DevicesSetPasteboard (string udid, string body) + +Set pasteboard + +Set the pasteboard text from the raw request body (CLI: `ios pasteboard set`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesSetPasteboardExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var body = "body_example"; // string | + + try + { + // Set pasteboard + GenericResponse result = apiInstance.DevicesSetPasteboard(udid, body); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesSetPasteboard: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesSetPasteboardWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Set pasteboard + ApiResponse response = apiInstance.DevicesSetPasteboardWithHttpInfo(udid, body); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesSetPasteboardWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **body** | **string** | | | + +### Return type + +[**GenericResponse**](GenericResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: text/plain + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesSetTimeFormat** +> TimeFormatState DevicesSetTimeFormat (string udid, TimeFormatRequest timeFormatRequest) + +Set time format + +Set 24-hour / 12-hour clock (CLI: `ios timeformat 24h|12h`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesSetTimeFormatExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var timeFormatRequest = new TimeFormatRequest(); // TimeFormatRequest | + + try + { + // Set time format + TimeFormatState result = apiInstance.DevicesSetTimeFormat(udid, timeFormatRequest); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesSetTimeFormat: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesSetTimeFormatWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Set time format + ApiResponse response = apiInstance.DevicesSetTimeFormatWithHttpInfo(udid, timeFormatRequest); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesSetTimeFormatWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **timeFormatRequest** | [**TimeFormatRequest**](TimeFormatRequest.md) | | | + +### Return type + +[**TimeFormatState**](TimeFormatState.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesSetWallpaper** +> GenericResponse DevicesSetWallpaper (string udid, Object image, Object p12, string? password = null, string? screen = null) + +Set wallpaper (supervised) + +Set the wallpaper (CLI: `ios set-wallpaper`). Supervised: upload the image and a `.p12` supervisor identity as multipart form-data. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesSetWallpaperExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var image = new Object(); // Object | + var p12 = new Object(); // Object | + var password = "password_example"; // string? | Passphrase for the `.p12` identity. (optional) + var screen = "screen_example"; // string? | Target screen (`home`, `lock`, `both`). (optional) + + try + { + // Set wallpaper (supervised) + GenericResponse result = apiInstance.DevicesSetWallpaper(udid, image, p12, password, screen); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesSetWallpaper: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesSetWallpaperWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Set wallpaper (supervised) + ApiResponse response = apiInstance.DevicesSetWallpaperWithHttpInfo(udid, image, p12, password, screen); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesSetWallpaperWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **image** | [**Object**](Object.md) | | | +| **p12** | [**Object**](Object.md) | | | +| **password** | **string?** | Passphrase for the `.p12` identity. | [optional] | +| **screen** | **string?** | Target screen (`home`, `lock`, `both`). | [optional] | + +### Return type + +[**GenericResponse**](GenericResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesSetWifi** +> GenericResponse DevicesSetWifi (string udid, WifiRequest wifiRequest) + +Provision wifi + +Provision a wifi network (CLI: `ios wifi`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesSetWifiExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var wifiRequest = new WifiRequest(); // WifiRequest | + + try + { + // Provision wifi + GenericResponse result = apiInstance.DevicesSetWifi(udid, wifiRequest); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesSetWifi: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesSetWifiWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Provision wifi + ApiResponse response = apiInstance.DevicesSetWifiWithHttpInfo(udid, wifiRequest); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesSetWifiWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **wifiRequest** | [**WifiRequest**](WifiRequest.md) | | | + +### Return type + +[**GenericResponse**](GenericResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesShutdown** +> GenericResponse DevicesShutdown (string udid) + +Shut down device + +Shut down the device (CLI: `ios shutdown`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesShutdownExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Shut down device + GenericResponse result = apiInstance.DevicesShutdown(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesShutdown: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesShutdownWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Shut down device + ApiResponse response = apiInstance.DevicesShutdownWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesShutdownWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +[**GenericResponse**](GenericResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesStartForward** +> Job DevicesStartForward (string udid, ForwardRequest forwardRequest) + +Start port forward (job) + +Start a TCP port forward host→device as an async job (CLI: `ios forward`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesStartForwardExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var forwardRequest = new ForwardRequest(); // ForwardRequest | + + try + { + // Start port forward (job) + Job result = apiInstance.DevicesStartForward(udid, forwardRequest); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesStartForward: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesStartForwardWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Start port forward (job) + ApiResponse response = apiInstance.DevicesStartForwardWithHttpInfo(udid, forwardRequest); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesStartForwardWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **forwardRequest** | [**ForwardRequest**](ForwardRequest.md) | | | + +### Return type + +[**Job**](Job.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **202** | The request has been accepted for processing, but processing has not yet completed. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesStartRunTest** +> Job DevicesStartRunTest (string udid, RunTestRequest runTestRequest) + +Start test run (job) + +Start an XCUITest/unit-test run as an async job (CLI: `ios runtest`). Returns `202` with the created job. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesStartRunTestExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var runTestRequest = new RunTestRequest(); // RunTestRequest | + + try + { + // Start test run (job) + Job result = apiInstance.DevicesStartRunTest(udid, runTestRequest); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesStartRunTest: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesStartRunTestWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Start test run (job) + ApiResponse response = apiInstance.DevicesStartRunTestWithHttpInfo(udid, runTestRequest); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesStartRunTestWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **runTestRequest** | [**RunTestRequest**](RunTestRequest.md) | | | + +### Return type + +[**Job**](Job.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **202** | The request has been accepted for processing, but processing has not yet completed. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesStartRunWda** +> Job DevicesStartRunWda (string udid, RunTestRequest? runTestRequest = null) + +Start WDA runner (job) + +Start the WebDriverAgent runner as an async job (CLI: `ios runwda`). Body fields are optional and default to the standard WDA bundle id and config. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesStartRunWdaExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var runTestRequest = new RunTestRequest?(); // RunTestRequest? | (optional) + + try + { + // Start WDA runner (job) + Job result = apiInstance.DevicesStartRunWda(udid, runTestRequest); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesStartRunWda: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesStartRunWdaWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Start WDA runner (job) + ApiResponse response = apiInstance.DevicesStartRunWdaWithHttpInfo(udid, runTestRequest); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesStartRunWdaWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **runTestRequest** | [**RunTestRequest?**](RunTestRequest?.md) | | [optional] | + +### Return type + +[**Job**](Job.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **202** | The request has been accepted for processing, but processing has not yet completed. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesStopJob** +> GenericResponse DevicesStopJob (string udid, string id) + +Stop or delete job + +Stop a running job, or purge an already-terminal one from the registry (CLI: Ctrl-C on the equivalent command). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesStopJobExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var id = "id_example"; // string | The job id. + + try + { + // Stop or delete job + GenericResponse result = apiInstance.DevicesStopJob(udid, id); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesStopJob: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesStopJobWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Stop or delete job + ApiResponse response = apiInstance.DevicesStopJobWithHttpInfo(udid, id); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesStopJobWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **id** | **string** | The job id. | | + +### Return type + +[**GenericResponse**](GenericResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — the requested resource (e.g. a job) was not found for this device. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesStreamJobLogs** +> string DevicesStreamJobLogs (string udid, string id) + +Stream job logs (SSE) + +Stream a job's log output as Server-Sent Events: the buffered history first, then live lines until the job ends or the client disconnects. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesStreamJobLogsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var id = "id_example"; // string | The job id. + + try + { + // Stream job logs (SSE) + string result = apiInstance.DevicesStreamJobLogs(udid, id); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesStreamJobLogs: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesStreamJobLogsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Stream job logs (SSE) + ApiResponse response = apiInstance.DevicesStreamJobLogsWithHttpInfo(udid, id); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesStreamJobLogsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **id** | **string** | The job id. | | + +### Return type + +**string** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/event-stream, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — the requested resource (e.g. a job) was not found for this device. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesStreamListen** +> string DevicesStreamListen (string udid) + +Stream device attach/detach (SSE) + +Stream device attach/detach events as Server-Sent Events. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesStreamListenExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Stream device attach/detach (SSE) + string result = apiInstance.DevicesStreamListen(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesStreamListen: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesStreamListenWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Stream device attach/detach (SSE) + ApiResponse response = apiInstance.DevicesStreamListenWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesStreamListenWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +**string** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/event-stream, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesStreamNotifications** +> string DevicesStreamNotifications (string udid) + +Stream app-state notifications (SSE) + +Stream application state-change notifications as Server-Sent Events. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesStreamNotificationsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Stream app-state notifications (SSE) + string result = apiInstance.DevicesStreamNotifications(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesStreamNotifications: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesStreamNotificationsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Stream app-state notifications (SSE) + ApiResponse response = apiInstance.DevicesStreamNotificationsWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesStreamNotificationsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +**string** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/event-stream, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesStreamOsTrace** +> string DevicesStreamOsTrace (string udid, int? pid = null, string? level = null, string? subsystem = null, string? match = null, string? exclude = null) + +Stream os_log trace (SSE) + +Stream structured os_log trace entries as Server-Sent Events. All filters are optional and combine with AND semantics. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesStreamOsTraceExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var pid = 56; // int? | Only include entries from this process id. (optional) + var level = "level_example"; // string? | Minimum log level to include (e.g. `info`, `debug`, `error`). (optional) + var subsystem = "subsystem_example"; // string? | Only include entries from this subsystem. (optional) + var match = "match_example"; // string? | Only include entries whose message matches this substring/pattern. (optional) + var exclude = "exclude_example"; // string? | Exclude entries whose message matches this substring/pattern. (optional) + + try + { + // Stream os_log trace (SSE) + string result = apiInstance.DevicesStreamOsTrace(udid, pid, level, subsystem, match, exclude); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesStreamOsTrace: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesStreamOsTraceWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Stream os_log trace (SSE) + ApiResponse response = apiInstance.DevicesStreamOsTraceWithHttpInfo(udid, pid, level, subsystem, match, exclude); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesStreamOsTraceWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **pid** | **int?** | Only include entries from this process id. | [optional] | +| **level** | **string?** | Minimum log level to include (e.g. `info`, `debug`, `error`). | [optional] | +| **subsystem** | **string?** | Only include entries from this subsystem. | [optional] | +| **match** | **string?** | Only include entries whose message matches this substring/pattern. | [optional] | +| **exclude** | **string?** | Exclude entries whose message matches this substring/pattern. | [optional] | + +### Return type + +**string** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/event-stream, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesStreamSyslog** +> string DevicesStreamSyslog (string udid) + +Stream syslog (SSE) + +Stream device syslog lines as Server-Sent Events. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesStreamSyslogExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Stream syslog (SSE) + string result = apiInstance.DevicesStreamSyslog(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesStreamSyslog: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesStreamSyslogWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Stream syslog (SSE) + ApiResponse response = apiInstance.DevicesStreamSyslogWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesStreamSyslogWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +**string** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/event-stream, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesStreamSysmontap** +> string DevicesStreamSysmontap (string udid) + +Stream CPU usage (SSE) + +Stream CPU-usage samples as Server-Sent Events (CLI: `ios sysmontap`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesStreamSysmontapExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Stream CPU usage (SSE) + string result = apiInstance.DevicesStreamSysmontap(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesStreamSysmontap: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesStreamSysmontapWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Stream CPU usage (SSE) + ApiResponse response = apiInstance.DevicesStreamSysmontapWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesStreamSysmontapWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +**string** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/event-stream, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesUninstallApp** +> GenericResponse DevicesUninstallApp (string udid, string bundleID) + +Uninstall app + +Uninstall an application by bundle id. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesUninstallAppExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var bundleID = "bundleID_example"; // string | Bundle id of the app to uninstall. + + try + { + // Uninstall app + GenericResponse result = apiInstance.DevicesUninstallApp(udid, bundleID); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesUninstallApp: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesUninstallAppWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Uninstall app + ApiResponse response = apiInstance.DevicesUninstallAppWithHttpInfo(udid, bundleID); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesUninstallAppWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **bundleID** | **string** | Bundle id of the app to uninstall. | | + +### Return type + +[**GenericResponse**](GenericResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DevicesUnmountImage** +> GenericResponse DevicesUnmountImage (string udid) + +Unmount developer image + +Unmount the developer disk image (CLI: `ios image unmount`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DevicesUnmountImageExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Unmount developer image + GenericResponse result = apiInstance.DevicesUnmountImage(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DevicesUnmountImage: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DevicesUnmountImageWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Unmount developer image + ApiResponse response = apiInstance.DevicesUnmountImageWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DevicesUnmountImageWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +[**GenericResponse**](GenericResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DiagnosticsNetGetBatteryRegistry** +> BatteryRegistry DiagnosticsNetGetBatteryRegistry (string udid) + +Get battery IORegistry + +Get the battery IORegistry stats (Temperature, Voltage, CurrentCapacity, ...) via the diagnostics relay (CLI: `ios diagnostics ioregistry`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DiagnosticsNetGetBatteryRegistryExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Get battery IORegistry + BatteryRegistry result = apiInstance.DiagnosticsNetGetBatteryRegistry(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DiagnosticsNetGetBatteryRegistry: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DiagnosticsNetGetBatteryRegistryWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get battery IORegistry + ApiResponse response = apiInstance.DiagnosticsNetGetBatteryRegistryWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DiagnosticsNetGetBatteryRegistryWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +[**BatteryRegistry**](BatteryRegistry.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DiagnosticsNetGetDeviceIp** +> NetworkInfo DiagnosticsNetGetDeviceIp (string udid) + +Get device IP / network info + +Resolve the device's network addresses (MAC/IPv4/IPv6) by sniffing pcapd (CLI: `ios ip`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DiagnosticsNetGetDeviceIpExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Get device IP / network info + NetworkInfo result = apiInstance.DiagnosticsNetGetDeviceIp(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DiagnosticsNetGetDeviceIp: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DiagnosticsNetGetDeviceIpWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get device IP / network info + ApiResponse response = apiInstance.DiagnosticsNetGetDeviceIpWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DiagnosticsNetGetDeviceIpWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +[**NetworkInfo**](NetworkInfo.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DiagnosticsNetGetDiskSpace** +> DiskSpaceInfo DiagnosticsNetGetDiskSpace (string udid) + +Get disk space info + +Get filesystem info for the device (total/free/used bytes, block size) via AFC (CLI: `ios diskspace`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DiagnosticsNetGetDiskSpaceExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Get disk space info + DiskSpaceInfo result = apiInstance.DiagnosticsNetGetDiskSpace(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DiagnosticsNetGetDiskSpace: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DiagnosticsNetGetDiskSpaceWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get disk space info + ApiResponse response = apiInstance.DiagnosticsNetGetDiskSpaceWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DiagnosticsNetGetDiskSpaceWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +[**DiskSpaceInfo**](DiskSpaceInfo.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DiagnosticsNetGetRsdServices** +> Object DiagnosticsNetGetRsdServices (string udid) + +Get RSD service list + +Get the device's RSD (Remote Service Discovery) service list (CLI: `ios rsd ls`). Requires a running tunnel (iOS 17+); devices without RSD return `400`. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class DiagnosticsNetGetRsdServicesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Get RSD service list + Object result = apiInstance.DiagnosticsNetGetRsdServices(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.DiagnosticsNetGetRsdServices: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DiagnosticsNetGetRsdServicesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get RSD service list + ApiResponse response = apiInstance.DiagnosticsNetGetRsdServicesWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.DiagnosticsNetGetRsdServicesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FsyncFsyncLs** +> FsyncListing FsyncFsyncLs (string udid, string? bundleID = null, string? path = null) + +List a directory over AFC + +List a device directory over AFC (CLI: `ios fsync ls`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class FsyncFsyncLsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var bundleID = "bundleID_example"; // string? | App bundle id to scope to its container (else the media dir). (optional) + var path = "path_example"; // string? | Device-side path (rejects `..` elements). (optional) + + try + { + // List a directory over AFC + FsyncListing result = apiInstance.FsyncFsyncLs(udid, bundleID, path); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.FsyncFsyncLs: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FsyncFsyncLsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // List a directory over AFC + ApiResponse response = apiInstance.FsyncFsyncLsWithHttpInfo(udid, bundleID, path); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.FsyncFsyncLsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **bundleID** | **string?** | App bundle id to scope to its container (else the media dir). | [optional] | +| **path** | **string?** | Device-side path (rejects `..` elements). | [optional] | + +### Return type + +[**FsyncListing**](FsyncListing.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FsyncFsyncMkdir** +> FsyncMessage FsyncFsyncMkdir (string udid, string path, string? bundleID = null) + +Create a directory over AFC + +Create a directory over AFC (CLI: `ios fsync mkdir`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class FsyncFsyncMkdirExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var path = "path_example"; // string | Directory path to create (required). + var bundleID = "bundleID_example"; // string? | App bundle id to scope to its container (else the media dir). (optional) + + try + { + // Create a directory over AFC + FsyncMessage result = apiInstance.FsyncFsyncMkdir(udid, path, bundleID); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.FsyncFsyncMkdir: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FsyncFsyncMkdirWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Create a directory over AFC + ApiResponse response = apiInstance.FsyncFsyncMkdirWithHttpInfo(udid, path, bundleID); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.FsyncFsyncMkdirWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **path** | **string** | Directory path to create (required). | | +| **bundleID** | **string?** | App bundle id to scope to its container (else the media dir). | [optional] | + +### Return type + +[**FsyncMessage**](FsyncMessage.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FsyncFsyncPull** +> Object FsyncFsyncPull (string udid, string path, string? bundleID = null) + +Download a file over AFC + +Download a file from the device over AFC (CLI: `ios fsync pull`). Returns the raw file bytes. `path` is required. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class FsyncFsyncPullExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var path = "path_example"; // string | Remote file path on the device (required). + var bundleID = "bundleID_example"; // string? | App bundle id to scope to its container (else the media dir). (optional) + + try + { + // Download a file over AFC + Object result = apiInstance.FsyncFsyncPull(udid, path, bundleID); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.FsyncFsyncPull: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FsyncFsyncPullWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Download a file over AFC + ApiResponse response = apiInstance.FsyncFsyncPullWithHttpInfo(udid, path, bundleID); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.FsyncFsyncPullWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **path** | **string** | Remote file path on the device (required). | | +| **bundleID** | **string?** | App bundle id to scope to its container (else the media dir). | [optional] | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/octet-stream, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FsyncFsyncPush** +> FsyncPushResult FsyncFsyncPush (string udid, string path, Object body, string? bundleID = null) + +Upload a file over AFC + +Upload a file to the device over AFC (CLI: `ios fsync push`). Accepts either raw bytes (application/octet-stream) or a multipart form with a `file` field. `path` is required. Bounded server-side; oversized uploads get `413`. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class FsyncFsyncPushExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var path = "path_example"; // string | Destination path on the device (required). + var body = null; // Object | Raw file bytes to upload (application/octet-stream). + var bundleID = "bundleID_example"; // string? | App bundle id to scope to its container (else the media dir). (optional) + + try + { + // Upload a file over AFC + FsyncPushResult result = apiInstance.FsyncFsyncPush(udid, path, body, bundleID); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.FsyncFsyncPush: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FsyncFsyncPushWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Upload a file over AFC + ApiResponse response = apiInstance.FsyncFsyncPushWithHttpInfo(udid, path, body, bundleID); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.FsyncFsyncPushWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **path** | **string** | Destination path on the device (required). | | +| **body** | **Object** | Raw file bytes to upload (application/octet-stream). | | +| **bundleID** | **string?** | App bundle id to scope to its container (else the media dir). | [optional] | + +### Return type + +[**FsyncPushResult**](FsyncPushResult.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/octet-stream + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **413** | 413 — the uploaded body exceeded the server's size cap. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FsyncFsyncRm** +> FsyncMessage FsyncFsyncRm (string udid, string path, string? bundleID = null, bool? recursive = null) + +Remove a file or directory over AFC + +Remove a file or directory over AFC (CLI: `ios fsync rm`). Pass `recursive=true` to delete a non-empty directory. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class FsyncFsyncRmExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var path = "path_example"; // string | Path to remove (required). + var bundleID = "bundleID_example"; // string? | App bundle id to scope to its container (else the media dir). (optional) + var recursive = true; // bool? | Remove directory contents recursively. (optional) + + try + { + // Remove a file or directory over AFC + FsyncMessage result = apiInstance.FsyncFsyncRm(udid, path, bundleID, recursive); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.FsyncFsyncRm: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FsyncFsyncRmWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Remove a file or directory over AFC + ApiResponse response = apiInstance.FsyncFsyncRmWithHttpInfo(udid, path, bundleID, recursive); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.FsyncFsyncRmWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **path** | **string** | Path to remove (required). | | +| **bundleID** | **string?** | App bundle id to scope to its container (else the media dir). | [optional] | +| **recursive** | **bool?** | Remove directory contents recursively. | [optional] | + +### Return type + +[**FsyncMessage**](FsyncMessage.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FsyncFsyncTree** +> FsyncTreeListing FsyncFsyncTree (string udid, string? bundleID = null, string? path = null) + +Recursively list a directory over AFC + +Recursively list a device directory over AFC (CLI: `ios fsync tree`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class FsyncFsyncTreeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var bundleID = "bundleID_example"; // string? | App bundle id to scope to its container (else the media dir). (optional) + var path = "path_example"; // string? | Device-side path (rejects `..` elements). (optional) + + try + { + // Recursively list a directory over AFC + FsyncTreeListing result = apiInstance.FsyncFsyncTree(udid, bundleID, path); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.FsyncFsyncTree: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FsyncFsyncTreeWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Recursively list a directory over AFC + ApiResponse response = apiInstance.FsyncFsyncTreeWithHttpInfo(udid, bundleID, path); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.FsyncFsyncTreeWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **bundleID** | **string?** | App bundle id to scope to its container (else the media dir). | [optional] | +| **path** | **string?** | Device-side path (rejects `..` elements). | [optional] | + +### Return type + +[**FsyncTreeListing**](FsyncTreeListing.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FsyncGetCloudConfig** +> Object FsyncGetCloudConfig (string udid) + +Get device cloud configuration + +Get the device cloud configuration (supervision status, skip-setup options, organization info). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class FsyncGetCloudConfigExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Get device cloud configuration + Object result = apiInstance.FsyncGetCloudConfig(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.FsyncGetCloudConfig: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FsyncGetCloudConfigWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get device cloud configuration + ApiResponse response = apiInstance.FsyncGetCloudConfigWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.FsyncGetCloudConfigWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **GetPrepareSkipOptions** +> PrepareSkipOptions GetPrepareSkipOptions () + +List setup skip options + +List all setup-pane skip options usable when preparing a device (CLI: `ios prepare printskip`). Static, device-free list. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class GetPrepareSkipOptionsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + + try + { + // List setup skip options + PrepareSkipOptions result = apiInstance.GetPrepareSkipOptions(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.GetPrepareSkipOptions: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetPrepareSkipOptionsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // List setup skip options + ApiResponse response = apiInstance.GetPrepareSkipOptionsWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.GetPrepareSkipOptionsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**PrepareSkipOptions**](PrepareSkipOptions.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **ListDevices** +> DeviceList ListDevices () + +List devices + +List all attached / reachable devices. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class ListDevicesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + + try + { + // List devices + DeviceList result = apiInstance.ListDevices(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.ListDevices: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the ListDevicesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // List devices + ApiResponse response = apiInstance.ListDevicesWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.ListDevicesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**DeviceList**](DeviceList.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **ListTunnels** +> List<Tunnel> ListTunnels () + +List tunnels + +List running device tunnels (CLI: `ios tunnel ls`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class ListTunnelsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + + try + { + // List tunnels + List result = apiInstance.ListTunnels(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.ListTunnels: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the ListTunnelsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // List tunnels + ApiResponse> response = apiInstance.ListTunnelsWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.ListTunnelsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**List<Tunnel>**](Tunnel.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **502** | 502 — the tunnel agent could not be reached or returned an error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **PrepareCreateCert** +> SupervisionCert PrepareCreateCert () + +Generate a supervision certificate + +Generate a self-signed supervision identity (CLI: `ios prepare create-cert`) and return the DER (base64) and PEM for both the certificate and private key. Host-scoped (device-free). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class PrepareCreateCertExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + + try + { + // Generate a supervision certificate + SupervisionCert result = apiInstance.PrepareCreateCert(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.PrepareCreateCert: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the PrepareCreateCertWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Generate a supervision certificate + ApiResponse response = apiInstance.PrepareCreateCertWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.PrepareCreateCertWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**SupervisionCert**](SupervisionCert.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **PreparePrepareDevice** +> PrepareResult PreparePrepareDevice (string udid, Object? cert = null, string? p12password = null, List? skip = null, string? orgname = null, string? locale = null, string? lang = null) + +Prepare (and optionally supervise) a device + +Run the device preparation/provisioning flow (CLI: `ios prepare`). Send multipart/form-data. To supervise the device include a `cert` file (DER/PEM/P12 supervision identity) and optional `p12password`; without a cert the device is prepared without supervision. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class PreparePrepareDeviceExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var cert = new Object?(); // Object? | (optional) + var p12password = "p12password_example"; // string? | P12 password (when `cert` is a P12). (optional) + var skip = new List?(); // List? | Setup panes to skip (see /prepare/skip-options). Repeatable. (optional) + var orgname = "orgname_example"; // string? | Supervision organization name. (optional) + var locale = "locale_example"; // string? | Device locale (default en_US). (optional) + var lang = "lang_example"; // string? | Device language (default en). (optional) + + try + { + // Prepare (and optionally supervise) a device + PrepareResult result = apiInstance.PreparePrepareDevice(udid, cert, p12password, skip, orgname, locale, lang); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.PreparePrepareDevice: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the PreparePrepareDeviceWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Prepare (and optionally supervise) a device + ApiResponse response = apiInstance.PreparePrepareDeviceWithHttpInfo(udid, cert, p12password, skip, orgname, locale, lang); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.PreparePrepareDeviceWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **cert** | [**Object?**](Object?.md) | | [optional] | +| **p12password** | **string?** | P12 password (when `cert` is a P12). | [optional] | +| **skip** | [**List<string>?**](string.md) | Setup panes to skip (see /prepare/skip-options). Repeatable. | [optional] | +| **orgname** | **string?** | Supervision organization name. | [optional] | +| **locale** | **string?** | Device locale (default en_US). | [optional] | +| **lang** | **string?** | Device language (default en). | [optional] | + +### Return type + +[**PrepareResult**](PrepareResult.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **RefreshTunnel** +> Tunnel RefreshTunnel (string udid) + +Refresh tunnel + +Restart the tunnel for a device and wait for it to come up (CLI: `ios tunnel refresh`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class RefreshTunnelExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Refresh tunnel + Tunnel result = apiInstance.RefreshTunnel(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.RefreshTunnel: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the RefreshTunnelWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Refresh tunnel + ApiResponse response = apiInstance.RefreshTunnelWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.RefreshTunnelWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +[**Tunnel**](Tunnel.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **502** | 502 — the tunnel agent could not be reached or returned an error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **ShutdownTunnelAgent** +> AgentShutdown ShutdownTunnelAgent () + +Shut down tunnel agent + +Shut down the tunnel agent (CLI: `ios tunnel stopagent`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class ShutdownTunnelAgentExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + + try + { + // Shut down tunnel agent + AgentShutdown result = apiInstance.ShutdownTunnelAgent(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.ShutdownTunnelAgent: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the ShutdownTunnelAgentWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Shut down tunnel agent + ApiResponse response = apiInstance.ShutdownTunnelAgentWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.ShutdownTunnelAgentWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**AgentShutdown**](AgentShutdown.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **502** | 502 — the tunnel agent could not be reached or returned an error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **SignApp** +> Object SignApp (Object ipa, Object p12file, Object profile, string? p12password = null, string? bundleid = null) + +Resign an app/IPA + +Resign an uploaded app/IPA with an uploaded P12 identity and provisioning profile, returning the signed IPA. Synchronous. Host-scoped. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class SignAppExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var ipa = new Object(); // Object | + var p12file = new Object(); // Object | + var profile = new Object(); // Object | + var p12password = "p12password_example"; // string? | P12 password. (optional) + var bundleid = "bundleid_example"; // string? | Override bundle id. (optional) + + try + { + // Resign an app/IPA + Object result = apiInstance.SignApp(ipa, p12file, profile, p12password, bundleid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.SignApp: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the SignAppWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Resign an app/IPA + ApiResponse response = apiInstance.SignAppWithHttpInfo(ipa, p12file, profile, p12password, bundleid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.SignAppWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **ipa** | [**Object**](Object.md) | | | +| **p12file** | [**Object**](Object.md) | | | +| **profile** | [**Object**](Object.md) | | | +| **p12password** | **string?** | P12 password. | [optional] | +| **bundleid** | **string?** | Override bundle id. | [optional] | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/octet-stream, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **SignCertificate** +> Object SignCertificate (Object ascPrivateKey, string ascKeyId, string ascIssuerId, string? revokeExisting = null, string? p12password = null) + +Create a signing certificate + +Create one App Store Connect signing certificate and return its P12 (certificate + private key) as a downloadable `application/x-pkcs12` file. The P12 password is echoed in the `X-P12-Password` response header and the certificate resource id in `X-Certificate-Id`. Host-scoped (device-free). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class SignCertificateExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var ascPrivateKey = new Object(); // Object | + var ascKeyId = "ascKeyId_example"; // string | App Store Connect key id. + var ascIssuerId = "ascIssuerId_example"; // string | App Store Connect issuer id. + var revokeExisting = "revokeExisting_example"; // string? | Revoke existing iOS Development certificates first. (optional) + var p12password = "p12password_example"; // string? | Password to protect the generated P12. (optional) + + try + { + // Create a signing certificate + Object result = apiInstance.SignCertificate(ascPrivateKey, ascKeyId, ascIssuerId, revokeExisting, p12password); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.SignCertificate: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the SignCertificateWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Create a signing certificate + ApiResponse response = apiInstance.SignCertificateWithHttpInfo(ascPrivateKey, ascKeyId, ascIssuerId, revokeExisting, p12password); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.SignCertificateWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **ascPrivateKey** | [**Object**](Object.md) | | | +| **ascKeyId** | **string** | App Store Connect key id. | | +| **ascIssuerId** | **string** | App Store Connect issuer id. | | +| **revokeExisting** | **string?** | Revoke existing iOS Development certificates first. | [optional] | +| **p12password** | **string?** | Password to protect the generated P12. | [optional] | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/x-pkcs12, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **500** | 500 — internal error while talking to the device. | - | +| **502** | 502 — the tunnel agent could not be reached or returned an error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **SignProvision** +> ProvisioningResult SignProvision (Object ascPrivateKey, string ascKeyId, string ascIssuerId, string bundleid, string udid, string? bundlename = null, string? profilename = null, string? devicename = null, string? certificateId = null, string? revokeExisting = null, string? p12password = null) + +Create a provisioning profile + P12 + +Create a bundle id, development certificate and provisioning profile via App Store Connect and return both artifacts base64-encoded in a JSON envelope. The target device udid is supplied as a form field. Host-scoped. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class SignProvisionExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var ascPrivateKey = new Object(); // Object | + var ascKeyId = "ascKeyId_example"; // string | App Store Connect key id. + var ascIssuerId = "ascIssuerId_example"; // string | App Store Connect issuer id. + var bundleid = "bundleid_example"; // string | App bundle identifier. + var udid = "udid_example"; // string | Target device udid to register against the profile. + var bundlename = "bundlename_example"; // string? | Bundle display name. (optional) + var profilename = "profilename_example"; // string? | Provisioning profile name. (optional) + var devicename = "devicename_example"; // string? | Device display name. (optional) + var certificateId = "certificateId_example"; // string? | Reuse an existing certificate (no new P12 is generated). (optional) + var revokeExisting = "revokeExisting_example"; // string? | Revoke existing certificates first. (optional) + var p12password = "p12password_example"; // string? | Password to protect the generated P12. (optional) + + try + { + // Create a provisioning profile + P12 + ProvisioningResult result = apiInstance.SignProvision(ascPrivateKey, ascKeyId, ascIssuerId, bundleid, udid, bundlename, profilename, devicename, certificateId, revokeExisting, p12password); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.SignProvision: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the SignProvisionWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Create a provisioning profile + P12 + ApiResponse response = apiInstance.SignProvisionWithHttpInfo(ascPrivateKey, ascKeyId, ascIssuerId, bundleid, udid, bundlename, profilename, devicename, certificateId, revokeExisting, p12password); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.SignProvisionWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **ascPrivateKey** | [**Object**](Object.md) | | | +| **ascKeyId** | **string** | App Store Connect key id. | | +| **ascIssuerId** | **string** | App Store Connect issuer id. | | +| **bundleid** | **string** | App bundle identifier. | | +| **udid** | **string** | Target device udid to register against the profile. | | +| **bundlename** | **string?** | Bundle display name. | [optional] | +| **profilename** | **string?** | Provisioning profile name. | [optional] | +| **devicename** | **string?** | Device display name. | [optional] | +| **certificateId** | **string?** | Reuse an existing certificate (no new P12 is generated). | [optional] | +| **revokeExisting** | **string?** | Revoke existing certificates first. | [optional] | +| **p12password** | **string?** | Password to protect the generated P12. | [optional] | + +### Return type + +[**ProvisioningResult**](ProvisioningResult.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **500** | 500 — internal error while talking to the device. | - | +| **502** | 502 — the tunnel agent could not be reached or returned an error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **StopTunnel** +> TunnelStopped StopTunnel (string udid) + +Stop tunnel + +Stop the tunnel for a device (CLI: `ios tunnel stop - -udid`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class StopTunnelExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // Stop tunnel + TunnelStopped result = apiInstance.StopTunnel(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.StopTunnel: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the StopTunnelWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Stop tunnel + ApiResponse response = apiInstance.StopTunnelWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.StopTunnelWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +[**TunnelStopped**](TunnelStopped.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **502** | 502 — the tunnel agent could not be reached or returned an error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **StreamsPcap** +> Object StreamsPcap (string udid, int? timeout = null) + +Stream a live pcap capture (binary) + +Stream a live packet capture from the device as a libpcap byte stream (pipeable into wireshark/tshark). Runs until `timeout` (seconds) elapses, the default timeout is reached, or the client disconnects. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class StreamsPcapExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var timeout = 56; // int? | Capture duration in seconds (default 60, max 3600). (optional) + + try + { + // Stream a live pcap capture (binary) + Object result = apiInstance.StreamsPcap(udid, timeout); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.StreamsPcap: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the StreamsPcapWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Stream a live pcap capture (binary) + ApiResponse response = apiInstance.StreamsPcapWithHttpInfo(udid, timeout); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.StreamsPcapWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **timeout** | **int?** | Capture duration in seconds (default 60, max 3600). | [optional] | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/vnd.tcpdump.pcap, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **StreamsScreenshotStream** +> Object StreamsScreenshotStream (string udid, int? quality = null) + +Stream screenshots as MJPEG (binary) + +Serve an MJPEG (multipart/x-mixed-replace) stream of device screenshots captured via the instruments screenshot service. Streams until the client disconnects or the source fails. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class StreamsScreenshotStreamExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var quality = 56; // int? | Optional JPEG quality (1–100, default 80). (optional) + + try + { + // Stream screenshots as MJPEG (binary) + Object result = apiInstance.StreamsScreenshotStream(udid, quality); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.StreamsScreenshotStream: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the StreamsScreenshotStreamWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Stream screenshots as MJPEG (binary) + ApiResponse response = apiInstance.StreamsScreenshotStreamWithHttpInfo(udid, quality); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.StreamsScreenshotStreamWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **quality** | **int?** | Optional JPEG quality (1–100, default 80). | [optional] | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: image/jpeg, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **StreamsUiStream** +> Object StreamsUiStream (string udid, string? backend = null, string? wdaUrl = null, int? timeout = null, string? codec = null, string? fps = null, string? quality = null, string? scale = null, string? bitrate = null) + +Stream UI video (binary) + +Open a live UI video stream against a forwarded WDA/DeviceKit backend and pipe it straight through to the client. Default codec is MJPEG (multipart/x-mixed-replace); `codec=h264` returns an H.264 elementary stream (requires the devicekit backend). Streams until the client disconnects or the backend ends. Requires a running, forwarded WDA/DeviceKit backend (see the UI routes). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class StreamsUiStreamExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var backend = "backend_example"; // string? | Backend to target: `wda` (default) or `devicekit`. (optional) + var wdaUrl = "wdaUrl_example"; // string? | Forwarded backend base URL (defaults per backend). (optional) + var timeout = 56; // int? | Per-request HTTP timeout in seconds (default 60). (optional) + var codec = "codec_example"; // string? | Video codec: `mjpeg` (default) or `h264` (devicekit backend only). (optional) + var fps = "fps_example"; // string? | Target frames per second (backend-dependent). (optional) + var quality = "quality_example"; // string? | JPEG quality for the mjpeg codec. (optional) + var scale = "scale_example"; // string? | Scale factor (backend-dependent). (optional) + var bitrate = "bitrate_example"; // string? | Target bitrate for the h264 codec. (optional) + + try + { + // Stream UI video (binary) + Object result = apiInstance.StreamsUiStream(udid, backend, wdaUrl, timeout, codec, fps, quality, scale, bitrate); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.StreamsUiStream: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the StreamsUiStreamWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Stream UI video (binary) + ApiResponse response = apiInstance.StreamsUiStreamWithHttpInfo(udid, backend, wdaUrl, timeout, codec, fps, quality, scale, bitrate); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.StreamsUiStreamWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **backend** | **string?** | Backend to target: `wda` (default) or `devicekit`. | [optional] | +| **wdaUrl** | **string?** | Forwarded backend base URL (defaults per backend). | [optional] | +| **timeout** | **int?** | Per-request HTTP timeout in seconds (default 60). | [optional] | +| **codec** | **string?** | Video codec: `mjpeg` (default) or `h264` (devicekit backend only). | [optional] | +| **fps** | **string?** | Target frames per second (backend-dependent). | [optional] | +| **quality** | **string?** | JPEG quality for the mjpeg codec. | [optional] | +| **scale** | **string?** | Scale factor (backend-dependent). | [optional] | +| **bitrate** | **string?** | Target bitrate for the h264 codec. | [optional] | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/octet-stream, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | +| **501** | 501 — the selected UI-automation backend does not support this operation. | - | +| **502** | 502 — the tunnel agent could not be reached or returned an error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UIUiApi** +> Object UIUiApi (string udid, UIAPIRequest uIAPIRequest, string? backend = null, string? wdaUrl = null, int? timeout = null) + +Raw backend passthrough + +Raw passthrough to the backend. For WDA supply `method`/`path`/`body`; for DeviceKit supply `rpcMethod`/`rpcParams`. The backend response is forwarded verbatim. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class UIUiApiExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var uIAPIRequest = new UIAPIRequest(); // UIAPIRequest | + var backend = "backend_example"; // string? | Backend to target: `wda` (default) or `devicekit`. (optional) + var wdaUrl = "wdaUrl_example"; // string? | Forwarded backend base URL (defaults per backend). (optional) + var timeout = 56; // int? | Per-request HTTP timeout in seconds (default 60). (optional) + + try + { + // Raw backend passthrough + Object result = apiInstance.UIUiApi(udid, uIAPIRequest, backend, wdaUrl, timeout); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.UIUiApi: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UIUiApiWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Raw backend passthrough + ApiResponse response = apiInstance.UIUiApiWithHttpInfo(udid, uIAPIRequest, backend, wdaUrl, timeout); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.UIUiApiWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **uIAPIRequest** | [**UIAPIRequest**](UIAPIRequest.md) | | | +| **backend** | **string?** | Backend to target: `wda` (default) or `devicekit`. | [optional] | +| **wdaUrl** | **string?** | Forwarded backend base URL (defaults per backend). | [optional] | +| **timeout** | **int?** | Per-request HTTP timeout in seconds (default 60). | [optional] | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | +| **501** | 501 — the selected UI-automation backend does not support this operation. | - | +| **502** | 502 — the tunnel agent could not be reached or returned an error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UIUiAppForeground** +> Object UIUiAppForeground (string udid, string? backend = null, string? wdaUrl = null, int? timeout = null) + +Foreground app (UI backend) + +Bring the backgrounded app to the foreground. Only the devicekit backend supports this; WDA returns `501`. The request body is ignored. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class UIUiAppForegroundExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var backend = "backend_example"; // string? | Backend to target: `wda` (default) or `devicekit`. (optional) + var wdaUrl = "wdaUrl_example"; // string? | Forwarded backend base URL (defaults per backend). (optional) + var timeout = 56; // int? | Per-request HTTP timeout in seconds (default 60). (optional) + + try + { + // Foreground app (UI backend) + Object result = apiInstance.UIUiAppForeground(udid, backend, wdaUrl, timeout); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.UIUiAppForeground: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UIUiAppForegroundWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Foreground app (UI backend) + ApiResponse response = apiInstance.UIUiAppForegroundWithHttpInfo(udid, backend, wdaUrl, timeout); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.UIUiAppForegroundWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **backend** | **string?** | Backend to target: `wda` (default) or `devicekit`. | [optional] | +| **wdaUrl** | **string?** | Forwarded backend base URL (defaults per backend). | [optional] | +| **timeout** | **int?** | Per-request HTTP timeout in seconds (default 60). | [optional] | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | +| **501** | 501 — the selected UI-automation backend does not support this operation. | - | +| **502** | 502 — the tunnel agent could not be reached or returned an error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UIUiAppLaunch** +> Object UIUiAppLaunch (string udid, UIAppRequest uIAppRequest, string? backend = null, string? wdaUrl = null, int? timeout = null) + +Launch app (UI backend) + +Launch the app identified by `bundleId`. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class UIUiAppLaunchExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var uIAppRequest = new UIAppRequest(); // UIAppRequest | + var backend = "backend_example"; // string? | Backend to target: `wda` (default) or `devicekit`. (optional) + var wdaUrl = "wdaUrl_example"; // string? | Forwarded backend base URL (defaults per backend). (optional) + var timeout = 56; // int? | Per-request HTTP timeout in seconds (default 60). (optional) + + try + { + // Launch app (UI backend) + Object result = apiInstance.UIUiAppLaunch(udid, uIAppRequest, backend, wdaUrl, timeout); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.UIUiAppLaunch: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UIUiAppLaunchWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Launch app (UI backend) + ApiResponse response = apiInstance.UIUiAppLaunchWithHttpInfo(udid, uIAppRequest, backend, wdaUrl, timeout); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.UIUiAppLaunchWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **uIAppRequest** | [**UIAppRequest**](UIAppRequest.md) | | | +| **backend** | **string?** | Backend to target: `wda` (default) or `devicekit`. | [optional] | +| **wdaUrl** | **string?** | Forwarded backend base URL (defaults per backend). | [optional] | +| **timeout** | **int?** | Per-request HTTP timeout in seconds (default 60). | [optional] | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | +| **501** | 501 — the selected UI-automation backend does not support this operation. | - | +| **502** | 502 — the tunnel agent could not be reached or returned an error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UIUiAppTerminate** +> Object UIUiAppTerminate (string udid, UIAppRequest uIAppRequest, string? backend = null, string? wdaUrl = null, int? timeout = null) + +Terminate app (UI backend) + +Terminate the app identified by `bundleId`. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class UIUiAppTerminateExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var uIAppRequest = new UIAppRequest(); // UIAppRequest | + var backend = "backend_example"; // string? | Backend to target: `wda` (default) or `devicekit`. (optional) + var wdaUrl = "wdaUrl_example"; // string? | Forwarded backend base URL (defaults per backend). (optional) + var timeout = 56; // int? | Per-request HTTP timeout in seconds (default 60). (optional) + + try + { + // Terminate app (UI backend) + Object result = apiInstance.UIUiAppTerminate(udid, uIAppRequest, backend, wdaUrl, timeout); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.UIUiAppTerminate: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UIUiAppTerminateWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Terminate app (UI backend) + ApiResponse response = apiInstance.UIUiAppTerminateWithHttpInfo(udid, uIAppRequest, backend, wdaUrl, timeout); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.UIUiAppTerminateWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **uIAppRequest** | [**UIAppRequest**](UIAppRequest.md) | | | +| **backend** | **string?** | Backend to target: `wda` (default) or `devicekit`. | [optional] | +| **wdaUrl** | **string?** | Forwarded backend base URL (defaults per backend). | [optional] | +| **timeout** | **int?** | Per-request HTTP timeout in seconds (default 60). | [optional] | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | +| **501** | 501 — the selected UI-automation backend does not support this operation. | - | +| **502** | 502 — the tunnel agent could not be reached or returned an error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UIUiButton** +> Object UIUiButton (string udid, UIButtonRequest uIButtonRequest, string? backend = null, string? wdaUrl = null, int? timeout = null) + +Press hardware button + +Press a hardware button by name (WDA supports only `home`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class UIUiButtonExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var uIButtonRequest = new UIButtonRequest(); // UIButtonRequest | + var backend = "backend_example"; // string? | Backend to target: `wda` (default) or `devicekit`. (optional) + var wdaUrl = "wdaUrl_example"; // string? | Forwarded backend base URL (defaults per backend). (optional) + var timeout = 56; // int? | Per-request HTTP timeout in seconds (default 60). (optional) + + try + { + // Press hardware button + Object result = apiInstance.UIUiButton(udid, uIButtonRequest, backend, wdaUrl, timeout); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.UIUiButton: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UIUiButtonWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Press hardware button + ApiResponse response = apiInstance.UIUiButtonWithHttpInfo(udid, uIButtonRequest, backend, wdaUrl, timeout); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.UIUiButtonWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **uIButtonRequest** | [**UIButtonRequest**](UIButtonRequest.md) | | | +| **backend** | **string?** | Backend to target: `wda` (default) or `devicekit`. | [optional] | +| **wdaUrl** | **string?** | Forwarded backend base URL (defaults per backend). | [optional] | +| **timeout** | **int?** | Per-request HTTP timeout in seconds (default 60). | [optional] | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | +| **501** | 501 — the selected UI-automation backend does not support this operation. | - | +| **502** | 502 — the tunnel agent could not be reached or returned an error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UIUiGetOrientation** +> Object UIUiGetOrientation (string udid, string? backend = null, string? wdaUrl = null, int? timeout = null) + +Get orientation + +Get the current device orientation payload. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class UIUiGetOrientationExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var backend = "backend_example"; // string? | Backend to target: `wda` (default) or `devicekit`. (optional) + var wdaUrl = "wdaUrl_example"; // string? | Forwarded backend base URL (defaults per backend). (optional) + var timeout = 56; // int? | Per-request HTTP timeout in seconds (default 60). (optional) + + try + { + // Get orientation + Object result = apiInstance.UIUiGetOrientation(udid, backend, wdaUrl, timeout); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.UIUiGetOrientation: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UIUiGetOrientationWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get orientation + ApiResponse response = apiInstance.UIUiGetOrientationWithHttpInfo(udid, backend, wdaUrl, timeout); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.UIUiGetOrientationWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **backend** | **string?** | Backend to target: `wda` (default) or `devicekit`. | [optional] | +| **wdaUrl** | **string?** | Forwarded backend base URL (defaults per backend). | [optional] | +| **timeout** | **int?** | Per-request HTTP timeout in seconds (default 60). | [optional] | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | +| **501** | 501 — the selected UI-automation backend does not support this operation. | - | +| **502** | 502 — the tunnel agent could not be reached or returned an error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UIUiLongPress** +> Object UIUiLongPress (string udid, UILongPressRequest uILongPressRequest, string? backend = null, string? wdaUrl = null, int? timeout = null) + +Long press + +Press and hold at (x,y). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class UIUiLongPressExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var uILongPressRequest = new UILongPressRequest(); // UILongPressRequest | + var backend = "backend_example"; // string? | Backend to target: `wda` (default) or `devicekit`. (optional) + var wdaUrl = "wdaUrl_example"; // string? | Forwarded backend base URL (defaults per backend). (optional) + var timeout = 56; // int? | Per-request HTTP timeout in seconds (default 60). (optional) + + try + { + // Long press + Object result = apiInstance.UIUiLongPress(udid, uILongPressRequest, backend, wdaUrl, timeout); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.UIUiLongPress: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UIUiLongPressWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Long press + ApiResponse response = apiInstance.UIUiLongPressWithHttpInfo(udid, uILongPressRequest, backend, wdaUrl, timeout); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.UIUiLongPressWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **uILongPressRequest** | [**UILongPressRequest**](UILongPressRequest.md) | | | +| **backend** | **string?** | Backend to target: `wda` (default) or `devicekit`. | [optional] | +| **wdaUrl** | **string?** | Forwarded backend base URL (defaults per backend). | [optional] | +| **timeout** | **int?** | Per-request HTTP timeout in seconds (default 60). | [optional] | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | +| **501** | 501 — the selected UI-automation backend does not support this operation. | - | +| **502** | 502 — the tunnel agent could not be reached or returned an error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UIUiScreenshot** +> Object UIUiScreenshot (string udid, string? backend = null, string? wdaUrl = null, int? timeout = null) + +UI screenshot (PNG) + +Capture the screen and return raw PNG bytes. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class UIUiScreenshotExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var backend = "backend_example"; // string? | Backend to target: `wda` (default) or `devicekit`. (optional) + var wdaUrl = "wdaUrl_example"; // string? | Forwarded backend base URL (defaults per backend). (optional) + var timeout = 56; // int? | Per-request HTTP timeout in seconds (default 60). (optional) + + try + { + // UI screenshot (PNG) + Object result = apiInstance.UIUiScreenshot(udid, backend, wdaUrl, timeout); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.UIUiScreenshot: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UIUiScreenshotWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // UI screenshot (PNG) + ApiResponse response = apiInstance.UIUiScreenshotWithHttpInfo(udid, backend, wdaUrl, timeout); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.UIUiScreenshotWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **backend** | **string?** | Backend to target: `wda` (default) or `devicekit`. | [optional] | +| **wdaUrl** | **string?** | Forwarded backend base URL (defaults per backend). | [optional] | +| **timeout** | **int?** | Per-request HTTP timeout in seconds (default 60). | [optional] | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: image/png, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | +| **501** | 501 — the selected UI-automation backend does not support this operation. | - | +| **502** | 502 — the tunnel agent could not be reached or returned an error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UIUiSetOrientation** +> Object UIUiSetOrientation (string udid, UIOrientationRequest uIOrientationRequest, string? backend = null, string? wdaUrl = null, int? timeout = null) + +Set orientation + +Set the device orientation. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class UIUiSetOrientationExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var uIOrientationRequest = new UIOrientationRequest(); // UIOrientationRequest | + var backend = "backend_example"; // string? | Backend to target: `wda` (default) or `devicekit`. (optional) + var wdaUrl = "wdaUrl_example"; // string? | Forwarded backend base URL (defaults per backend). (optional) + var timeout = 56; // int? | Per-request HTTP timeout in seconds (default 60). (optional) + + try + { + // Set orientation + Object result = apiInstance.UIUiSetOrientation(udid, uIOrientationRequest, backend, wdaUrl, timeout); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.UIUiSetOrientation: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UIUiSetOrientationWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Set orientation + ApiResponse response = apiInstance.UIUiSetOrientationWithHttpInfo(udid, uIOrientationRequest, backend, wdaUrl, timeout); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.UIUiSetOrientationWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **uIOrientationRequest** | [**UIOrientationRequest**](UIOrientationRequest.md) | | | +| **backend** | **string?** | Backend to target: `wda` (default) or `devicekit`. | [optional] | +| **wdaUrl** | **string?** | Forwarded backend base URL (defaults per backend). | [optional] | +| **timeout** | **int?** | Per-request HTTP timeout in seconds (default 60). | [optional] | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | +| **501** | 501 — the selected UI-automation backend does not support this operation. | - | +| **502** | 502 — the tunnel agent could not be reached or returned an error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UIUiSource** +> Object UIUiSource (string udid, string? backend = null, string? wdaUrl = null, int? timeout = null) + +UI source hierarchy + +Return the current view hierarchy (XML for WDA; backend Content-Type preserved). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class UIUiSourceExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var backend = "backend_example"; // string? | Backend to target: `wda` (default) or `devicekit`. (optional) + var wdaUrl = "wdaUrl_example"; // string? | Forwarded backend base URL (defaults per backend). (optional) + var timeout = 56; // int? | Per-request HTTP timeout in seconds (default 60). (optional) + + try + { + // UI source hierarchy + Object result = apiInstance.UIUiSource(udid, backend, wdaUrl, timeout); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.UIUiSource: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UIUiSourceWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // UI source hierarchy + ApiResponse response = apiInstance.UIUiSourceWithHttpInfo(udid, backend, wdaUrl, timeout); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.UIUiSourceWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **backend** | **string?** | Backend to target: `wda` (default) or `devicekit`. | [optional] | +| **wdaUrl** | **string?** | Forwarded backend base URL (defaults per backend). | [optional] | +| **timeout** | **int?** | Per-request HTTP timeout in seconds (default 60). | [optional] | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | +| **501** | 501 — the selected UI-automation backend does not support this operation. | - | +| **502** | 502 — the tunnel agent could not be reached or returned an error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UIUiStatus** +> Object UIUiStatus (string udid, string? backend = null, string? wdaUrl = null, int? timeout = null) + +UI backend status + +Return the backend status/health payload (WDA /status or DeviceKit /health). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class UIUiStatusExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var backend = "backend_example"; // string? | Backend to target: `wda` (default) or `devicekit`. (optional) + var wdaUrl = "wdaUrl_example"; // string? | Forwarded backend base URL (defaults per backend). (optional) + var timeout = 56; // int? | Per-request HTTP timeout in seconds (default 60). (optional) + + try + { + // UI backend status + Object result = apiInstance.UIUiStatus(udid, backend, wdaUrl, timeout); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.UIUiStatus: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UIUiStatusWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // UI backend status + ApiResponse response = apiInstance.UIUiStatusWithHttpInfo(udid, backend, wdaUrl, timeout); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.UIUiStatusWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **backend** | **string?** | Backend to target: `wda` (default) or `devicekit`. | [optional] | +| **wdaUrl** | **string?** | Forwarded backend base URL (defaults per backend). | [optional] | +| **timeout** | **int?** | Per-request HTTP timeout in seconds (default 60). | [optional] | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | +| **501** | 501 — the selected UI-automation backend does not support this operation. | - | +| **502** | 502 — the tunnel agent could not be reached or returned an error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UIUiSwipe** +> Object UIUiSwipe (string udid, UISwipeRequest uISwipeRequest, string? backend = null, string? wdaUrl = null, int? timeout = null) + +Swipe + +Drag from (x1,y1) to (x2,y2). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class UIUiSwipeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var uISwipeRequest = new UISwipeRequest(); // UISwipeRequest | + var backend = "backend_example"; // string? | Backend to target: `wda` (default) or `devicekit`. (optional) + var wdaUrl = "wdaUrl_example"; // string? | Forwarded backend base URL (defaults per backend). (optional) + var timeout = 56; // int? | Per-request HTTP timeout in seconds (default 60). (optional) + + try + { + // Swipe + Object result = apiInstance.UIUiSwipe(udid, uISwipeRequest, backend, wdaUrl, timeout); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.UIUiSwipe: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UIUiSwipeWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Swipe + ApiResponse response = apiInstance.UIUiSwipeWithHttpInfo(udid, uISwipeRequest, backend, wdaUrl, timeout); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.UIUiSwipeWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **uISwipeRequest** | [**UISwipeRequest**](UISwipeRequest.md) | | | +| **backend** | **string?** | Backend to target: `wda` (default) or `devicekit`. | [optional] | +| **wdaUrl** | **string?** | Forwarded backend base URL (defaults per backend). | [optional] | +| **timeout** | **int?** | Per-request HTTP timeout in seconds (default 60). | [optional] | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | +| **501** | 501 — the selected UI-automation backend does not support this operation. | - | +| **502** | 502 — the tunnel agent could not be reached or returned an error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UIUiTap** +> Object UIUiTap (string udid, UITapRequest uITapRequest, string? backend = null, string? wdaUrl = null, int? timeout = null) + +Tap + +Tap at absolute coordinates. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class UIUiTapExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var uITapRequest = new UITapRequest(); // UITapRequest | + var backend = "backend_example"; // string? | Backend to target: `wda` (default) or `devicekit`. (optional) + var wdaUrl = "wdaUrl_example"; // string? | Forwarded backend base URL (defaults per backend). (optional) + var timeout = 56; // int? | Per-request HTTP timeout in seconds (default 60). (optional) + + try + { + // Tap + Object result = apiInstance.UIUiTap(udid, uITapRequest, backend, wdaUrl, timeout); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.UIUiTap: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UIUiTapWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Tap + ApiResponse response = apiInstance.UIUiTapWithHttpInfo(udid, uITapRequest, backend, wdaUrl, timeout); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.UIUiTapWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **uITapRequest** | [**UITapRequest**](UITapRequest.md) | | | +| **backend** | **string?** | Backend to target: `wda` (default) or `devicekit`. | [optional] | +| **wdaUrl** | **string?** | Forwarded backend base URL (defaults per backend). | [optional] | +| **timeout** | **int?** | Per-request HTTP timeout in seconds (default 60). | [optional] | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | +| **501** | 501 — the selected UI-automation backend does not support this operation. | - | +| **502** | 502 — the tunnel agent could not be reached or returned an error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UIUiType** +> Object UIUiType (string udid, UITypeRequest uITypeRequest, string? backend = null, string? wdaUrl = null, int? timeout = null) + +Type text + +Send text as keyboard input. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class UIUiTypeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var uITypeRequest = new UITypeRequest(); // UITypeRequest | + var backend = "backend_example"; // string? | Backend to target: `wda` (default) or `devicekit`. (optional) + var wdaUrl = "wdaUrl_example"; // string? | Forwarded backend base URL (defaults per backend). (optional) + var timeout = 56; // int? | Per-request HTTP timeout in seconds (default 60). (optional) + + try + { + // Type text + Object result = apiInstance.UIUiType(udid, uITypeRequest, backend, wdaUrl, timeout); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.UIUiType: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UIUiTypeWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Type text + ApiResponse response = apiInstance.UIUiTypeWithHttpInfo(udid, uITypeRequest, backend, wdaUrl, timeout); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.UIUiTypeWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **uITypeRequest** | [**UITypeRequest**](UITypeRequest.md) | | | +| **backend** | **string?** | Backend to target: `wda` (default) or `devicekit`. | [optional] | +| **wdaUrl** | **string?** | Forwarded backend base URL (defaults per backend). | [optional] | +| **timeout** | **int?** | Per-request HTTP timeout in seconds (default 60). | [optional] | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | +| **501** | 501 — the selected UI-automation backend does not support this operation. | - | +| **502** | 502 — the tunnel agent could not be reached or returned an error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UIUiWindowSize** +> Object UIUiWindowSize (string udid, string? backend = null, string? wdaUrl = null, int? timeout = null) + +UI window size + +Return the device window/screen size payload (typically {width,height}). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class UIUiWindowSizeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var backend = "backend_example"; // string? | Backend to target: `wda` (default) or `devicekit`. (optional) + var wdaUrl = "wdaUrl_example"; // string? | Forwarded backend base URL (defaults per backend). (optional) + var timeout = 56; // int? | Per-request HTTP timeout in seconds (default 60). (optional) + + try + { + // UI window size + Object result = apiInstance.UIUiWindowSize(udid, backend, wdaUrl, timeout); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.UIUiWindowSize: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UIUiWindowSizeWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // UI window size + ApiResponse response = apiInstance.UIUiWindowSizeWithHttpInfo(udid, backend, wdaUrl, timeout); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.UIUiWindowSizeWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **backend** | **string?** | Backend to target: `wda` (default) or `devicekit`. | [optional] | +| **wdaUrl** | **string?** | Forwarded backend base URL (defaults per backend). | [optional] | +| **timeout** | **int?** | Per-request HTTP timeout in seconds (default 60). | [optional] | + +### Return type + +**Object** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **500** | 500 — internal error while talking to the device. | - | +| **501** | 501 — the selected UI-automation backend does not support this operation. | - | +| **502** | 502 — the tunnel agent could not be reached or returned an error. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **WebInspectorWebInspectorEval** +> WebInspectorEvalResult WebInspectorWebInspectorEval (string udid, WebInspectorEvalRequest webInspectorEvalRequest) + +Evaluate JavaScript in a page + +Evaluate JavaScript in an inspectable page and return the result (CLI: `ios webinspector eval`). `404` when no matching page exists. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class WebInspectorWebInspectorEvalExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var webInspectorEvalRequest = new WebInspectorEvalRequest(); // WebInspectorEvalRequest | + + try + { + // Evaluate JavaScript in a page + WebInspectorEvalResult result = apiInstance.WebInspectorWebInspectorEval(udid, webInspectorEvalRequest); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.WebInspectorWebInspectorEval: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the WebInspectorWebInspectorEvalWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Evaluate JavaScript in a page + ApiResponse response = apiInstance.WebInspectorWebInspectorEvalWithHttpInfo(udid, webInspectorEvalRequest); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.WebInspectorWebInspectorEvalWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **webInspectorEvalRequest** | [**WebInspectorEvalRequest**](WebInspectorEvalRequest.md) | | | + +### Return type + +[**WebInspectorEvalResult**](WebInspectorEvalResult.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — the requested resource (e.g. a job) was not found for this device. | - | +| **422** | 422 — empty/invalid udid. | - | +| **424** | 424 — a device-side prerequisite is missing. Used by the WebInspector routes when Web Inspector / Remote Automation is not enabled on the device. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **WebInspectorWebInspectorLaunch** +> WebInspectorLaunchResult WebInspectorWebInspectorLaunch (string udid, string? url = null, WebInspectorLaunchRequest? webInspectorLaunchRequest = null) + +Open a URL in a new inspectable page + +Open a URL in a new inspectable page via a remote automation session (CLI: `ios webinspector launch `). `url` may be a query param or in the body; `bundleId` defaults to Safari. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class WebInspectorWebInspectorLaunchExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + var url = "url_example"; // string? | URL to open (alternative to the request body). (optional) + var webInspectorLaunchRequest = new WebInspectorLaunchRequest?(); // WebInspectorLaunchRequest? | (optional) + + try + { + // Open a URL in a new inspectable page + WebInspectorLaunchResult result = apiInstance.WebInspectorWebInspectorLaunch(udid, url, webInspectorLaunchRequest); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.WebInspectorWebInspectorLaunch: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the WebInspectorWebInspectorLaunchWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Open a URL in a new inspectable page + ApiResponse response = apiInstance.WebInspectorWebInspectorLaunchWithHttpInfo(udid, url, webInspectorLaunchRequest); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.WebInspectorWebInspectorLaunchWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | +| **url** | **string?** | URL to open (alternative to the request body). | [optional] | +| **webInspectorLaunchRequest** | [**WebInspectorLaunchRequest?**](WebInspectorLaunchRequest?.md) | | [optional] | + +### Return type + +[**WebInspectorLaunchResult**](WebInspectorLaunchResult.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **400** | 400 — malformed request (missing required query/body, bad payload). | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **424** | 424 — a device-side prerequisite is missing. Used by the WebInspector routes when Web Inspector / Remote Automation is not enabled on the device. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **WebInspectorWebInspectorPages** +> List<Object> WebInspectorWebInspectorPages (string udid) + +List inspectable pages + +List inspectable pages reported by the device (CLI: `ios webinspector list`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using GoIos.Sdk.Generated.Api; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace Example +{ + public class WebInspectorWebInspectorPagesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost:60105"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + var udid = "udid_example"; // string | + + try + { + // List inspectable pages + List result = apiInstance.WebInspectorWebInspectorPages(udid); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.WebInspectorWebInspectorPages: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the WebInspectorWebInspectorPagesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // List inspectable pages + ApiResponse> response = apiInstance.WebInspectorWebInspectorPagesWithHttpInfo(udid); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.WebInspectorWebInspectorPagesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **udid** | **string** | | | + +### Return type + +**List** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **401** | 401 — missing/invalid bearer token (when auth is enabled). | - | +| **404** | 404 — device (udid) not found. | - | +| **422** | 422 — empty/invalid udid. | - | +| **424** | 424 — a device-side prerequisite is missing. Used by the WebInspector routes when Web Inspector / Remote Automation is not enabled on the device. | - | +| **500** | 500 — internal error while talking to the device. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/DevModeRequest.md b/sdks/packages/csharp/src/Generated/docs/DevModeRequest.md new file mode 100644 index 000000000..6e00d6bfc --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/DevModeRequest.md @@ -0,0 +1,12 @@ +# GoIos.Sdk.Generated.Model.DevModeRequest +`POST /device/{udid}/devmode` request. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Action** | **string** | `enable` to turn developer mode on, `reveal` to expose the settings menu. | +**EnablePostRestart** | **bool** | When enabling, also arm developer mode to persist across the next reboot. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/DevModeState.md b/sdks/packages/csharp/src/Generated/docs/DevModeState.md new file mode 100644 index 000000000..0edc8fba6 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/DevModeState.md @@ -0,0 +1,11 @@ +# GoIos.Sdk.Generated.Model.DevModeState +`GET /device/{udid}/devmode` — developer mode state. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DeveloperModeEnabled** | **bool** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/DeviceDate.md b/sdks/packages/csharp/src/Generated/docs/DeviceDate.md new file mode 100644 index 000000000..d53883c7c --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/DeviceDate.md @@ -0,0 +1,12 @@ +# GoIos.Sdk.Generated.Model.DeviceDate +`GET /device/{udid}/date`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**FormatedDate** | **string** | Human-readable RFC850 date on the device. | +**TimeIntervalSince1970** | **double** | Device clock as Unix epoch seconds. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/DeviceEntry.md b/sdks/packages/csharp/src/Generated/docs/DeviceEntry.md new file mode 100644 index 000000000..8f3ec4673 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/DeviceEntry.md @@ -0,0 +1,17 @@ +# GoIos.Sdk.Generated.Model.DeviceEntry +A single device as returned by `GET /list`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DeviceID** | **int** | | +**MessageType** | **string** | | [optional] +**Properties** | [**DeviceProperties**](DeviceProperties.md) | | +**Address** | **string** | Network address for a device reached over the network / tunnel. | [optional] +**UserspaceTUN** | **bool** | True if reachable via the userspace TUN tunnel. | [optional] +**UserspaceTUNHost** | **string** | | [optional] +**UserspaceTUNPort** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/DeviceList.md b/sdks/packages/csharp/src/Generated/docs/DeviceList.md new file mode 100644 index 000000000..f1ebb1f10 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/DeviceList.md @@ -0,0 +1,11 @@ +# GoIos.Sdk.Generated.Model.DeviceList +Response of `GET /list`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**VarDeviceList** | [**List<DeviceEntry>**](DeviceEntry.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/DeviceName.md b/sdks/packages/csharp/src/Generated/docs/DeviceName.md new file mode 100644 index 000000000..daf021393 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/DeviceName.md @@ -0,0 +1,11 @@ +# GoIos.Sdk.Generated.Model.DeviceName +`GET /device/{udid}/devicename`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Devicename** | **string** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/DeviceProperties.md b/sdks/packages/csharp/src/Generated/docs/DeviceProperties.md new file mode 100644 index 000000000..1d11f5cf3 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/DeviceProperties.md @@ -0,0 +1,16 @@ +# GoIos.Sdk.Generated.Model.DeviceProperties +Low-level device properties reported by usbmuxd / lockdown. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ConnectionSpeed** | **int** | | [optional] +**ConnectionType** | **string** | | [optional] +**DeviceID** | **int** | | [optional] +**LocationID** | **int** | | [optional] +**ProductID** | **int** | | [optional] +**SerialNumber** | **string** | The device udid (serial number). This is what device-scoped routes key on. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/DevicesGetJob404Response.md b/sdks/packages/csharp/src/Generated/docs/DevicesGetJob404Response.md new file mode 100644 index 000000000..6e7db6a6a --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/DevicesGetJob404Response.md @@ -0,0 +1,11 @@ +# GoIos.Sdk.Generated.Model.DevicesGetJob404Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | Human-readable success or status message. | [optional] +**Error** | **string** | Human-readable error message. Present on failures. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/DevicesGetWdaSession404Response.md b/sdks/packages/csharp/src/Generated/docs/DevicesGetWdaSession404Response.md new file mode 100644 index 000000000..ffff2191d --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/DevicesGetWdaSession404Response.md @@ -0,0 +1,11 @@ +# GoIos.Sdk.Generated.Model.DevicesGetWdaSession404Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | Human-readable success or status message. | [optional] +**Error** | **string** | Human-readable error message. Present on failures. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/DiskSpaceInfo.md b/sdks/packages/csharp/src/Generated/docs/DiskSpaceInfo.md new file mode 100644 index 000000000..abf4b882e --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/DiskSpaceInfo.md @@ -0,0 +1,14 @@ +# GoIos.Sdk.Generated.Model.DiskSpaceInfo +`GET /device/{udid}/diskspace` — AFC filesystem info (`afc.DeviceInfo`). Total/free/used bytes and block size. Open map; common keys surfaced. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**FSTotalBytes** | **long** | Total filesystem capacity in bytes. | [optional] +**FSFreeBytes** | **long** | Free filesystem space in bytes. | [optional] +**FSBlockSize** | **long** | Filesystem block size in bytes. | [optional] +**Model** | **string** | AFC model identifier reported by the device. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/EnabledRequest.md b/sdks/packages/csharp/src/Generated/docs/EnabledRequest.md new file mode 100644 index 000000000..9f8817255 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/EnabledRequest.md @@ -0,0 +1,11 @@ +# GoIos.Sdk.Generated.Model.EnabledRequest +Request body for the `enabled`-toggle settings endpoints. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enabled** | **bool** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/FileDomain.md b/sdks/packages/csharp/src/Generated/docs/FileDomain.md new file mode 100644 index 000000000..c4c492f63 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/FileDomain.md @@ -0,0 +1,10 @@ +# GoIos.Sdk.Generated.Model.FileDomain +Domain of the on-device file service. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/FileEntry.md b/sdks/packages/csharp/src/Generated/docs/FileEntry.md new file mode 100644 index 000000000..96f6c1f18 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/FileEntry.md @@ -0,0 +1,14 @@ +# GoIos.Sdk.Generated.Model.FileEntry +A single entry in a device directory listing. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] +**Path** | **string** | | [optional] +**IsDir** | **bool** | | [optional] +**Size** | **long** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/FileListing.md b/sdks/packages/csharp/src/Generated/docs/FileListing.md new file mode 100644 index 000000000..05b52e67e --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/FileListing.md @@ -0,0 +1,13 @@ +# GoIos.Sdk.Generated.Model.FileListing +`GET /device/{udid}/files` — directory listing. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Path** | **string** | | +**Files** | [**List<FileEntry>**](FileEntry.md) | | +**Count** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/FilePushResult.md b/sdks/packages/csharp/src/Generated/docs/FilePushResult.md new file mode 100644 index 000000000..f6f6a30ce --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/FilePushResult.md @@ -0,0 +1,12 @@ +# GoIos.Sdk.Generated.Model.FilePushResult +`POST /device/{udid}/files/push` — acknowledgement. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Remote** | **string** | | +**Size** | **long** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/ForwardRequest.md b/sdks/packages/csharp/src/Generated/docs/ForwardRequest.md new file mode 100644 index 000000000..8d800925a --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/ForwardRequest.md @@ -0,0 +1,12 @@ +# GoIos.Sdk.Generated.Model.ForwardRequest +`POST /device/{udid}/jobs/forward` request. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**HostPort** | **int** | Local (host) TCP port to listen on. | +**TargetPort** | **int** | Device TCP port to forward to. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/FsyncListing.md b/sdks/packages/csharp/src/Generated/docs/FsyncListing.md new file mode 100644 index 000000000..9142db77d --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/FsyncListing.md @@ -0,0 +1,13 @@ +# GoIos.Sdk.Generated.Model.FsyncListing +`GET /device/{udid}/fsync/ls` — a directory listing over AFC. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Path** | **string** | The listed (cleaned) device path. | +**Files** | **List<string>** | File/directory names in the listed directory. | +**Count** | **int** | Number of entries. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/FsyncMessage.md b/sdks/packages/csharp/src/Generated/docs/FsyncMessage.md new file mode 100644 index 000000000..38291dd22 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/FsyncMessage.md @@ -0,0 +1,12 @@ +# GoIos.Sdk.Generated.Model.FsyncMessage +`POST /device/{udid}/fsync/mkdir` and `DELETE /device/{udid}/fsync/rm` — simple message + path acknowledgement. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | Human-readable result message (e.g. `created`, `removed`). | +**Path** | **string** | The (cleaned) device path acted on. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/FsyncPushResult.md b/sdks/packages/csharp/src/Generated/docs/FsyncPushResult.md new file mode 100644 index 000000000..2518693e3 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/FsyncPushResult.md @@ -0,0 +1,12 @@ +# GoIos.Sdk.Generated.Model.FsyncPushResult +`POST /device/{udid}/fsync/push` — result of an upload over AFC. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Path** | **string** | Destination device path written. | +**Size** | **long** | Number of bytes written. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/FsyncTreeEntry.md b/sdks/packages/csharp/src/Generated/docs/FsyncTreeEntry.md new file mode 100644 index 000000000..ba482c2a3 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/FsyncTreeEntry.md @@ -0,0 +1,14 @@ +# GoIos.Sdk.Generated.Model.FsyncTreeEntry +One entry returned by the recursive `GET /device/{udid}/fsync/tree` walk. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Path** | **string** | Full device-side path of this entry. | +**Name** | **string** | Base name of the entry. | +**IsDir** | **bool** | Whether the entry is a directory. | +**Size** | **long** | Size in bytes. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/FsyncTreeListing.md b/sdks/packages/csharp/src/Generated/docs/FsyncTreeListing.md new file mode 100644 index 000000000..02044c006 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/FsyncTreeListing.md @@ -0,0 +1,13 @@ +# GoIos.Sdk.Generated.Model.FsyncTreeListing +`GET /device/{udid}/fsync/tree` — a recursive directory walk over AFC. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Path** | **string** | The root (cleaned) device path. | +**Entries** | [**List<FsyncTreeEntry>**](FsyncTreeEntry.md) | Flattened list of entries in the subtree. | +**Count** | **int** | Number of entries. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/GenericResponse.md b/sdks/packages/csharp/src/Generated/docs/GenericResponse.md new file mode 100644 index 000000000..f85c9d713 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/GenericResponse.md @@ -0,0 +1,12 @@ +# GoIos.Sdk.Generated.Model.GenericResponse +The dominant response envelope used across the API. Success responses set `message`; error responses set `error`. Streaming/middleware paths that emit `gin.H{\"error\"|\"message\"}` are compatible with this shape. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | Human-readable success or status message. | [optional] +**Error** | **string** | Human-readable error message. Present on failures. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/Job.md b/sdks/packages/csharp/src/Generated/docs/Job.md new file mode 100644 index 000000000..bed524965 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/Job.md @@ -0,0 +1,18 @@ +# GoIos.Sdk.Generated.Model.Job +A long-running operation started via the REST API (test run, WDA runner, port forward). Mirrors the server's `jobView`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | Opaque job id, e.g. `runtest-3`. | +**Kind** | **string** | Job kind: `runtest`, `runwda` or `forward`. | +**Udid** | **string** | The device udid the job runs on. | +**Status** | [**JobStatus**](JobStatus.md) | | +**StartedAt** | **DateTimeOffset** | When the job started (ISO-8601). | +**FinishedAt** | **DateTimeOffset** | When the job reached a terminal state (absent while running). | [optional] +**Error** | **string** | Error message when `status` is `failed`. | [optional] +**Result** | **Object** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/JobLogEvents.md b/sdks/packages/csharp/src/Generated/docs/JobLogEvents.md new file mode 100644 index 000000000..5ccd411c5 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/JobLogEvents.md @@ -0,0 +1,10 @@ +# GoIos.Sdk.Generated.Model.JobLogEvents + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Line** | **string** | The raw log line (already newline-terminated in the buffer). | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/JobLogLine.md b/sdks/packages/csharp/src/Generated/docs/JobLogLine.md new file mode 100644 index 000000000..f11fc85ec --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/JobLogLine.md @@ -0,0 +1,11 @@ +# GoIos.Sdk.Generated.Model.JobLogLine +A single line of a job's log output. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Line** | **string** | The raw log line (already newline-terminated in the buffer). | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/JobStatus.md b/sdks/packages/csharp/src/Generated/docs/JobStatus.md new file mode 100644 index 000000000..971218b7e --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/JobStatus.md @@ -0,0 +1,10 @@ +# GoIos.Sdk.Generated.Model.JobStatus +Job lifecycle state. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/LanguageConfiguration.md b/sdks/packages/csharp/src/Generated/docs/LanguageConfiguration.md new file mode 100644 index 000000000..0e231c196 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/LanguageConfiguration.md @@ -0,0 +1,14 @@ +# GoIos.Sdk.Generated.Model.LanguageConfiguration +Language/locale configuration (`ios.LanguageConfiguration`), returned by `GET/PUT /device/{udid}/lang`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Language** | **string** | | [optional] +**Locale** | **string** | | [optional] +**SupportedLocales** | **List<string>** | Supported locales advertised by the device. | [optional] +**SupportedLanguages** | **List<string>** | Supported UI languages advertised by the device. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/ListenEvents.md b/sdks/packages/csharp/src/Generated/docs/ListenEvents.md new file mode 100644 index 000000000..215ae64fe --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/ListenEvents.md @@ -0,0 +1,13 @@ +# GoIos.Sdk.Generated.Model.ListenEvents + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Event** | **string** | Event kind. `attached` when a device connects, `detached` when it disconnects, `paired` when a pairing record appears. | +**DeviceID** | **int** | usbmuxd device id. | [optional] +**Udid** | **string** | The device udid (serial number), when known. | [optional] +**Properties** | [**DeviceProperties**](DeviceProperties.md) | Full device properties, present on `attached`. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/MemLimitRequest.md b/sdks/packages/csharp/src/Generated/docs/MemLimitRequest.md new file mode 100644 index 000000000..7b52eef3b --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/MemLimitRequest.md @@ -0,0 +1,11 @@ +# GoIos.Sdk.Generated.Model.MemLimitRequest +`POST /device/{udid}/memlimitoff` request. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Process** | **string** | Process name whose memory limit should be waived. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/MemLimitResult.md b/sdks/packages/csharp/src/Generated/docs/MemLimitResult.md new file mode 100644 index 000000000..cf481cfe0 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/MemLimitResult.md @@ -0,0 +1,13 @@ +# GoIos.Sdk.Generated.Model.MemLimitResult +`POST /device/{udid}/memlimitoff` response. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Process** | **string** | | +**Pid** | **int** | | +**Disabled** | **bool** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/MountedImages.md b/sdks/packages/csharp/src/Generated/docs/MountedImages.md new file mode 100644 index 000000000..afc2fd3e2 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/MountedImages.md @@ -0,0 +1,12 @@ +# GoIos.Sdk.Generated.Model.MountedImages +`GET /device/{udid}/image/list` — mounted DDI signatures. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Signatures** | **List<string>** | Hex-encoded image signatures. | +**Count** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/NetworkInfo.md b/sdks/packages/csharp/src/Generated/docs/NetworkInfo.md new file mode 100644 index 000000000..3e2fb57c1 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/NetworkInfo.md @@ -0,0 +1,13 @@ +# GoIos.Sdk.Generated.Model.NetworkInfo +`GET /device/{udid}/ip` — device network info discovered over pcapd (`pcap.NetworkInfo`). + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MacAddress** | **string** | Hardware (MAC) address. | [optional] +**IPv4** | **string** | IPv4 address, when discovered. | [optional] +**IPv6** | **string** | IPv6 address, when discovered. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/NotificationEvents.md b/sdks/packages/csharp/src/Generated/docs/NotificationEvents.md new file mode 100644 index 000000000..70292f2c6 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/NotificationEvents.md @@ -0,0 +1,12 @@ +# GoIos.Sdk.Generated.Model.NotificationEvents + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BundleId** | **string** | Bundle id of the app whose state changed. | +**State** | **string** | New application state. Typical values: `foreground`, `background`, `suspended`, `terminated`, `unknown`. | +**Timestamp** | **long** | Unix epoch milliseconds when the change was observed. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/OsTraceEntry.md b/sdks/packages/csharp/src/Generated/docs/OsTraceEntry.md new file mode 100644 index 000000000..c6aadd572 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/OsTraceEntry.md @@ -0,0 +1,17 @@ +# GoIos.Sdk.Generated.Model.OsTraceEntry +A structured os_log trace entry. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Pid** | **int** | Process id that emitted the entry. | [optional] +**ProcessName** | **string** | Emitting process/executable name. | [optional] +**Level** | **string** | Log level, e.g. `default`, `info`, `debug`, `error`, `fault`. | [optional] +**Subsystem** | **string** | Subsystem string (e.g. `com.apple.network`). | [optional] +**Category** | **string** | Category within the subsystem. | [optional] +**Message** | **string** | The formatted log message. | +**Timestamp** | **long** | Unix epoch milliseconds when the entry was emitted, if known. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/OsTraceEvents.md b/sdks/packages/csharp/src/Generated/docs/OsTraceEvents.md new file mode 100644 index 000000000..59bd397d1 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/OsTraceEvents.md @@ -0,0 +1,16 @@ +# GoIos.Sdk.Generated.Model.OsTraceEvents + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Pid** | **int** | Process id that emitted the entry. | [optional] +**ProcessName** | **string** | Emitting process/executable name. | [optional] +**Level** | **string** | Log level, e.g. `default`, `info`, `debug`, `error`, `fault`. | [optional] +**Subsystem** | **string** | Subsystem string (e.g. `com.apple.network`). | [optional] +**Category** | **string** | Category within the subsystem. | [optional] +**Message** | **string** | The formatted log message. | +**Timestamp** | **long** | Unix epoch milliseconds when the entry was emitted, if known. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/PasteboardContent.md b/sdks/packages/csharp/src/Generated/docs/PasteboardContent.md new file mode 100644 index 000000000..0d32fa041 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/PasteboardContent.md @@ -0,0 +1,12 @@ +# GoIos.Sdk.Generated.Model.PasteboardContent +`GET /device/{udid}/pasteboard` — clipboard contents. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Present** | **bool** | Whether any text was present on the pasteboard. | +**Text** | **string** | The clipboard text (empty when `present` is false). | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/PrepareResult.md b/sdks/packages/csharp/src/Generated/docs/PrepareResult.md new file mode 100644 index 000000000..687a1128a --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/PrepareResult.md @@ -0,0 +1,12 @@ +# GoIos.Sdk.Generated.Model.PrepareResult +`POST /device/{udid}/prepare` — device preparation acknowledgement. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Status** | **string** | Always `prepared`. | +**Supervised** | **bool** | Whether the device was supervised (a supervision cert was supplied). | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/PrepareSkipOptions.md b/sdks/packages/csharp/src/Generated/docs/PrepareSkipOptions.md new file mode 100644 index 000000000..16744cf80 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/PrepareSkipOptions.md @@ -0,0 +1,12 @@ +# GoIos.Sdk.Generated.Model.PrepareSkipOptions +`GET /prepare/skip-options` — the static list of setup-pane skip options usable when preparing a device. Host-scoped (device-free). + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Options** | **List<string>** | All available skip-option identifiers. | +**Count** | **int** | Number of options. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/ProcessInfo.md b/sdks/packages/csharp/src/Generated/docs/ProcessInfo.md new file mode 100644 index 000000000..886c6fc29 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/ProcessInfo.md @@ -0,0 +1,15 @@ +# GoIos.Sdk.Generated.Model.ProcessInfo +A running process entry (`instruments.ProcessInfo`) from `GET /device/{udid}/processes`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Pid** | **int** | | +**Name** | **string** | | +**RealAppName** | **string** | | [optional] +**IsApplication** | **bool** | | [optional] +**StartDate** | **DateTimeOffset** | Process start time, ISO-8601. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/Profile.md b/sdks/packages/csharp/src/Generated/docs/Profile.md new file mode 100644 index 000000000..8375bd041 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/Profile.md @@ -0,0 +1,13 @@ +# GoIos.Sdk.Generated.Model.Profile +A single condition profile within a `ProfileType`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Description** | **string** | | [optional] +**Identifier** | **string** | | +**Name** | **string** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/ProfileType.md b/sdks/packages/csharp/src/Generated/docs/ProfileType.md new file mode 100644 index 000000000..85aabf04f --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/ProfileType.md @@ -0,0 +1,18 @@ +# GoIos.Sdk.Generated.Model.ProfileType +A condition inducer profile type (e.g. thermal, network) with its variants. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ActiveProfile** | **string** | | [optional] +**Identifier** | **string** | | +**ProfilesSorted** | **bool** | | [optional] +**IsActive** | **bool** | | [optional] +**Name** | **string** | | +**IsDestructive** | **bool** | | [optional] +**IsInternal** | **bool** | | [optional] +**Profiles** | [**List<Profile>**](Profile.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/ProvisioningResult.md b/sdks/packages/csharp/src/Generated/docs/ProvisioningResult.md new file mode 100644 index 000000000..1db5faefa --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/ProvisioningResult.md @@ -0,0 +1,15 @@ +# GoIos.Sdk.Generated.Model.ProvisioningResult +`POST /sign/provision` — provisioning assets envelope. The mobileprovision (and optionally the P12) are base64-encoded so one JSON response can carry both binary artifacts. Host-scoped (device-free). + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BundleId** | **string** | The app bundle identifier registered with App Store Connect. | +**CertificateId** | **string** | The signing certificate resource id. | +**MobileprovisionBase64** | **string** | The `.mobileprovision`, base64-encoded. | +**P12Base64** | **string** | The generated `.p12`, base64-encoded (absent when reusing a certificate). | [optional] +**P12Password** | **string** | The password protecting `p12Base64`, echoed back (client-supplied). | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/RsdServiceEntry.md b/sdks/packages/csharp/src/Generated/docs/RsdServiceEntry.md new file mode 100644 index 000000000..01d521736 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/RsdServiceEntry.md @@ -0,0 +1,12 @@ +# GoIos.Sdk.Generated.Model.RsdServiceEntry +A single RSD (Remote Service Discovery) service entry. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Port** | **int** | TCP port the service is reachable on over the tunnel. | [optional] +**ProtocolType** | **string** | Wire protocol (e.g. `tcp`). | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/RunTestRequest.md b/sdks/packages/csharp/src/Generated/docs/RunTestRequest.md new file mode 100644 index 000000000..07b125a2c --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/RunTestRequest.md @@ -0,0 +1,18 @@ +# GoIos.Sdk.Generated.Model.RunTestRequest +`POST /device/{udid}/jobs/runtest` (and `runwda`) request. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BundleId** | **string** | Bundle id of the app under test. | [optional] +**TestRunnerBundleId** | **string** | Bundle id of the test runner. Defaults to `bundleId` if omitted. | [optional] +**XctestConfig** | **string** | Name of the `.xctestconfiguration`. | [optional] +**Env** | **Object** | Extra environment variables for the test runner. | [optional] +**Args** | **List<string>** | Extra process arguments for the test runner. | [optional] +**TestsToRun** | **List<string>** | Only run these tests (`Class/method` identifiers). | [optional] +**TestsToSkip** | **List<string>** | Skip these tests. | [optional] +**Xctest** | **bool** | Run as a plain XCTest (vs XCUITest). | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/SetLanguageRequest.md b/sdks/packages/csharp/src/Generated/docs/SetLanguageRequest.md new file mode 100644 index 000000000..6862126f1 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/SetLanguageRequest.md @@ -0,0 +1,12 @@ +# GoIos.Sdk.Generated.Model.SetLanguageRequest +`PUT /device/{udid}/lang` request. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Language** | **string** | | [optional] +**Locale** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/StatusOk.md b/sdks/packages/csharp/src/Generated/docs/StatusOk.md new file mode 100644 index 000000000..6745f0a56 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/StatusOk.md @@ -0,0 +1,11 @@ +# GoIos.Sdk.Generated.Model.StatusOk +Simple `{ \"status\": \"ok\" }` acknowledgement used by MDM clear operations. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Status** | **string** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/SupervisionCert.md b/sdks/packages/csharp/src/Generated/docs/SupervisionCert.md new file mode 100644 index 000000000..e8e9e46a8 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/SupervisionCert.md @@ -0,0 +1,14 @@ +# GoIos.Sdk.Generated.Model.SupervisionCert +`POST /prepare/create-cert` — a generated self-signed supervision identity, returned as DER (base64) and PEM for both the certificate and private key. Host-scoped (device-free). + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CertDerBase64** | **string** | Certificate in DER form, base64-encoded. | +**CertPem** | **string** | Certificate in PEM form. | +**PrivateKeyDerBase64** | **string** | Private key in DER form, base64-encoded. | +**PrivateKeyPem** | **string** | Private key in PEM form. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/SyslogEvents.md b/sdks/packages/csharp/src/Generated/docs/SyslogEvents.md new file mode 100644 index 000000000..0e7625682 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/SyslogEvents.md @@ -0,0 +1,11 @@ +# GoIos.Sdk.Generated.Model.SyslogEvents + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | The raw log message text. | +**Timestamp** | **long** | Unix epoch milliseconds when the line was emitted, if known. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/SyslogMessage.md b/sdks/packages/csharp/src/Generated/docs/SyslogMessage.md new file mode 100644 index 000000000..db41772de --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/SyslogMessage.md @@ -0,0 +1,12 @@ +# GoIos.Sdk.Generated.Model.SyslogMessage +A single syslog line from the device. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | The raw log message text. | +**Timestamp** | **long** | Unix epoch milliseconds when the line was emitted, if known. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/SysmontapEvents.md b/sdks/packages/csharp/src/Generated/docs/SysmontapEvents.md new file mode 100644 index 000000000..15b3b8793 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/SysmontapEvents.md @@ -0,0 +1,12 @@ +# GoIos.Sdk.Generated.Model.SysmontapEvents + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CPUTotalLoad** | **double** | Total CPU load across all cores (0–100). | [optional] +**SystemLoad** | **double** | System (kernel) CPU load. | [optional] +**UserLoad** | **double** | User CPU load. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/TimeFormatRequest.md b/sdks/packages/csharp/src/Generated/docs/TimeFormatRequest.md new file mode 100644 index 000000000..2ab00bd36 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/TimeFormatRequest.md @@ -0,0 +1,11 @@ +# GoIos.Sdk.Generated.Model.TimeFormatRequest +`PUT /device/{udid}/timeformat` request. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Uses24Hour** | **bool** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/TimeFormatState.md b/sdks/packages/csharp/src/Generated/docs/TimeFormatState.md new file mode 100644 index 000000000..22cd6bb4c --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/TimeFormatState.md @@ -0,0 +1,11 @@ +# GoIos.Sdk.Generated.Model.TimeFormatState +`GET /device/{udid}/timeformat` — 24-hour clock state. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Uses24HourClock** | **bool** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/Tunnel.md b/sdks/packages/csharp/src/Generated/docs/Tunnel.md new file mode 100644 index 000000000..fa95140aa --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/Tunnel.md @@ -0,0 +1,15 @@ +# GoIos.Sdk.Generated.Model.Tunnel +A running device tunnel as reported by the tunnel agent (`GET /tunnels`, `POST /tunnels/{udid}/refresh`). Mirrors `tunnel.Tunnel`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Udid** | **string** | The device udid this tunnel serves. | +**Address** | **string** | Tunnel address (IPv6) reachable for RemoteXPC/RSD. | +**RsdPort** | **int** | RemoteServiceDiscovery port on the tunnel. | +**UserspaceTUN** | **bool** | Whether this tunnel is a userspace TUN. | [optional] +**UserspaceTUNPort** | **int** | Userspace TUN port, when `UserspaceTUN` is true. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/TunnelStopped.md b/sdks/packages/csharp/src/Generated/docs/TunnelStopped.md new file mode 100644 index 000000000..0068a1c38 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/TunnelStopped.md @@ -0,0 +1,12 @@ +# GoIos.Sdk.Generated.Model.TunnelStopped +`DELETE /tunnels/{udid}` — acknowledgement that the tunnel was stopped. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Udid** | **string** | | +**Status** | **string** | Always `stopped`. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/UIAPIRequest.md b/sdks/packages/csharp/src/Generated/docs/UIAPIRequest.md new file mode 100644 index 000000000..a268bff6f --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/UIAPIRequest.md @@ -0,0 +1,15 @@ +# GoIos.Sdk.Generated.Model.UIAPIRequest +`POST /device/{udid}/ui/api` request — raw passthrough to the backend (`uidriver.APIRequest`). For WDA supply `method`/`path`/`body`; for DeviceKit supply `rpcMethod`/`rpcParams`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Method** | **string** | HTTP method for a WDA passthrough (defaults to GET). | [optional] +**Path** | **string** | HTTP path for a WDA passthrough (required for the wda backend). | [optional] +**Body** | **string** | Raw HTTP request body for a WDA passthrough (base64 bytes on the wire). | [optional] +**RpcMethod** | **string** | JSON-RPC method name for a DeviceKit passthrough. | [optional] +**RpcParams** | **Object** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/UIAppRequest.md b/sdks/packages/csharp/src/Generated/docs/UIAppRequest.md new file mode 100644 index 000000000..63d7c5a2a --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/UIAppRequest.md @@ -0,0 +1,11 @@ +# GoIos.Sdk.Generated.Model.UIAppRequest +`POST /device/{udid}/ui/app/{launch,terminate}` request. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BundleId** | **string** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/UIButtonRequest.md b/sdks/packages/csharp/src/Generated/docs/UIButtonRequest.md new file mode 100644 index 000000000..59ee7f1f1 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/UIButtonRequest.md @@ -0,0 +1,11 @@ +# GoIos.Sdk.Generated.Model.UIButtonRequest +`POST /device/{udid}/ui/button` request — hardware button by name. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | Button name (e.g. `home`, `volumeup`). WDA supports only `home`. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/UILongPressRequest.md b/sdks/packages/csharp/src/Generated/docs/UILongPressRequest.md new file mode 100644 index 000000000..152af3e76 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/UILongPressRequest.md @@ -0,0 +1,13 @@ +# GoIos.Sdk.Generated.Model.UILongPressRequest +`POST /device/{udid}/ui/longpress` request — press and hold at (x,y). + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**X** | **int** | | +**Y** | **int** | | +**Duration** | **double** | Hold duration in seconds. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/UIOrientationRequest.md b/sdks/packages/csharp/src/Generated/docs/UIOrientationRequest.md new file mode 100644 index 000000000..3765bf3c0 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/UIOrientationRequest.md @@ -0,0 +1,11 @@ +# GoIos.Sdk.Generated.Model.UIOrientationRequest +`PUT /device/{udid}/ui/orientation` request. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Orientation** | **string** | Target orientation (e.g. `PORTRAIT`, `LANDSCAPE`). | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/UISwipeRequest.md b/sdks/packages/csharp/src/Generated/docs/UISwipeRequest.md new file mode 100644 index 000000000..b1d666053 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/UISwipeRequest.md @@ -0,0 +1,15 @@ +# GoIos.Sdk.Generated.Model.UISwipeRequest +`POST /device/{udid}/ui/swipe` request — drag from (x1,y1) to (x2,y2). + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**X1** | **int** | | +**Y1** | **int** | | +**X2** | **int** | | +**Y2** | **int** | | +**Duration** | **double** | Gesture duration in seconds. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/UITapRequest.md b/sdks/packages/csharp/src/Generated/docs/UITapRequest.md new file mode 100644 index 000000000..9a465636f --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/UITapRequest.md @@ -0,0 +1,12 @@ +# GoIos.Sdk.Generated.Model.UITapRequest +`POST /device/{udid}/ui/tap` request — absolute coordinates. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**X** | **int** | | +**Y** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/UITypeRequest.md b/sdks/packages/csharp/src/Generated/docs/UITypeRequest.md new file mode 100644 index 000000000..7b2576ea3 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/UITypeRequest.md @@ -0,0 +1,11 @@ +# GoIos.Sdk.Generated.Model.UITypeRequest +`POST /device/{udid}/ui/type` request — keyboard input. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Text** | **string** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/UnlockToken.md b/sdks/packages/csharp/src/Generated/docs/UnlockToken.md new file mode 100644 index 000000000..fa90c0d32 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/UnlockToken.md @@ -0,0 +1,11 @@ +# GoIos.Sdk.Generated.Model.UnlockToken +`POST /device/{udid}/mdm/fetch-unlock-token` — base64 escrow unlock token. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Token** | **string** | Base64-encoded escrow unlock token. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/VoiceOverState.md b/sdks/packages/csharp/src/Generated/docs/VoiceOverState.md new file mode 100644 index 000000000..c1ea8a70e --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/VoiceOverState.md @@ -0,0 +1,11 @@ +# GoIos.Sdk.Generated.Model.VoiceOverState +`GET|PUT /device/{udid}/voiceover` — VoiceOver enabled state. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**VoiceOverEnabled** | **bool** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/WdaConfig.md b/sdks/packages/csharp/src/Generated/docs/WdaConfig.md new file mode 100644 index 000000000..2d0dc3f0e --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/WdaConfig.md @@ -0,0 +1,15 @@ +# GoIos.Sdk.Generated.Model.WdaConfig +Configuration for launching a WebDriverAgent (XCUITest) runner session. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BundleId** | **string** | Bundle id of the WDA runner host app (e.g. `com.facebook.WebDriverAgentRunner.xctrunner`). | +**TestBundleId** | **string** | Bundle id of the XCTest test bundle. | +**XcTestConfig** | **string** | Path/name of the `.xctestconfiguration` to use. | +**Args** | **List<string>** | Extra process arguments passed to the runner. | [optional] +**Env** | **Object** | Extra environment variables passed to the runner. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/WdaSession.md b/sdks/packages/csharp/src/Generated/docs/WdaSession.md new file mode 100644 index 000000000..2dc491473 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/WdaSession.md @@ -0,0 +1,13 @@ +# GoIos.Sdk.Generated.Model.WdaSession +A running WebDriverAgent session. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Config** | [**WdaConfig**](WdaConfig.md) | The configuration the session was started with. | +**SessionId** | **string** | Opaque session identifier. | +**Udid** | **string** | The device udid the session runs on. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/WebInspectorEvalRequest.md b/sdks/packages/csharp/src/Generated/docs/WebInspectorEvalRequest.md new file mode 100644 index 000000000..20a47602a --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/WebInspectorEvalRequest.md @@ -0,0 +1,13 @@ +# GoIos.Sdk.Generated.Model.WebInspectorEvalRequest +`POST /device/{udid}/webinspector/eval` request body. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Page** | **string** | Inspectable page key. When empty the first matching web/javascript page (optionally scoped by `bundleId`) is used. | [optional] +**BundleId** | **string** | Optional bundle id to scope page selection. | [optional] +**Script** | **string** | JavaScript source to evaluate. Required. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/WebInspectorEvalResult.md b/sdks/packages/csharp/src/Generated/docs/WebInspectorEvalResult.md new file mode 100644 index 000000000..4f7d23b88 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/WebInspectorEvalResult.md @@ -0,0 +1,12 @@ +# GoIos.Sdk.Generated.Model.WebInspectorEvalResult +`POST /device/{udid}/webinspector/eval` — evaluation result. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Page** | **string** | The page key the script ran in. | +**Result** | **Object** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/WebInspectorLaunchRequest.md b/sdks/packages/csharp/src/Generated/docs/WebInspectorLaunchRequest.md new file mode 100644 index 000000000..ccb4e6e3e --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/WebInspectorLaunchRequest.md @@ -0,0 +1,12 @@ +# GoIos.Sdk.Generated.Model.WebInspectorLaunchRequest +`POST /device/{udid}/webinspector/launch` request body. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Url** | **string** | URL to open. May alternatively be supplied as the `url` query param. | [optional] +**BundleId** | **string** | Bundle id to open the URL in. Defaults to Safari. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/WebInspectorLaunchResult.md b/sdks/packages/csharp/src/Generated/docs/WebInspectorLaunchResult.md new file mode 100644 index 000000000..8010e19fb --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/WebInspectorLaunchResult.md @@ -0,0 +1,13 @@ +# GoIos.Sdk.Generated.Model.WebInspectorLaunchResult +`POST /device/{udid}/webinspector/launch` — result of opening a URL. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BundleId** | **string** | Bundle id the page was opened in. | +**Url** | **string** | The resolved current URL after navigation. | +**Title** | **string** | The page title after navigation. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/WifiRequest.md b/sdks/packages/csharp/src/Generated/docs/WifiRequest.md new file mode 100644 index 000000000..10208876d --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/WifiRequest.md @@ -0,0 +1,13 @@ +# GoIos.Sdk.Generated.Model.WifiRequest +`PUT /device/{udid}/wifi` request. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Ssid** | **string** | | +**Password** | **string** | | [optional] +**EncType** | **string** | Encryption type, e.g. `WPA2`, `WPA`, `WEP`, `None`. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/docs/ZoomTouchState.md b/sdks/packages/csharp/src/Generated/docs/ZoomTouchState.md new file mode 100644 index 000000000..32529f9e4 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/docs/ZoomTouchState.md @@ -0,0 +1,11 @@ +# GoIos.Sdk.Generated.Model.ZoomTouchState +`GET|PUT /device/{udid}/zoom` — ZoomTouch enabled state. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ZoomTouchEnabled** | **bool** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Api/DefaultApi.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Api/DefaultApi.cs new file mode 100644 index 000000000..b83ce66f8 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Api/DefaultApi.cs @@ -0,0 +1,24772 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Net.Mime; +using GoIos.Sdk.Generated.Client; +using GoIos.Sdk.Generated.Model; + +namespace GoIos.Sdk.Generated.Api +{ + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IDefaultApiSync : IApiAccessor + { + #region Synchronous Operations + /// + /// Get accessibility element snapshot + /// + /// + /// Get a snapshot of the currently focused accessibility element (CLI: `ios ax`). + /// + /// Thrown when fails to make API call + /// + /// Object + Object AccessibilityGetAxSnapshot(string udid); + + /// + /// Get accessibility element snapshot + /// + /// + /// Get a snapshot of the currently focused accessibility element (CLI: `ios ax`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + ApiResponse AccessibilityGetAxSnapshotWithHttpInfo(string udid); + /// + /// Get VoiceOver state + /// + /// + /// Get VoiceOver enabled state (CLI: `ios voiceover get`). + /// + /// Thrown when fails to make API call + /// + /// VoiceOverState + VoiceOverState AccessibilityGetVoiceOver(string udid); + + /// + /// Get VoiceOver state + /// + /// + /// Get VoiceOver enabled state (CLI: `ios voiceover get`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of VoiceOverState + ApiResponse AccessibilityGetVoiceOverWithHttpInfo(string udid); + /// + /// Get ZoomTouch state + /// + /// + /// Get ZoomTouch enabled state (CLI: `ios zoomtouch get`). + /// + /// Thrown when fails to make API call + /// + /// ZoomTouchState + ZoomTouchState AccessibilityGetZoomTouch(string udid); + + /// + /// Get ZoomTouch state + /// + /// + /// Get ZoomTouch enabled state (CLI: `ios zoomtouch get`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of ZoomTouchState + ApiResponse AccessibilityGetZoomTouchWithHttpInfo(string udid); + /// + /// Run accessibility audit + /// + /// + /// Run the accessibility audit against the focused app and return the issues found (CLI: `ios ax audit`). Bounded by `timeout` (seconds, default 60). + /// + /// Thrown when fails to make API call + /// + /// Audit timeout in seconds (default 60). (optional) + /// List<Object> + List AccessibilityRunAxAudit(string udid, int? timeout = default); + + /// + /// Run accessibility audit + /// + /// + /// Run the accessibility audit against the focused app and return the issues found (CLI: `ios ax audit`). Bounded by `timeout` (seconds, default 60). + /// + /// Thrown when fails to make API call + /// + /// Audit timeout in seconds (default 60). (optional) + /// ApiResponse of List<Object> + ApiResponse> AccessibilityRunAxAuditWithHttpInfo(string udid, int? timeout = default); + /// + /// Simulate location from a GPX file + /// + /// + /// Simulate live location tracking from an uploaded GPX file (CLI: `ios setlocationgpx`). Send multipart/form-data with a `gpx` file. + /// + /// Thrown when fails to make API call + /// + /// + /// GenericResponse + GenericResponse AccessibilitySetLocationGpx(string udid, Object gpx); + + /// + /// Simulate location from a GPX file + /// + /// + /// Simulate live location tracking from an uploaded GPX file (CLI: `ios setlocationgpx`). Send multipart/form-data with a `gpx` file. + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of GenericResponse + ApiResponse AccessibilitySetLocationGpxWithHttpInfo(string udid, Object gpx); + /// + /// Set VoiceOver state + /// + /// + /// Enable/disable VoiceOver (CLI: `ios voiceover enable|disable`). The desired state comes from the JSON body or the `enabled` query param. + /// + /// Thrown when fails to make API call + /// + /// Desired state (alternative to the request body). (optional) + /// (optional) + /// VoiceOverState + VoiceOverState AccessibilitySetVoiceOver(string udid, bool? enabled = default, AXEnabledRequest? aXEnabledRequest = default); + + /// + /// Set VoiceOver state + /// + /// + /// Enable/disable VoiceOver (CLI: `ios voiceover enable|disable`). The desired state comes from the JSON body or the `enabled` query param. + /// + /// Thrown when fails to make API call + /// + /// Desired state (alternative to the request body). (optional) + /// (optional) + /// ApiResponse of VoiceOverState + ApiResponse AccessibilitySetVoiceOverWithHttpInfo(string udid, bool? enabled = default, AXEnabledRequest? aXEnabledRequest = default); + /// + /// Set ZoomTouch state + /// + /// + /// Enable/disable ZoomTouch (CLI: `ios zoomtouch enable|disable`). The desired state comes from the JSON body or the `enabled` query param. + /// + /// Thrown when fails to make API call + /// + /// Desired state (alternative to the request body). (optional) + /// (optional) + /// ZoomTouchState + ZoomTouchState AccessibilitySetZoomTouch(string udid, bool? enabled = default, AXEnabledRequest? aXEnabledRequest = default); + + /// + /// Set ZoomTouch state + /// + /// + /// Enable/disable ZoomTouch (CLI: `ios zoomtouch enable|disable`). The desired state comes from the JSON body or the `enabled` query param. + /// + /// Thrown when fails to make API call + /// + /// Desired state (alternative to the request body). (optional) + /// (optional) + /// ApiResponse of ZoomTouchState + ApiResponse AccessibilitySetZoomTouchWithHttpInfo(string udid, bool? enabled = default, AXEnabledRequest? aXEnabledRequest = default); + /// + /// Activate device + /// + /// + /// Activate the device (complete Setup Assistant / activation). + /// + /// Thrown when fails to make API call + /// + /// GenericResponse + GenericResponse DevicesActivate(string udid); + + /// + /// Activate device + /// + /// + /// Activate the device (complete Setup Assistant / activation). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of GenericResponse + ApiResponse DevicesActivateWithHttpInfo(string udid); + /// + /// Install profile + /// + /// + /// Install a configuration profile (CLI: `ios profile add`). Send the profile as the raw request body, or as multipart with a `profile` file plus an optional `p12` supervisor identity and `password` for a supervised install. + /// + /// Thrown when fails to make API call + /// + /// + /// (optional) + /// Passphrase for the `.p12` identity. (optional) + /// GenericResponse + GenericResponse DevicesAddProfile(string udid, Object profile, Object? p12 = default, string? password = default); + + /// + /// Install profile + /// + /// + /// Install a configuration profile (CLI: `ios profile add`). Send the profile as the raw request body, or as multipart with a `profile` file plus an optional `p12` supervisor identity and `password` for a supervised install. + /// + /// Thrown when fails to make API call + /// + /// + /// (optional) + /// Passphrase for the `.p12` identity. (optional) + /// ApiResponse of GenericResponse + ApiResponse DevicesAddProfileWithHttpInfo(string udid, Object profile, Object? p12 = default, string? password = default); + /// + /// Start WDA session + /// + /// + /// Start a WebDriverAgent (XCUITest) session. + /// + /// Thrown when fails to make API call + /// + /// + /// WdaSession + WdaSession DevicesCreateWdaSession(string udid, WdaConfig wdaConfig); + + /// + /// Start WDA session + /// + /// + /// Start a WebDriverAgent (XCUITest) session. + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of WdaSession + ApiResponse DevicesCreateWdaSessionWithHttpInfo(string udid, WdaConfig wdaConfig); + /// + /// Stop WDA session + /// + /// + /// Stop a running WebDriverAgent session. + /// + /// Thrown when fails to make API call + /// + /// The WDA session id. + /// WdaSession + WdaSession DevicesDeleteWdaSession(string udid, string sessionId); + + /// + /// Stop WDA session + /// + /// + /// Stop a running WebDriverAgent session. + /// + /// Thrown when fails to make API call + /// + /// The WDA session id. + /// ApiResponse of WdaSession + ApiResponse DevicesDeleteWdaSessionWithHttpInfo(string udid, string sessionId); + /// + /// Disable condition + /// + /// + /// Disable the currently active condition inducer profile. + /// + /// Thrown when fails to make API call + /// + /// GenericResponse + GenericResponse DevicesDisableCondition(string udid); + + /// + /// Disable condition + /// + /// + /// Disable the currently active condition inducer profile. + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of GenericResponse + ApiResponse DevicesDisableConditionWithHttpInfo(string udid); + /// + /// Enable condition + /// + /// + /// Enable a condition inducer profile. + /// + /// Thrown when fails to make API call + /// + /// Identifier of the condition profile type. + /// Identifier of the specific profile to activate. + /// GenericResponse + GenericResponse DevicesEnableCondition(string udid, string profileTypeID, string profileID); + + /// + /// Enable condition + /// + /// + /// Enable a condition inducer profile. + /// + /// Thrown when fails to make API call + /// + /// Identifier of the condition profile type. + /// Identifier of the specific profile to activate. + /// ApiResponse of GenericResponse + ApiResponse DevicesEnableConditionWithHttpInfo(string udid, string profileTypeID, string profileID); + /// + /// Erase device + /// + /// + /// Erase all content and settings (CLI: `ios erase`). Destructive: requires `confirm=true`. + /// + /// Thrown when fails to make API call + /// + /// Must be `true` to proceed with the destructive erase. + /// GenericResponse + GenericResponse DevicesErase(string udid, bool confirm); + + /// + /// Erase device + /// + /// + /// Erase all content and settings (CLI: `ios erase`). Destructive: requires `confirm=true`. + /// + /// Thrown when fails to make API call + /// + /// Must be `true` to proceed with the destructive erase. + /// ApiResponse of GenericResponse + ApiResponse DevicesEraseWithHttpInfo(string udid, bool confirm); + /// + /// Get AssistiveTouch + /// + /// + /// Get AssistiveTouch state (CLI: `ios assistivetouch get`). + /// + /// Thrown when fails to make API call + /// + /// AssistiveTouchState + AssistiveTouchState DevicesGetAssistiveTouch(string udid); + + /// + /// Get AssistiveTouch + /// + /// + /// Get AssistiveTouch state (CLI: `ios assistivetouch get`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of AssistiveTouchState + ApiResponse DevicesGetAssistiveTouchWithHttpInfo(string udid); + /// + /// Get battery info + /// + /// + /// Get battery diagnostics (CLI: `ios batterycheck`). + /// + /// Thrown when fails to make API call + /// + /// BatteryInfo + BatteryInfo DevicesGetBattery(string udid); + + /// + /// Get battery info + /// + /// + /// Get battery diagnostics (CLI: `ios batterycheck`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of BatteryInfo + ApiResponse DevicesGetBatteryWithHttpInfo(string udid); + /// + /// Get developer mode + /// + /// + /// Get developer mode state (CLI: `ios devmode get`). + /// + /// Thrown when fails to make API call + /// + /// DevModeState + DevModeState DevicesGetDevMode(string udid); + + /// + /// Get developer mode + /// + /// + /// Get developer mode state (CLI: `ios devmode get`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of DevModeState + ApiResponse DevicesGetDevModeWithHttpInfo(string udid); + /// + /// Get device date + /// + /// + /// Get the device clock (CLI: `ios date`). + /// + /// Thrown when fails to make API call + /// + /// DeviceDate + DeviceDate DevicesGetDeviceDate(string udid); + + /// + /// Get device date + /// + /// + /// Get the device clock (CLI: `ios date`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of DeviceDate + ApiResponse DevicesGetDeviceDateWithHttpInfo(string udid); + /// + /// Get device name + /// + /// + /// Get the device name (CLI: `ios devicename`). + /// + /// Thrown when fails to make API call + /// + /// DeviceName + DeviceName DevicesGetDeviceName(string udid); + + /// + /// Get device name + /// + /// + /// Get the device name (CLI: `ios devicename`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of DeviceName + ApiResponse DevicesGetDeviceNameWithHttpInfo(string udid); + /// + /// List diagnostics + /// + /// + /// List all IORegistry/diagnostic values (CLI: `ios diagnostics list`). + /// + /// Thrown when fails to make API call + /// + /// Object + Object DevicesGetDiagnostics(string udid); + + /// + /// List diagnostics + /// + /// + /// List all IORegistry/diagnostic values (CLI: `ios diagnostics list`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + ApiResponse DevicesGetDiagnosticsWithHttpInfo(string udid); + /// + /// Get icon layout + /// + /// + /// Get the SpringBoard icon layout (CLI: `ios get-icon-layout`). + /// + /// Thrown when fails to make API call + /// + /// Object + Object DevicesGetIconLayout(string udid); + + /// + /// Get icon layout + /// + /// + /// Get the SpringBoard icon layout (CLI: `ios get-icon-layout`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + ApiResponse DevicesGetIconLayoutWithHttpInfo(string udid); + /// + /// Get device info + /// + /// + /// Get lockdown values plus `instruments:*` keys for the device. Returns an open dictionary of heterogeneous values. + /// + /// Thrown when fails to make API call + /// + /// Object + Object DevicesGetInfo(string udid); + + /// + /// Get device info + /// + /// + /// Get lockdown values plus `instruments:*` keys for the device. Returns an open dictionary of heterogeneous values. + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + ApiResponse DevicesGetInfoWithHttpInfo(string udid); + /// + /// Get job + /// + /// + /// Get a job's status. Returns `404` for an unknown job on this device. + /// + /// Thrown when fails to make API call + /// + /// The job id. + /// Job + Job DevicesGetJob(string udid, string id); + + /// + /// Get job + /// + /// + /// Get a job's status. Returns `404` for an unknown job on this device. + /// + /// Thrown when fails to make API call + /// + /// The job id. + /// ApiResponse of Job + ApiResponse DevicesGetJobWithHttpInfo(string udid, string id); + /// + /// Get language + /// + /// + /// Get the device language/locale configuration (CLI: `ios lang`). + /// + /// Thrown when fails to make API call + /// + /// LanguageConfiguration + LanguageConfiguration DevicesGetLanguage(string udid); + + /// + /// Get language + /// + /// + /// Get the device language/locale configuration (CLI: `ios lang`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of LanguageConfiguration + ApiResponse DevicesGetLanguageWithHttpInfo(string udid); + /// + /// Get lockdown values + /// + /// + /// Get lockdown values (CLI: `ios lockdown get`). Without `domain` the full set is returned; with `domain` the values are scoped to that lockdown domain. + /// + /// Thrown when fails to make API call + /// + /// Optional lockdown domain to scope the returned values. (optional) + /// Object + Object DevicesGetLockdownValues(string udid, string? domain = default); + + /// + /// Get lockdown values + /// + /// + /// Get lockdown values (CLI: `ios lockdown get`). Without `domain` the full set is returned; with `domain` the values are scoped to that lockdown domain. + /// + /// Thrown when fails to make API call + /// + /// Optional lockdown domain to scope the returned values. (optional) + /// ApiResponse of Object + ApiResponse DevicesGetLockdownValuesWithHttpInfo(string udid, string? domain = default); + /// + /// Query MobileGestalt + /// + /// + /// Query one or more MobileGestalt keys (CLI: `ios mobilegestalt <key>...`). Pass repeated `key` query params. + /// + /// Thrown when fails to make API call + /// + /// One or more MobileGestalt keys to query. + /// Object + Object DevicesGetMobileGestalt(string udid, List key); + + /// + /// Query MobileGestalt + /// + /// + /// Query one or more MobileGestalt keys (CLI: `ios mobilegestalt <key>...`). Pass repeated `key` query params. + /// + /// Thrown when fails to make API call + /// + /// One or more MobileGestalt keys to query. + /// ApiResponse of Object + ApiResponse DevicesGetMobileGestaltWithHttpInfo(string udid, List key); + /// + /// Get pasteboard + /// + /// + /// Get the pasteboard (clipboard) text (CLI: `ios pasteboard get`). + /// + /// Thrown when fails to make API call + /// + /// PasteboardContent + PasteboardContent DevicesGetPasteboard(string udid); + + /// + /// Get pasteboard + /// + /// + /// Get the pasteboard (clipboard) text (CLI: `ios pasteboard get`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of PasteboardContent + ApiResponse DevicesGetPasteboardWithHttpInfo(string udid); + /// + /// List processes + /// + /// + /// List running processes (CLI: `ios ps [- -apps]`). + /// + /// Thrown when fails to make API call + /// + /// Only return application processes. (optional) + /// List<ProcessInfo> + List DevicesGetProcesses(string udid, bool? apps = default); + + /// + /// List processes + /// + /// + /// List running processes (CLI: `ios ps [- -apps]`). + /// + /// Thrown when fails to make API call + /// + /// Only return application processes. (optional) + /// ApiResponse of List<ProcessInfo> + ApiResponse> DevicesGetProcessesWithHttpInfo(string udid, bool? apps = default); + /// + /// List configuration profiles + /// + /// + /// List installed configuration profiles. Returns an open dictionary. + /// + /// Thrown when fails to make API call + /// + /// Object + Object DevicesGetProfiles(string udid); + + /// + /// List configuration profiles + /// + /// + /// List installed configuration profiles. Returns an open dictionary. + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + ApiResponse DevicesGetProfilesWithHttpInfo(string udid); + /// + /// Get time format + /// + /// + /// Get the 24-hour clock state (CLI: `ios timeformat get`). + /// + /// Thrown when fails to make API call + /// + /// TimeFormatState + TimeFormatState DevicesGetTimeFormat(string udid); + + /// + /// Get time format + /// + /// + /// Get the 24-hour clock state (CLI: `ios timeformat get`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of TimeFormatState + ApiResponse DevicesGetTimeFormatWithHttpInfo(string udid); + /// + /// Get wallpaper + /// + /// + /// Get the home-screen wallpaper as PNG (CLI: `ios get-wallpaper`). + /// + /// Thrown when fails to make API call + /// + /// Object + Object DevicesGetWallpaper(string udid); + + /// + /// Get wallpaper + /// + /// + /// Get the home-screen wallpaper as PNG (CLI: `ios get-wallpaper`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + ApiResponse DevicesGetWallpaperWithHttpInfo(string udid); + /// + /// Get WDA session + /// + /// + /// Get a running WebDriverAgent session. Returns `404` for an unknown session. + /// + /// Thrown when fails to make API call + /// + /// The WDA session id. + /// WdaSession + WdaSession DevicesGetWdaSession(string udid, string sessionId); + + /// + /// Get WDA session + /// + /// + /// Get a running WebDriverAgent session. Returns `404` for an unknown session. + /// + /// Thrown when fails to make API call + /// + /// The WDA session id. + /// ApiResponse of WdaSession + ApiResponse DevicesGetWdaSessionWithHttpInfo(string udid, string sessionId); + /// + /// Install app + /// + /// + /// Install an application from an uploaded `.ipa`/`.app` archive. The multipart `file` part must be 1 byte–200 MB. + /// + /// Thrown when fails to make API call + /// + /// + /// GenericResponse + GenericResponse DevicesInstallApp(string udid, Object file); + + /// + /// Install app + /// + /// + /// Install an application from an uploaded `.ipa`/`.app` archive. The multipart `file` part must be 1 byte–200 MB. + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of GenericResponse + ApiResponse DevicesInstallAppWithHttpInfo(string udid, Object file); + /// + /// Kill app + /// + /// + /// Kill a running application by bundle id. + /// + /// Thrown when fails to make API call + /// + /// Bundle id of the app to kill. + /// GenericResponse + GenericResponse DevicesKillApp(string udid, string bundleID); + + /// + /// Kill app + /// + /// + /// Kill a running application by bundle id. + /// + /// Thrown when fails to make API call + /// + /// Bundle id of the app to kill. + /// ApiResponse of GenericResponse + ApiResponse DevicesKillAppWithHttpInfo(string udid, string bundleID); + /// + /// Launch app + /// + /// + /// Launch an application by bundle id. + /// + /// Thrown when fails to make API call + /// + /// Bundle id of the app to launch. + /// GenericResponse + GenericResponse DevicesLaunchApp(string udid, string bundleID); + + /// + /// Launch app + /// + /// + /// Launch an application by bundle id. + /// + /// Thrown when fails to make API call + /// + /// Bundle id of the app to launch. + /// ApiResponse of GenericResponse + ApiResponse DevicesLaunchAppWithHttpInfo(string udid, string bundleID); + /// + /// List apps + /// + /// + /// List installed applications. Each entry is an open Info.plist map. + /// + /// Thrown when fails to make API call + /// + /// List<AppInfo> + List DevicesListApps(string udid); + + /// + /// List apps + /// + /// + /// List installed applications. Each entry is an open Info.plist map. + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of List<AppInfo> + ApiResponse> DevicesListAppsWithHttpInfo(string udid); + /// + /// List conditions + /// + /// + /// List available condition inducer profile types. + /// + /// Thrown when fails to make API call + /// + /// List<ProfileType> + List DevicesListConditions(string udid); + + /// + /// List conditions + /// + /// + /// List available condition inducer profile types. + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of List<ProfileType> + ApiResponse> DevicesListConditionsWithHttpInfo(string udid); + /// + /// List crash reports + /// + /// + /// List crash reports (CLI: `ios crash ls`). + /// + /// Thrown when fails to make API call + /// + /// Optional glob pattern to filter reports. (optional) + /// CrashListing + CrashListing DevicesListCrashes(string udid, string? pattern = default); + + /// + /// List crash reports + /// + /// + /// List crash reports (CLI: `ios crash ls`). + /// + /// Thrown when fails to make API call + /// + /// Optional glob pattern to filter reports. (optional) + /// ApiResponse of CrashListing + ApiResponse DevicesListCrashesWithHttpInfo(string udid, string? pattern = default); + /// + /// List files + /// + /// + /// List a device directory (CLI: `ios file ls`). + /// + /// Thrown when fails to make API call + /// + /// File service domain: `app`, `app-group`, `crash` or `temp`. + /// Bundle/group id for the `app`/`app-group` domains. (optional) + /// Directory path to list (defaults to `.`). (optional) + /// FileListing + FileListing DevicesListFiles(string udid, FileDomain domain, string? identifier = default, string? path = default); + + /// + /// List files + /// + /// + /// List a device directory (CLI: `ios file ls`). + /// + /// Thrown when fails to make API call + /// + /// File service domain: `app`, `app-group`, `crash` or `temp`. + /// Bundle/group id for the `app`/`app-group` domains. (optional) + /// Directory path to list (defaults to `.`). (optional) + /// ApiResponse of FileListing + ApiResponse DevicesListFilesWithHttpInfo(string udid, FileDomain domain, string? identifier = default, string? path = default); + /// + /// List mounted developer images + /// + /// + /// List the hex signatures of Developer Disk Images mounted on the device. + /// + /// Thrown when fails to make API call + /// + /// List<string> + List DevicesListImages(string udid); + + /// + /// List mounted developer images + /// + /// + /// List the hex signatures of Developer Disk Images mounted on the device. + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of List<string> + ApiResponse> DevicesListImagesWithHttpInfo(string udid); + /// + /// List jobs + /// + /// + /// List jobs for a device. + /// + /// Thrown when fails to make API call + /// + /// List<Job> + List DevicesListJobs(string udid); + + /// + /// List jobs + /// + /// + /// List jobs for a device. + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of List<Job> + ApiResponse> DevicesListJobsWithHttpInfo(string udid); + /// + /// List mounted images + /// + /// + /// List mounted developer image signatures (CLI: `ios image list`). + /// + /// Thrown when fails to make API call + /// + /// MountedImages + MountedImages DevicesListMountedImages(string udid); + + /// + /// List mounted images + /// + /// + /// List mounted developer image signatures (CLI: `ios image list`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of MountedImages + ApiResponse DevicesListMountedImagesWithHttpInfo(string udid); + /// + /// Clear passcode (supervised) + /// + /// + /// Clear the device passcode (CLI: `ios mdm clear-passcode`). Requires the base64 unlock token as an additional `token` form field. + /// + /// Thrown when fails to make API call + /// + /// + /// Base64-encoded escrow unlock token. + /// Passphrase for the `.p12` identity. (optional) + /// StatusOk + StatusOk DevicesMdmClearPasscode(string udid, Object p12, string token, string? password = default); + + /// + /// Clear passcode (supervised) + /// + /// + /// Clear the device passcode (CLI: `ios mdm clear-passcode`). Requires the base64 unlock token as an additional `token` form field. + /// + /// Thrown when fails to make API call + /// + /// + /// Base64-encoded escrow unlock token. + /// Passphrase for the `.p12` identity. (optional) + /// ApiResponse of StatusOk + ApiResponse DevicesMdmClearPasscodeWithHttpInfo(string udid, Object p12, string token, string? password = default); + /// + /// Clear Screen Time password (supervised) + /// + /// + /// Clear the Screen Time password (CLI: `ios mdm clear-screen-time-password`). + /// + /// Thrown when fails to make API call + /// + /// + /// Passphrase for the `.p12` identity. (optional) + /// StatusOk + StatusOk DevicesMdmClearScreenTimePassword(string udid, Object p12, string? password = default); + + /// + /// Clear Screen Time password (supervised) + /// + /// + /// Clear the Screen Time password (CLI: `ios mdm clear-screen-time-password`). + /// + /// Thrown when fails to make API call + /// + /// + /// Passphrase for the `.p12` identity. (optional) + /// ApiResponse of StatusOk + ApiResponse DevicesMdmClearScreenTimePasswordWithHttpInfo(string udid, Object p12, string? password = default); + /// + /// Fetch unlock token (supervised) + /// + /// + /// Fetch the escrow unlock token, base64-encoded (CLI: `ios mdm fetch-unlock-token`). + /// + /// Thrown when fails to make API call + /// + /// + /// Passphrase for the `.p12` identity. (optional) + /// UnlockToken + UnlockToken DevicesMdmFetchUnlockToken(string udid, Object p12, string? password = default); + + /// + /// Fetch unlock token (supervised) + /// + /// + /// Fetch the escrow unlock token, base64-encoded (CLI: `ios mdm fetch-unlock-token`). + /// + /// Thrown when fails to make API call + /// + /// + /// Passphrase for the `.p12` identity. (optional) + /// ApiResponse of UnlockToken + ApiResponse DevicesMdmFetchUnlockTokenWithHttpInfo(string udid, Object p12, string? password = default); + /// + /// Get MDM security info (supervised) + /// + /// + /// Get device security info (CLI: `ios mdm security-info`). + /// + /// Thrown when fails to make API call + /// + /// + /// Passphrase for the `.p12` identity. (optional) + /// Object + Object DevicesMdmSecurityInfo(string udid, Object p12, string? password = default); + + /// + /// Get MDM security info (supervised) + /// + /// + /// Get device security info (CLI: `ios mdm security-info`). + /// + /// Thrown when fails to make API call + /// + /// + /// Passphrase for the `.p12` identity. (optional) + /// ApiResponse of Object + ApiResponse DevicesMdmSecurityInfoWithHttpInfo(string udid, Object p12, string? password = default); + /// + /// Waive memory limit + /// + /// + /// Waive the memory limit for a process (CLI: `ios memlimitoff`). The process name may be given via the `process` query param or the JSON body. + /// + /// Thrown when fails to make API call + /// + /// Process name whose memory limit should be waived. (optional) + /// (optional) + /// MemLimitResult + MemLimitResult DevicesMemLimitOff(string udid, string? process = default, MemLimitRequest? memLimitRequest = default); + + /// + /// Waive memory limit + /// + /// + /// Waive the memory limit for a process (CLI: `ios memlimitoff`). The process name may be given via the `process` query param or the JSON body. + /// + /// Thrown when fails to make API call + /// + /// Process name whose memory limit should be waived. (optional) + /// (optional) + /// ApiResponse of MemLimitResult + ApiResponse DevicesMemLimitOffWithHttpInfo(string udid, string? process = default, MemLimitRequest? memLimitRequest = default); + /// + /// Mount a developer image + /// + /// + /// Mount a Developer Disk Image. Either let the server auto-resolve and download the correct image (`auto=true`, optionally with `basedir`), or stream the image bytes as the raw request body (up to 2 GiB). + /// + /// Thrown when fails to make API call + /// + /// Auto-resolve and download the matching DDI for the device. (optional) + /// Base directory the server uses to cache/lookup DDIs when `auto=true`. (optional) + /// Raw Developer Disk Image bytes (used when not auto-resolving). Content up to 2 GiB. (optional) + /// GenericResponse + GenericResponse DevicesMountImage(string udid, bool? auto = default, string? basedir = default, Object? body = default); + + /// + /// Mount a developer image + /// + /// + /// Mount a Developer Disk Image. Either let the server auto-resolve and download the correct image (`auto=true`, optionally with `basedir`), or stream the image bytes as the raw request body (up to 2 GiB). + /// + /// Thrown when fails to make API call + /// + /// Auto-resolve and download the matching DDI for the device. (optional) + /// Base directory the server uses to cache/lookup DDIs when `auto=true`. (optional) + /// Raw Developer Disk Image bytes (used when not auto-resolving). Content up to 2 GiB. (optional) + /// ApiResponse of GenericResponse + ApiResponse DevicesMountImageWithHttpInfo(string udid, bool? auto = default, string? basedir = default, Object? body = default); + /// + /// Pair device + /// + /// + /// Pair with the device. For a supervised pairing (`supervised=true`) upload the supervision identity as `p12file` (multipart) and supply the passphrase in the `Supervision-Password` header. Returns `423` when the device is locked and pairing cannot proceed. + /// + /// Thrown when fails to make API call + /// + /// Whether this is a supervised pairing. + /// + /// Supervision identity passphrase (required when supervised). (optional) + /// GenericResponse + GenericResponse DevicesPair(string udid, bool supervised, Object p12file, string? supervisionPassword = default); + + /// + /// Pair device + /// + /// + /// Pair with the device. For a supervised pairing (`supervised=true`) upload the supervision identity as `p12file` (multipart) and supply the passphrase in the `Supervision-Password` header. Returns `423` when the device is locked and pairing cannot proceed. + /// + /// Thrown when fails to make API call + /// + /// Whether this is a supervised pairing. + /// + /// Supervision identity passphrase (required when supervised). (optional) + /// ApiResponse of GenericResponse + ApiResponse DevicesPairWithHttpInfo(string udid, bool supervised, Object p12file, string? supervisionPassword = default); + /// + /// Pull file + /// + /// + /// Download a file from the device, streamed as the response body (CLI: `ios file pull`). + /// + /// Thrown when fails to make API call + /// + /// File service domain: `app`, `app-group`, `crash` or `temp`. + /// Remote file path on the device. + /// Bundle/group id for the `app`/`app-group` domains. (optional) + /// Object + Object DevicesPullFile(string udid, FileDomain domain, string remote, string? identifier = default); + + /// + /// Pull file + /// + /// + /// Download a file from the device, streamed as the response body (CLI: `ios file pull`). + /// + /// Thrown when fails to make API call + /// + /// File service domain: `app`, `app-group`, `crash` or `temp`. + /// Remote file path on the device. + /// Bundle/group id for the `app`/`app-group` domains. (optional) + /// ApiResponse of Object + ApiResponse DevicesPullFileWithHttpInfo(string udid, FileDomain domain, string remote, string? identifier = default); + /// + /// Push file + /// + /// + /// Upload the request body to a device path (CLI: `ios file push`). A `Content-Length` header is required. + /// + /// Thrown when fails to make API call + /// + /// File service domain: `app`, `app-group`, `crash` or `temp`. + /// Destination path on the device. + /// Raw file bytes to upload. + /// Bundle/group id for the `app`/`app-group` domains. (optional) + /// FilePushResult + FilePushResult DevicesPushFile(string udid, FileDomain domain, string remote, Object body, string? identifier = default); + + /// + /// Push file + /// + /// + /// Upload the request body to a device path (CLI: `ios file push`). A `Content-Length` header is required. + /// + /// Thrown when fails to make API call + /// + /// File service domain: `app`, `app-group`, `crash` or `temp`. + /// Destination path on the device. + /// Raw file bytes to upload. + /// Bundle/group id for the `app`/`app-group` domains. (optional) + /// ApiResponse of FilePushResult + ApiResponse DevicesPushFileWithHttpInfo(string udid, FileDomain domain, string remote, Object body, string? identifier = default); + /// + /// Reboot device + /// + /// + /// Reboot the device (CLI: `ios reboot`). + /// + /// Thrown when fails to make API call + /// + /// GenericResponse + GenericResponse DevicesReboot(string udid); + + /// + /// Reboot device + /// + /// + /// Reboot the device (CLI: `ios reboot`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of GenericResponse + ApiResponse DevicesRebootWithHttpInfo(string udid); + /// + /// Delete crash reports + /// + /// + /// Delete crash reports (CLI: `ios crash rm`). + /// + /// Thrown when fails to make API call + /// + /// Working directory on the device. + /// Glob pattern of reports to delete. + /// GenericResponse + GenericResponse DevicesRemoveCrashes(string udid, string cwd, string pattern); + + /// + /// Delete crash reports + /// + /// + /// Delete crash reports (CLI: `ios crash rm`). + /// + /// Thrown when fails to make API call + /// + /// Working directory on the device. + /// Glob pattern of reports to delete. + /// ApiResponse of GenericResponse + ApiResponse DevicesRemoveCrashesWithHttpInfo(string udid, string cwd, string pattern); + /// + /// Remove HTTP proxy + /// + /// + /// Clear the global HTTP proxy (CLI: `ios httpproxy remove`). + /// + /// Thrown when fails to make API call + /// + /// GenericResponse + GenericResponse DevicesRemoveHttpProxy(string udid); + + /// + /// Remove HTTP proxy + /// + /// + /// Clear the global HTTP proxy (CLI: `ios httpproxy remove`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of GenericResponse + ApiResponse DevicesRemoveHttpProxyWithHttpInfo(string udid); + /// + /// Remove profile + /// + /// + /// Remove a configuration profile by identifier (CLI: `ios profile remove`). + /// + /// Thrown when fails to make API call + /// + /// The profile identifier to remove. + /// GenericResponse + GenericResponse DevicesRemoveProfile(string udid, string name); + + /// + /// Remove profile + /// + /// + /// Remove a configuration profile by identifier (CLI: `ios profile remove`). + /// + /// Thrown when fails to make API call + /// + /// The profile identifier to remove. + /// ApiResponse of GenericResponse + ApiResponse DevicesRemoveProfileWithHttpInfo(string udid, string name); + /// + /// Remove wifi + /// + /// + /// Remove a provisioned wifi network (CLI: `ios wifi - -remove`). + /// + /// Thrown when fails to make API call + /// + /// SSID of the network to remove. + /// GenericResponse + GenericResponse DevicesRemoveWifi(string udid, string ssid); + + /// + /// Remove wifi + /// + /// + /// Remove a provisioned wifi network (CLI: `ios wifi - -remove`). + /// + /// Thrown when fails to make API call + /// + /// SSID of the network to remove. + /// ApiResponse of GenericResponse + ApiResponse DevicesRemoveWifiWithHttpInfo(string udid, string ssid); + /// + /// Reset accessibility + /// + /// + /// Reset accessibility settings on the device. + /// + /// Thrown when fails to make API call + /// + /// GenericResponse + GenericResponse DevicesResetAccessibility(string udid); + + /// + /// Reset accessibility + /// + /// + /// Reset accessibility settings on the device. + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of GenericResponse + ApiResponse DevicesResetAccessibilityWithHttpInfo(string udid); + /// + /// Reset simulated location + /// + /// + /// Reset the simulated location back to the device's real GPS location. + /// + /// Thrown when fails to make API call + /// + /// GenericResponse + GenericResponse DevicesResetLocation(string udid); + + /// + /// Reset simulated location + /// + /// + /// Reset the simulated location back to the device's real GPS location. + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of GenericResponse + ApiResponse DevicesResetLocationWithHttpInfo(string udid); + /// + /// Capture screenshot + /// + /// + /// Capture a screenshot. Returns raw PNG bytes (`image/png`). + /// + /// Thrown when fails to make API call + /// + /// Object + Object DevicesScreenshot(string udid); + + /// + /// Capture screenshot + /// + /// + /// Capture a screenshot. Returns raw PNG bytes (`image/png`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + ApiResponse DevicesScreenshotWithHttpInfo(string udid); + /// + /// Set AssistiveTouch + /// + /// + /// Enable/disable AssistiveTouch (CLI: `ios assistivetouch enable|disable`). + /// + /// Thrown when fails to make API call + /// + /// + /// AssistiveTouchState + AssistiveTouchState DevicesSetAssistiveTouch(string udid, EnabledRequest enabledRequest); + + /// + /// Set AssistiveTouch + /// + /// + /// Enable/disable AssistiveTouch (CLI: `ios assistivetouch enable|disable`). + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of AssistiveTouchState + ApiResponse DevicesSetAssistiveTouchWithHttpInfo(string udid, EnabledRequest enabledRequest); + /// + /// Set developer mode + /// + /// + /// Enable or reveal developer mode (CLI: `ios devmode enable|reveal`). + /// + /// Thrown when fails to make API call + /// + /// + /// GenericResponse + GenericResponse DevicesSetDevMode(string udid, DevModeRequest devModeRequest); + + /// + /// Set developer mode + /// + /// + /// Enable or reveal developer mode (CLI: `ios devmode enable|reveal`). + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of GenericResponse + ApiResponse DevicesSetDevModeWithHttpInfo(string udid, DevModeRequest devModeRequest); + /// + /// Set HTTP proxy (supervised) + /// + /// + /// Configure a global HTTP proxy (CLI: `ios httpproxy`). Supervised: send multipart form-data with `host`, `port`, a `p12` supervisor identity and optional `user`/`pass`/`password` fields. + /// + /// Thrown when fails to make API call + /// + /// Proxy host. + /// Proxy port. + /// + /// Proxy username. (optional) + /// Proxy password. (optional) + /// Passphrase for the `.p12` identity. (optional) + /// GenericResponse + GenericResponse DevicesSetHttpProxy(string udid, string host, string port, Object p12, string? user = default, string? pass = default, string? password = default); + + /// + /// Set HTTP proxy (supervised) + /// + /// + /// Configure a global HTTP proxy (CLI: `ios httpproxy`). Supervised: send multipart form-data with `host`, `port`, a `p12` supervisor identity and optional `user`/`pass`/`password` fields. + /// + /// Thrown when fails to make API call + /// + /// Proxy host. + /// Proxy port. + /// + /// Proxy username. (optional) + /// Proxy password. (optional) + /// Passphrase for the `.p12` identity. (optional) + /// ApiResponse of GenericResponse + ApiResponse DevicesSetHttpProxyWithHttpInfo(string udid, string host, string port, Object p12, string? user = default, string? pass = default, string? password = default); + /// + /// Set icon layout + /// + /// + /// Restore a SpringBoard icon layout (CLI: `ios set-icon-layout`). Body is the layout JSON as returned by GET. + /// + /// Thrown when fails to make API call + /// + /// + /// GenericResponse + GenericResponse DevicesSetIconLayout(string udid, Object body); + + /// + /// Set icon layout + /// + /// + /// Restore a SpringBoard icon layout (CLI: `ios set-icon-layout`). Body is the layout JSON as returned by GET. + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of GenericResponse + ApiResponse DevicesSetIconLayoutWithHttpInfo(string udid, Object body); + /// + /// Set language + /// + /// + /// Set the device language and/or locale (CLI: `ios lang - -setlang - -setlocale`). Returns the resulting configuration. + /// + /// Thrown when fails to make API call + /// + /// + /// LanguageConfiguration + LanguageConfiguration DevicesSetLanguage(string udid, SetLanguageRequest setLanguageRequest); + + /// + /// Set language + /// + /// + /// Set the device language and/or locale (CLI: `ios lang - -setlang - -setlocale`). Returns the resulting configuration. + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of LanguageConfiguration + ApiResponse DevicesSetLanguageWithHttpInfo(string udid, SetLanguageRequest setLanguageRequest); + /// + /// Set simulated location + /// + /// + /// Simulate a GPS location on the device. NOTE: the longitude parameter was historically misspelled `longtitude` on the wire. This spec fixes it to `longitude`; the go-ios server accepts `longitude` (and may keep `longtitude` as a deprecated alias). + /// + /// Thrown when fails to make API call + /// + /// Latitude in decimal degrees. + /// Longitude in decimal degrees. + /// GenericResponse + GenericResponse DevicesSetLocation(string udid, string latitude, string longitude); + + /// + /// Set simulated location + /// + /// + /// Simulate a GPS location on the device. NOTE: the longitude parameter was historically misspelled `longtitude` on the wire. This spec fixes it to `longitude`; the go-ios server accepts `longitude` (and may keep `longtitude` as a deprecated alias). + /// + /// Thrown when fails to make API call + /// + /// Latitude in decimal degrees. + /// Longitude in decimal degrees. + /// ApiResponse of GenericResponse + ApiResponse DevicesSetLocationWithHttpInfo(string udid, string latitude, string longitude); + /// + /// Set pasteboard + /// + /// + /// Set the pasteboard text from the raw request body (CLI: `ios pasteboard set`). + /// + /// Thrown when fails to make API call + /// + /// + /// GenericResponse + GenericResponse DevicesSetPasteboard(string udid, string body); + + /// + /// Set pasteboard + /// + /// + /// Set the pasteboard text from the raw request body (CLI: `ios pasteboard set`). + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of GenericResponse + ApiResponse DevicesSetPasteboardWithHttpInfo(string udid, string body); + /// + /// Set time format + /// + /// + /// Set 24-hour / 12-hour clock (CLI: `ios timeformat 24h|12h`). + /// + /// Thrown when fails to make API call + /// + /// + /// TimeFormatState + TimeFormatState DevicesSetTimeFormat(string udid, TimeFormatRequest timeFormatRequest); + + /// + /// Set time format + /// + /// + /// Set 24-hour / 12-hour clock (CLI: `ios timeformat 24h|12h`). + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of TimeFormatState + ApiResponse DevicesSetTimeFormatWithHttpInfo(string udid, TimeFormatRequest timeFormatRequest); + /// + /// Set wallpaper (supervised) + /// + /// + /// Set the wallpaper (CLI: `ios set-wallpaper`). Supervised: upload the image and a `.p12` supervisor identity as multipart form-data. + /// + /// Thrown when fails to make API call + /// + /// + /// + /// Passphrase for the `.p12` identity. (optional) + /// Target screen (`home`, `lock`, `both`). (optional) + /// GenericResponse + GenericResponse DevicesSetWallpaper(string udid, Object image, Object p12, string? password = default, string? screen = default); + + /// + /// Set wallpaper (supervised) + /// + /// + /// Set the wallpaper (CLI: `ios set-wallpaper`). Supervised: upload the image and a `.p12` supervisor identity as multipart form-data. + /// + /// Thrown when fails to make API call + /// + /// + /// + /// Passphrase for the `.p12` identity. (optional) + /// Target screen (`home`, `lock`, `both`). (optional) + /// ApiResponse of GenericResponse + ApiResponse DevicesSetWallpaperWithHttpInfo(string udid, Object image, Object p12, string? password = default, string? screen = default); + /// + /// Provision wifi + /// + /// + /// Provision a wifi network (CLI: `ios wifi`). + /// + /// Thrown when fails to make API call + /// + /// + /// GenericResponse + GenericResponse DevicesSetWifi(string udid, WifiRequest wifiRequest); + + /// + /// Provision wifi + /// + /// + /// Provision a wifi network (CLI: `ios wifi`). + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of GenericResponse + ApiResponse DevicesSetWifiWithHttpInfo(string udid, WifiRequest wifiRequest); + /// + /// Shut down device + /// + /// + /// Shut down the device (CLI: `ios shutdown`). + /// + /// Thrown when fails to make API call + /// + /// GenericResponse + GenericResponse DevicesShutdown(string udid); + + /// + /// Shut down device + /// + /// + /// Shut down the device (CLI: `ios shutdown`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of GenericResponse + ApiResponse DevicesShutdownWithHttpInfo(string udid); + /// + /// Start port forward (job) + /// + /// + /// Start a TCP port forward host→device as an async job (CLI: `ios forward`). + /// + /// Thrown when fails to make API call + /// + /// + /// Job + Job DevicesStartForward(string udid, ForwardRequest forwardRequest); + + /// + /// Start port forward (job) + /// + /// + /// Start a TCP port forward host→device as an async job (CLI: `ios forward`). + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Job + ApiResponse DevicesStartForwardWithHttpInfo(string udid, ForwardRequest forwardRequest); + /// + /// Start test run (job) + /// + /// + /// Start an XCUITest/unit-test run as an async job (CLI: `ios runtest`). Returns `202` with the created job. + /// + /// Thrown when fails to make API call + /// + /// + /// Job + Job DevicesStartRunTest(string udid, RunTestRequest runTestRequest); + + /// + /// Start test run (job) + /// + /// + /// Start an XCUITest/unit-test run as an async job (CLI: `ios runtest`). Returns `202` with the created job. + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Job + ApiResponse DevicesStartRunTestWithHttpInfo(string udid, RunTestRequest runTestRequest); + /// + /// Start WDA runner (job) + /// + /// + /// Start the WebDriverAgent runner as an async job (CLI: `ios runwda`). Body fields are optional and default to the standard WDA bundle id and config. + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Job + Job DevicesStartRunWda(string udid, RunTestRequest? runTestRequest = default); + + /// + /// Start WDA runner (job) + /// + /// + /// Start the WebDriverAgent runner as an async job (CLI: `ios runwda`). Body fields are optional and default to the standard WDA bundle id and config. + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// ApiResponse of Job + ApiResponse DevicesStartRunWdaWithHttpInfo(string udid, RunTestRequest? runTestRequest = default); + /// + /// Stop or delete job + /// + /// + /// Stop a running job, or purge an already-terminal one from the registry (CLI: Ctrl-C on the equivalent command). + /// + /// Thrown when fails to make API call + /// + /// The job id. + /// GenericResponse + GenericResponse DevicesStopJob(string udid, string id); + + /// + /// Stop or delete job + /// + /// + /// Stop a running job, or purge an already-terminal one from the registry (CLI: Ctrl-C on the equivalent command). + /// + /// Thrown when fails to make API call + /// + /// The job id. + /// ApiResponse of GenericResponse + ApiResponse DevicesStopJobWithHttpInfo(string udid, string id); + /// + /// Stream job logs (SSE) + /// + /// + /// Stream a job's log output as Server-Sent Events: the buffered history first, then live lines until the job ends or the client disconnects. + /// + /// Thrown when fails to make API call + /// + /// The job id. + /// string + string DevicesStreamJobLogs(string udid, string id); + + /// + /// Stream job logs (SSE) + /// + /// + /// Stream a job's log output as Server-Sent Events: the buffered history first, then live lines until the job ends or the client disconnects. + /// + /// Thrown when fails to make API call + /// + /// The job id. + /// ApiResponse of string + ApiResponse DevicesStreamJobLogsWithHttpInfo(string udid, string id); + /// + /// Stream device attach/detach (SSE) + /// + /// + /// Stream device attach/detach events as Server-Sent Events. + /// + /// Thrown when fails to make API call + /// + /// string + string DevicesStreamListen(string udid); + + /// + /// Stream device attach/detach (SSE) + /// + /// + /// Stream device attach/detach events as Server-Sent Events. + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of string + ApiResponse DevicesStreamListenWithHttpInfo(string udid); + /// + /// Stream app-state notifications (SSE) + /// + /// + /// Stream application state-change notifications as Server-Sent Events. + /// + /// Thrown when fails to make API call + /// + /// string + string DevicesStreamNotifications(string udid); + + /// + /// Stream app-state notifications (SSE) + /// + /// + /// Stream application state-change notifications as Server-Sent Events. + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of string + ApiResponse DevicesStreamNotificationsWithHttpInfo(string udid); + /// + /// Stream os_log trace (SSE) + /// + /// + /// Stream structured os_log trace entries as Server-Sent Events. All filters are optional and combine with AND semantics. + /// + /// Thrown when fails to make API call + /// + /// Only include entries from this process id. (optional) + /// Minimum log level to include (e.g. `info`, `debug`, `error`). (optional) + /// Only include entries from this subsystem. (optional) + /// Only include entries whose message matches this substring/pattern. (optional) + /// Exclude entries whose message matches this substring/pattern. (optional) + /// string + string DevicesStreamOsTrace(string udid, int? pid = default, string? level = default, string? subsystem = default, string? match = default, string? exclude = default); + + /// + /// Stream os_log trace (SSE) + /// + /// + /// Stream structured os_log trace entries as Server-Sent Events. All filters are optional and combine with AND semantics. + /// + /// Thrown when fails to make API call + /// + /// Only include entries from this process id. (optional) + /// Minimum log level to include (e.g. `info`, `debug`, `error`). (optional) + /// Only include entries from this subsystem. (optional) + /// Only include entries whose message matches this substring/pattern. (optional) + /// Exclude entries whose message matches this substring/pattern. (optional) + /// ApiResponse of string + ApiResponse DevicesStreamOsTraceWithHttpInfo(string udid, int? pid = default, string? level = default, string? subsystem = default, string? match = default, string? exclude = default); + /// + /// Stream syslog (SSE) + /// + /// + /// Stream device syslog lines as Server-Sent Events. + /// + /// Thrown when fails to make API call + /// + /// string + string DevicesStreamSyslog(string udid); + + /// + /// Stream syslog (SSE) + /// + /// + /// Stream device syslog lines as Server-Sent Events. + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of string + ApiResponse DevicesStreamSyslogWithHttpInfo(string udid); + /// + /// Stream CPU usage (SSE) + /// + /// + /// Stream CPU-usage samples as Server-Sent Events (CLI: `ios sysmontap`). + /// + /// Thrown when fails to make API call + /// + /// string + string DevicesStreamSysmontap(string udid); + + /// + /// Stream CPU usage (SSE) + /// + /// + /// Stream CPU-usage samples as Server-Sent Events (CLI: `ios sysmontap`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of string + ApiResponse DevicesStreamSysmontapWithHttpInfo(string udid); + /// + /// Uninstall app + /// + /// + /// Uninstall an application by bundle id. + /// + /// Thrown when fails to make API call + /// + /// Bundle id of the app to uninstall. + /// GenericResponse + GenericResponse DevicesUninstallApp(string udid, string bundleID); + + /// + /// Uninstall app + /// + /// + /// Uninstall an application by bundle id. + /// + /// Thrown when fails to make API call + /// + /// Bundle id of the app to uninstall. + /// ApiResponse of GenericResponse + ApiResponse DevicesUninstallAppWithHttpInfo(string udid, string bundleID); + /// + /// Unmount developer image + /// + /// + /// Unmount the developer disk image (CLI: `ios image unmount`). + /// + /// Thrown when fails to make API call + /// + /// GenericResponse + GenericResponse DevicesUnmountImage(string udid); + + /// + /// Unmount developer image + /// + /// + /// Unmount the developer disk image (CLI: `ios image unmount`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of GenericResponse + ApiResponse DevicesUnmountImageWithHttpInfo(string udid); + /// + /// Get battery IORegistry + /// + /// + /// Get the battery IORegistry stats (Temperature, Voltage, CurrentCapacity, ...) via the diagnostics relay (CLI: `ios diagnostics ioregistry`). + /// + /// Thrown when fails to make API call + /// + /// BatteryRegistry + BatteryRegistry DiagnosticsNetGetBatteryRegistry(string udid); + + /// + /// Get battery IORegistry + /// + /// + /// Get the battery IORegistry stats (Temperature, Voltage, CurrentCapacity, ...) via the diagnostics relay (CLI: `ios diagnostics ioregistry`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of BatteryRegistry + ApiResponse DiagnosticsNetGetBatteryRegistryWithHttpInfo(string udid); + /// + /// Get device IP / network info + /// + /// + /// Resolve the device's network addresses (MAC/IPv4/IPv6) by sniffing pcapd (CLI: `ios ip`). + /// + /// Thrown when fails to make API call + /// + /// NetworkInfo + NetworkInfo DiagnosticsNetGetDeviceIp(string udid); + + /// + /// Get device IP / network info + /// + /// + /// Resolve the device's network addresses (MAC/IPv4/IPv6) by sniffing pcapd (CLI: `ios ip`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of NetworkInfo + ApiResponse DiagnosticsNetGetDeviceIpWithHttpInfo(string udid); + /// + /// Get disk space info + /// + /// + /// Get filesystem info for the device (total/free/used bytes, block size) via AFC (CLI: `ios diskspace`). + /// + /// Thrown when fails to make API call + /// + /// DiskSpaceInfo + DiskSpaceInfo DiagnosticsNetGetDiskSpace(string udid); + + /// + /// Get disk space info + /// + /// + /// Get filesystem info for the device (total/free/used bytes, block size) via AFC (CLI: `ios diskspace`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of DiskSpaceInfo + ApiResponse DiagnosticsNetGetDiskSpaceWithHttpInfo(string udid); + /// + /// Get RSD service list + /// + /// + /// Get the device's RSD (Remote Service Discovery) service list (CLI: `ios rsd ls`). Requires a running tunnel (iOS 17+); devices without RSD return `400`. + /// + /// Thrown when fails to make API call + /// + /// Object + Object DiagnosticsNetGetRsdServices(string udid); + + /// + /// Get RSD service list + /// + /// + /// Get the device's RSD (Remote Service Discovery) service list (CLI: `ios rsd ls`). Requires a running tunnel (iOS 17+); devices without RSD return `400`. + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + ApiResponse DiagnosticsNetGetRsdServicesWithHttpInfo(string udid); + /// + /// List a directory over AFC + /// + /// + /// List a device directory over AFC (CLI: `ios fsync ls`). + /// + /// Thrown when fails to make API call + /// + /// App bundle id to scope to its container (else the media dir). (optional) + /// Device-side path (rejects `..` elements). (optional) + /// FsyncListing + FsyncListing FsyncFsyncLs(string udid, string? bundleID = default, string? path = default); + + /// + /// List a directory over AFC + /// + /// + /// List a device directory over AFC (CLI: `ios fsync ls`). + /// + /// Thrown when fails to make API call + /// + /// App bundle id to scope to its container (else the media dir). (optional) + /// Device-side path (rejects `..` elements). (optional) + /// ApiResponse of FsyncListing + ApiResponse FsyncFsyncLsWithHttpInfo(string udid, string? bundleID = default, string? path = default); + /// + /// Create a directory over AFC + /// + /// + /// Create a directory over AFC (CLI: `ios fsync mkdir`). + /// + /// Thrown when fails to make API call + /// + /// Directory path to create (required). + /// App bundle id to scope to its container (else the media dir). (optional) + /// FsyncMessage + FsyncMessage FsyncFsyncMkdir(string udid, string path, string? bundleID = default); + + /// + /// Create a directory over AFC + /// + /// + /// Create a directory over AFC (CLI: `ios fsync mkdir`). + /// + /// Thrown when fails to make API call + /// + /// Directory path to create (required). + /// App bundle id to scope to its container (else the media dir). (optional) + /// ApiResponse of FsyncMessage + ApiResponse FsyncFsyncMkdirWithHttpInfo(string udid, string path, string? bundleID = default); + /// + /// Download a file over AFC + /// + /// + /// Download a file from the device over AFC (CLI: `ios fsync pull`). Returns the raw file bytes. `path` is required. + /// + /// Thrown when fails to make API call + /// + /// Remote file path on the device (required). + /// App bundle id to scope to its container (else the media dir). (optional) + /// Object + Object FsyncFsyncPull(string udid, string path, string? bundleID = default); + + /// + /// Download a file over AFC + /// + /// + /// Download a file from the device over AFC (CLI: `ios fsync pull`). Returns the raw file bytes. `path` is required. + /// + /// Thrown when fails to make API call + /// + /// Remote file path on the device (required). + /// App bundle id to scope to its container (else the media dir). (optional) + /// ApiResponse of Object + ApiResponse FsyncFsyncPullWithHttpInfo(string udid, string path, string? bundleID = default); + /// + /// Upload a file over AFC + /// + /// + /// Upload a file to the device over AFC (CLI: `ios fsync push`). Accepts either raw bytes (application/octet-stream) or a multipart form with a `file` field. `path` is required. Bounded server-side; oversized uploads get `413`. + /// + /// Thrown when fails to make API call + /// + /// Destination path on the device (required). + /// Raw file bytes to upload (application/octet-stream). + /// App bundle id to scope to its container (else the media dir). (optional) + /// FsyncPushResult + FsyncPushResult FsyncFsyncPush(string udid, string path, Object body, string? bundleID = default); + + /// + /// Upload a file over AFC + /// + /// + /// Upload a file to the device over AFC (CLI: `ios fsync push`). Accepts either raw bytes (application/octet-stream) or a multipart form with a `file` field. `path` is required. Bounded server-side; oversized uploads get `413`. + /// + /// Thrown when fails to make API call + /// + /// Destination path on the device (required). + /// Raw file bytes to upload (application/octet-stream). + /// App bundle id to scope to its container (else the media dir). (optional) + /// ApiResponse of FsyncPushResult + ApiResponse FsyncFsyncPushWithHttpInfo(string udid, string path, Object body, string? bundleID = default); + /// + /// Remove a file or directory over AFC + /// + /// + /// Remove a file or directory over AFC (CLI: `ios fsync rm`). Pass `recursive=true` to delete a non-empty directory. + /// + /// Thrown when fails to make API call + /// + /// Path to remove (required). + /// App bundle id to scope to its container (else the media dir). (optional) + /// Remove directory contents recursively. (optional) + /// FsyncMessage + FsyncMessage FsyncFsyncRm(string udid, string path, string? bundleID = default, bool? recursive = default); + + /// + /// Remove a file or directory over AFC + /// + /// + /// Remove a file or directory over AFC (CLI: `ios fsync rm`). Pass `recursive=true` to delete a non-empty directory. + /// + /// Thrown when fails to make API call + /// + /// Path to remove (required). + /// App bundle id to scope to its container (else the media dir). (optional) + /// Remove directory contents recursively. (optional) + /// ApiResponse of FsyncMessage + ApiResponse FsyncFsyncRmWithHttpInfo(string udid, string path, string? bundleID = default, bool? recursive = default); + /// + /// Recursively list a directory over AFC + /// + /// + /// Recursively list a device directory over AFC (CLI: `ios fsync tree`). + /// + /// Thrown when fails to make API call + /// + /// App bundle id to scope to its container (else the media dir). (optional) + /// Device-side path (rejects `..` elements). (optional) + /// FsyncTreeListing + FsyncTreeListing FsyncFsyncTree(string udid, string? bundleID = default, string? path = default); + + /// + /// Recursively list a directory over AFC + /// + /// + /// Recursively list a device directory over AFC (CLI: `ios fsync tree`). + /// + /// Thrown when fails to make API call + /// + /// App bundle id to scope to its container (else the media dir). (optional) + /// Device-side path (rejects `..` elements). (optional) + /// ApiResponse of FsyncTreeListing + ApiResponse FsyncFsyncTreeWithHttpInfo(string udid, string? bundleID = default, string? path = default); + /// + /// Get device cloud configuration + /// + /// + /// Get the device cloud configuration (supervision status, skip-setup options, organization info). + /// + /// Thrown when fails to make API call + /// + /// Object + Object FsyncGetCloudConfig(string udid); + + /// + /// Get device cloud configuration + /// + /// + /// Get the device cloud configuration (supervision status, skip-setup options, organization info). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + ApiResponse FsyncGetCloudConfigWithHttpInfo(string udid); + /// + /// List setup skip options + /// + /// + /// List all setup-pane skip options usable when preparing a device (CLI: `ios prepare printskip`). Static, device-free list. + /// + /// Thrown when fails to make API call + /// PrepareSkipOptions + PrepareSkipOptions GetPrepareSkipOptions(); + + /// + /// List setup skip options + /// + /// + /// List all setup-pane skip options usable when preparing a device (CLI: `ios prepare printskip`). Static, device-free list. + /// + /// Thrown when fails to make API call + /// ApiResponse of PrepareSkipOptions + ApiResponse GetPrepareSkipOptionsWithHttpInfo(); + /// + /// List devices + /// + /// + /// List all attached / reachable devices. + /// + /// Thrown when fails to make API call + /// DeviceList + DeviceList ListDevices(); + + /// + /// List devices + /// + /// + /// List all attached / reachable devices. + /// + /// Thrown when fails to make API call + /// ApiResponse of DeviceList + ApiResponse ListDevicesWithHttpInfo(); + /// + /// List tunnels + /// + /// + /// List running device tunnels (CLI: `ios tunnel ls`). + /// + /// Thrown when fails to make API call + /// List<Tunnel> + List ListTunnels(); + + /// + /// List tunnels + /// + /// + /// List running device tunnels (CLI: `ios tunnel ls`). + /// + /// Thrown when fails to make API call + /// ApiResponse of List<Tunnel> + ApiResponse> ListTunnelsWithHttpInfo(); + /// + /// Generate a supervision certificate + /// + /// + /// Generate a self-signed supervision identity (CLI: `ios prepare create-cert`) and return the DER (base64) and PEM for both the certificate and private key. Host-scoped (device-free). + /// + /// Thrown when fails to make API call + /// SupervisionCert + SupervisionCert PrepareCreateCert(); + + /// + /// Generate a supervision certificate + /// + /// + /// Generate a self-signed supervision identity (CLI: `ios prepare create-cert`) and return the DER (base64) and PEM for both the certificate and private key. Host-scoped (device-free). + /// + /// Thrown when fails to make API call + /// ApiResponse of SupervisionCert + ApiResponse PrepareCreateCertWithHttpInfo(); + /// + /// Prepare (and optionally supervise) a device + /// + /// + /// Run the device preparation/provisioning flow (CLI: `ios prepare`). Send multipart/form-data. To supervise the device include a `cert` file (DER/PEM/P12 supervision identity) and optional `p12password`; without a cert the device is prepared without supervision. + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// P12 password (when `cert` is a P12). (optional) + /// Setup panes to skip (see /prepare/skip-options). Repeatable. (optional) + /// Supervision organization name. (optional) + /// Device locale (default en_US). (optional) + /// Device language (default en). (optional) + /// PrepareResult + PrepareResult PreparePrepareDevice(string udid, Object? cert = default, string? p12password = default, List? skip = default, string? orgname = default, string? locale = default, string? lang = default); + + /// + /// Prepare (and optionally supervise) a device + /// + /// + /// Run the device preparation/provisioning flow (CLI: `ios prepare`). Send multipart/form-data. To supervise the device include a `cert` file (DER/PEM/P12 supervision identity) and optional `p12password`; without a cert the device is prepared without supervision. + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// P12 password (when `cert` is a P12). (optional) + /// Setup panes to skip (see /prepare/skip-options). Repeatable. (optional) + /// Supervision organization name. (optional) + /// Device locale (default en_US). (optional) + /// Device language (default en). (optional) + /// ApiResponse of PrepareResult + ApiResponse PreparePrepareDeviceWithHttpInfo(string udid, Object? cert = default, string? p12password = default, List? skip = default, string? orgname = default, string? locale = default, string? lang = default); + /// + /// Refresh tunnel + /// + /// + /// Restart the tunnel for a device and wait for it to come up (CLI: `ios tunnel refresh`). + /// + /// Thrown when fails to make API call + /// + /// Tunnel + Tunnel RefreshTunnel(string udid); + + /// + /// Refresh tunnel + /// + /// + /// Restart the tunnel for a device and wait for it to come up (CLI: `ios tunnel refresh`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Tunnel + ApiResponse RefreshTunnelWithHttpInfo(string udid); + /// + /// Shut down tunnel agent + /// + /// + /// Shut down the tunnel agent (CLI: `ios tunnel stopagent`). + /// + /// Thrown when fails to make API call + /// AgentShutdown + AgentShutdown ShutdownTunnelAgent(); + + /// + /// Shut down tunnel agent + /// + /// + /// Shut down the tunnel agent (CLI: `ios tunnel stopagent`). + /// + /// Thrown when fails to make API call + /// ApiResponse of AgentShutdown + ApiResponse ShutdownTunnelAgentWithHttpInfo(); + /// + /// Resign an app/IPA + /// + /// + /// Resign an uploaded app/IPA with an uploaded P12 identity and provisioning profile, returning the signed IPA. Synchronous. Host-scoped. + /// + /// Thrown when fails to make API call + /// + /// + /// + /// P12 password. (optional) + /// Override bundle id. (optional) + /// Object + Object SignApp(Object ipa, Object p12file, Object profile, string? p12password = default, string? bundleid = default); + + /// + /// Resign an app/IPA + /// + /// + /// Resign an uploaded app/IPA with an uploaded P12 identity and provisioning profile, returning the signed IPA. Synchronous. Host-scoped. + /// + /// Thrown when fails to make API call + /// + /// + /// + /// P12 password. (optional) + /// Override bundle id. (optional) + /// ApiResponse of Object + ApiResponse SignAppWithHttpInfo(Object ipa, Object p12file, Object profile, string? p12password = default, string? bundleid = default); + /// + /// Create a signing certificate + /// + /// + /// Create one App Store Connect signing certificate and return its P12 (certificate + private key) as a downloadable `application/x-pkcs12` file. The P12 password is echoed in the `X-P12-Password` response header and the certificate resource id in `X-Certificate-Id`. Host-scoped (device-free). + /// + /// Thrown when fails to make API call + /// + /// App Store Connect key id. + /// App Store Connect issuer id. + /// Revoke existing iOS Development certificates first. (optional) + /// Password to protect the generated P12. (optional) + /// Object + Object SignCertificate(Object ascPrivateKey, string ascKeyId, string ascIssuerId, string? revokeExisting = default, string? p12password = default); + + /// + /// Create a signing certificate + /// + /// + /// Create one App Store Connect signing certificate and return its P12 (certificate + private key) as a downloadable `application/x-pkcs12` file. The P12 password is echoed in the `X-P12-Password` response header and the certificate resource id in `X-Certificate-Id`. Host-scoped (device-free). + /// + /// Thrown when fails to make API call + /// + /// App Store Connect key id. + /// App Store Connect issuer id. + /// Revoke existing iOS Development certificates first. (optional) + /// Password to protect the generated P12. (optional) + /// ApiResponse of Object + ApiResponse SignCertificateWithHttpInfo(Object ascPrivateKey, string ascKeyId, string ascIssuerId, string? revokeExisting = default, string? p12password = default); + /// + /// Create a provisioning profile + P12 + /// + /// + /// Create a bundle id, development certificate and provisioning profile via App Store Connect and return both artifacts base64-encoded in a JSON envelope. The target device udid is supplied as a form field. Host-scoped. + /// + /// Thrown when fails to make API call + /// + /// App Store Connect key id. + /// App Store Connect issuer id. + /// App bundle identifier. + /// Target device udid to register against the profile. + /// Bundle display name. (optional) + /// Provisioning profile name. (optional) + /// Device display name. (optional) + /// Reuse an existing certificate (no new P12 is generated). (optional) + /// Revoke existing certificates first. (optional) + /// Password to protect the generated P12. (optional) + /// ProvisioningResult + ProvisioningResult SignProvision(Object ascPrivateKey, string ascKeyId, string ascIssuerId, string bundleid, string udid, string? bundlename = default, string? profilename = default, string? devicename = default, string? certificateId = default, string? revokeExisting = default, string? p12password = default); + + /// + /// Create a provisioning profile + P12 + /// + /// + /// Create a bundle id, development certificate and provisioning profile via App Store Connect and return both artifacts base64-encoded in a JSON envelope. The target device udid is supplied as a form field. Host-scoped. + /// + /// Thrown when fails to make API call + /// + /// App Store Connect key id. + /// App Store Connect issuer id. + /// App bundle identifier. + /// Target device udid to register against the profile. + /// Bundle display name. (optional) + /// Provisioning profile name. (optional) + /// Device display name. (optional) + /// Reuse an existing certificate (no new P12 is generated). (optional) + /// Revoke existing certificates first. (optional) + /// Password to protect the generated P12. (optional) + /// ApiResponse of ProvisioningResult + ApiResponse SignProvisionWithHttpInfo(Object ascPrivateKey, string ascKeyId, string ascIssuerId, string bundleid, string udid, string? bundlename = default, string? profilename = default, string? devicename = default, string? certificateId = default, string? revokeExisting = default, string? p12password = default); + /// + /// Stop tunnel + /// + /// + /// Stop the tunnel for a device (CLI: `ios tunnel stop - -udid`). + /// + /// Thrown when fails to make API call + /// + /// TunnelStopped + TunnelStopped StopTunnel(string udid); + + /// + /// Stop tunnel + /// + /// + /// Stop the tunnel for a device (CLI: `ios tunnel stop - -udid`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of TunnelStopped + ApiResponse StopTunnelWithHttpInfo(string udid); + /// + /// Stream a live pcap capture (binary) + /// + /// + /// Stream a live packet capture from the device as a libpcap byte stream (pipeable into wireshark/tshark). Runs until `timeout` (seconds) elapses, the default timeout is reached, or the client disconnects. + /// + /// Thrown when fails to make API call + /// + /// Capture duration in seconds (default 60, max 3600). (optional) + /// Object + Object StreamsPcap(string udid, int? timeout = default); + + /// + /// Stream a live pcap capture (binary) + /// + /// + /// Stream a live packet capture from the device as a libpcap byte stream (pipeable into wireshark/tshark). Runs until `timeout` (seconds) elapses, the default timeout is reached, or the client disconnects. + /// + /// Thrown when fails to make API call + /// + /// Capture duration in seconds (default 60, max 3600). (optional) + /// ApiResponse of Object + ApiResponse StreamsPcapWithHttpInfo(string udid, int? timeout = default); + /// + /// Stream screenshots as MJPEG (binary) + /// + /// + /// Serve an MJPEG (multipart/x-mixed-replace) stream of device screenshots captured via the instruments screenshot service. Streams until the client disconnects or the source fails. + /// + /// Thrown when fails to make API call + /// + /// Optional JPEG quality (1–100, default 80). (optional) + /// Object + Object StreamsScreenshotStream(string udid, int? quality = default); + + /// + /// Stream screenshots as MJPEG (binary) + /// + /// + /// Serve an MJPEG (multipart/x-mixed-replace) stream of device screenshots captured via the instruments screenshot service. Streams until the client disconnects or the source fails. + /// + /// Thrown when fails to make API call + /// + /// Optional JPEG quality (1–100, default 80). (optional) + /// ApiResponse of Object + ApiResponse StreamsScreenshotStreamWithHttpInfo(string udid, int? quality = default); + /// + /// Stream UI video (binary) + /// + /// + /// Open a live UI video stream against a forwarded WDA/DeviceKit backend and pipe it straight through to the client. Default codec is MJPEG (multipart/x-mixed-replace); `codec=h264` returns an H.264 elementary stream (requires the devicekit backend). Streams until the client disconnects or the backend ends. Requires a running, forwarded WDA/DeviceKit backend (see the UI routes). + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Video codec: `mjpeg` (default) or `h264` (devicekit backend only). (optional) + /// Target frames per second (backend-dependent). (optional) + /// JPEG quality for the mjpeg codec. (optional) + /// Scale factor (backend-dependent). (optional) + /// Target bitrate for the h264 codec. (optional) + /// Object + Object StreamsUiStream(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default, string? codec = default, string? fps = default, string? quality = default, string? scale = default, string? bitrate = default); + + /// + /// Stream UI video (binary) + /// + /// + /// Open a live UI video stream against a forwarded WDA/DeviceKit backend and pipe it straight through to the client. Default codec is MJPEG (multipart/x-mixed-replace); `codec=h264` returns an H.264 elementary stream (requires the devicekit backend). Streams until the client disconnects or the backend ends. Requires a running, forwarded WDA/DeviceKit backend (see the UI routes). + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Video codec: `mjpeg` (default) or `h264` (devicekit backend only). (optional) + /// Target frames per second (backend-dependent). (optional) + /// JPEG quality for the mjpeg codec. (optional) + /// Scale factor (backend-dependent). (optional) + /// Target bitrate for the h264 codec. (optional) + /// ApiResponse of Object + ApiResponse StreamsUiStreamWithHttpInfo(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default, string? codec = default, string? fps = default, string? quality = default, string? scale = default, string? bitrate = default); + /// + /// Raw backend passthrough + /// + /// + /// Raw passthrough to the backend. For WDA supply `method`/`path`/`body`; for DeviceKit supply `rpcMethod`/`rpcParams`. The backend response is forwarded verbatim. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Object + Object UIUiApi(string udid, UIAPIRequest uIAPIRequest, string? backend = default, string? wdaUrl = default, int? timeout = default); + + /// + /// Raw backend passthrough + /// + /// + /// Raw passthrough to the backend. For WDA supply `method`/`path`/`body`; for DeviceKit supply `rpcMethod`/`rpcParams`. The backend response is forwarded verbatim. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// ApiResponse of Object + ApiResponse UIUiApiWithHttpInfo(string udid, UIAPIRequest uIAPIRequest, string? backend = default, string? wdaUrl = default, int? timeout = default); + /// + /// Foreground app (UI backend) + /// + /// + /// Bring the backgrounded app to the foreground. Only the devicekit backend supports this; WDA returns `501`. The request body is ignored. + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Object + Object UIUiAppForeground(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default); + + /// + /// Foreground app (UI backend) + /// + /// + /// Bring the backgrounded app to the foreground. Only the devicekit backend supports this; WDA returns `501`. The request body is ignored. + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// ApiResponse of Object + ApiResponse UIUiAppForegroundWithHttpInfo(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default); + /// + /// Launch app (UI backend) + /// + /// + /// Launch the app identified by `bundleId`. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Object + Object UIUiAppLaunch(string udid, UIAppRequest uIAppRequest, string? backend = default, string? wdaUrl = default, int? timeout = default); + + /// + /// Launch app (UI backend) + /// + /// + /// Launch the app identified by `bundleId`. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// ApiResponse of Object + ApiResponse UIUiAppLaunchWithHttpInfo(string udid, UIAppRequest uIAppRequest, string? backend = default, string? wdaUrl = default, int? timeout = default); + /// + /// Terminate app (UI backend) + /// + /// + /// Terminate the app identified by `bundleId`. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Object + Object UIUiAppTerminate(string udid, UIAppRequest uIAppRequest, string? backend = default, string? wdaUrl = default, int? timeout = default); + + /// + /// Terminate app (UI backend) + /// + /// + /// Terminate the app identified by `bundleId`. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// ApiResponse of Object + ApiResponse UIUiAppTerminateWithHttpInfo(string udid, UIAppRequest uIAppRequest, string? backend = default, string? wdaUrl = default, int? timeout = default); + /// + /// Press hardware button + /// + /// + /// Press a hardware button by name (WDA supports only `home`). + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Object + Object UIUiButton(string udid, UIButtonRequest uIButtonRequest, string? backend = default, string? wdaUrl = default, int? timeout = default); + + /// + /// Press hardware button + /// + /// + /// Press a hardware button by name (WDA supports only `home`). + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// ApiResponse of Object + ApiResponse UIUiButtonWithHttpInfo(string udid, UIButtonRequest uIButtonRequest, string? backend = default, string? wdaUrl = default, int? timeout = default); + /// + /// Get orientation + /// + /// + /// Get the current device orientation payload. + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Object + Object UIUiGetOrientation(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default); + + /// + /// Get orientation + /// + /// + /// Get the current device orientation payload. + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// ApiResponse of Object + ApiResponse UIUiGetOrientationWithHttpInfo(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default); + /// + /// Long press + /// + /// + /// Press and hold at (x,y). + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Object + Object UIUiLongPress(string udid, UILongPressRequest uILongPressRequest, string? backend = default, string? wdaUrl = default, int? timeout = default); + + /// + /// Long press + /// + /// + /// Press and hold at (x,y). + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// ApiResponse of Object + ApiResponse UIUiLongPressWithHttpInfo(string udid, UILongPressRequest uILongPressRequest, string? backend = default, string? wdaUrl = default, int? timeout = default); + /// + /// UI screenshot (PNG) + /// + /// + /// Capture the screen and return raw PNG bytes. + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Object + Object UIUiScreenshot(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default); + + /// + /// UI screenshot (PNG) + /// + /// + /// Capture the screen and return raw PNG bytes. + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// ApiResponse of Object + ApiResponse UIUiScreenshotWithHttpInfo(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default); + /// + /// Set orientation + /// + /// + /// Set the device orientation. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Object + Object UIUiSetOrientation(string udid, UIOrientationRequest uIOrientationRequest, string? backend = default, string? wdaUrl = default, int? timeout = default); + + /// + /// Set orientation + /// + /// + /// Set the device orientation. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// ApiResponse of Object + ApiResponse UIUiSetOrientationWithHttpInfo(string udid, UIOrientationRequest uIOrientationRequest, string? backend = default, string? wdaUrl = default, int? timeout = default); + /// + /// UI source hierarchy + /// + /// + /// Return the current view hierarchy (XML for WDA; backend Content-Type preserved). + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Object + Object UIUiSource(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default); + + /// + /// UI source hierarchy + /// + /// + /// Return the current view hierarchy (XML for WDA; backend Content-Type preserved). + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// ApiResponse of Object + ApiResponse UIUiSourceWithHttpInfo(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default); + /// + /// UI backend status + /// + /// + /// Return the backend status/health payload (WDA /status or DeviceKit /health). + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Object + Object UIUiStatus(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default); + + /// + /// UI backend status + /// + /// + /// Return the backend status/health payload (WDA /status or DeviceKit /health). + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// ApiResponse of Object + ApiResponse UIUiStatusWithHttpInfo(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default); + /// + /// Swipe + /// + /// + /// Drag from (x1,y1) to (x2,y2). + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Object + Object UIUiSwipe(string udid, UISwipeRequest uISwipeRequest, string? backend = default, string? wdaUrl = default, int? timeout = default); + + /// + /// Swipe + /// + /// + /// Drag from (x1,y1) to (x2,y2). + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// ApiResponse of Object + ApiResponse UIUiSwipeWithHttpInfo(string udid, UISwipeRequest uISwipeRequest, string? backend = default, string? wdaUrl = default, int? timeout = default); + /// + /// Tap + /// + /// + /// Tap at absolute coordinates. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Object + Object UIUiTap(string udid, UITapRequest uITapRequest, string? backend = default, string? wdaUrl = default, int? timeout = default); + + /// + /// Tap + /// + /// + /// Tap at absolute coordinates. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// ApiResponse of Object + ApiResponse UIUiTapWithHttpInfo(string udid, UITapRequest uITapRequest, string? backend = default, string? wdaUrl = default, int? timeout = default); + /// + /// Type text + /// + /// + /// Send text as keyboard input. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Object + Object UIUiType(string udid, UITypeRequest uITypeRequest, string? backend = default, string? wdaUrl = default, int? timeout = default); + + /// + /// Type text + /// + /// + /// Send text as keyboard input. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// ApiResponse of Object + ApiResponse UIUiTypeWithHttpInfo(string udid, UITypeRequest uITypeRequest, string? backend = default, string? wdaUrl = default, int? timeout = default); + /// + /// UI window size + /// + /// + /// Return the device window/screen size payload (typically {width,height}). + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Object + Object UIUiWindowSize(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default); + + /// + /// UI window size + /// + /// + /// Return the device window/screen size payload (typically {width,height}). + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// ApiResponse of Object + ApiResponse UIUiWindowSizeWithHttpInfo(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default); + /// + /// Evaluate JavaScript in a page + /// + /// + /// Evaluate JavaScript in an inspectable page and return the result (CLI: `ios webinspector eval`). `404` when no matching page exists. + /// + /// Thrown when fails to make API call + /// + /// + /// WebInspectorEvalResult + WebInspectorEvalResult WebInspectorWebInspectorEval(string udid, WebInspectorEvalRequest webInspectorEvalRequest); + + /// + /// Evaluate JavaScript in a page + /// + /// + /// Evaluate JavaScript in an inspectable page and return the result (CLI: `ios webinspector eval`). `404` when no matching page exists. + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of WebInspectorEvalResult + ApiResponse WebInspectorWebInspectorEvalWithHttpInfo(string udid, WebInspectorEvalRequest webInspectorEvalRequest); + /// + /// Open a URL in a new inspectable page + /// + /// + /// Open a URL in a new inspectable page via a remote automation session (CLI: `ios webinspector launch <url>`). `url` may be a query param or in the body; `bundleId` defaults to Safari. + /// + /// Thrown when fails to make API call + /// + /// URL to open (alternative to the request body). (optional) + /// (optional) + /// WebInspectorLaunchResult + WebInspectorLaunchResult WebInspectorWebInspectorLaunch(string udid, string? url = default, WebInspectorLaunchRequest? webInspectorLaunchRequest = default); + + /// + /// Open a URL in a new inspectable page + /// + /// + /// Open a URL in a new inspectable page via a remote automation session (CLI: `ios webinspector launch <url>`). `url` may be a query param or in the body; `bundleId` defaults to Safari. + /// + /// Thrown when fails to make API call + /// + /// URL to open (alternative to the request body). (optional) + /// (optional) + /// ApiResponse of WebInspectorLaunchResult + ApiResponse WebInspectorWebInspectorLaunchWithHttpInfo(string udid, string? url = default, WebInspectorLaunchRequest? webInspectorLaunchRequest = default); + /// + /// List inspectable pages + /// + /// + /// List inspectable pages reported by the device (CLI: `ios webinspector list`). + /// + /// Thrown when fails to make API call + /// + /// List<Object> + List WebInspectorWebInspectorPages(string udid); + + /// + /// List inspectable pages + /// + /// + /// List inspectable pages reported by the device (CLI: `ios webinspector list`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of List<Object> + ApiResponse> WebInspectorWebInspectorPagesWithHttpInfo(string udid); + #endregion Synchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IDefaultApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// + /// Get accessibility element snapshot + /// + /// + /// Get a snapshot of the currently focused accessibility element (CLI: `ios ax`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task AccessibilityGetAxSnapshotAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get accessibility element snapshot + /// + /// + /// Get a snapshot of the currently focused accessibility element (CLI: `ios ax`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> AccessibilityGetAxSnapshotWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Get VoiceOver state + /// + /// + /// Get VoiceOver enabled state (CLI: `ios voiceover get`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of VoiceOverState + System.Threading.Tasks.Task AccessibilityGetVoiceOverAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get VoiceOver state + /// + /// + /// Get VoiceOver enabled state (CLI: `ios voiceover get`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (VoiceOverState) + System.Threading.Tasks.Task> AccessibilityGetVoiceOverWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Get ZoomTouch state + /// + /// + /// Get ZoomTouch enabled state (CLI: `ios zoomtouch get`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ZoomTouchState + System.Threading.Tasks.Task AccessibilityGetZoomTouchAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get ZoomTouch state + /// + /// + /// Get ZoomTouch enabled state (CLI: `ios zoomtouch get`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ZoomTouchState) + System.Threading.Tasks.Task> AccessibilityGetZoomTouchWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Run accessibility audit + /// + /// + /// Run the accessibility audit against the focused app and return the issues found (CLI: `ios ax audit`). Bounded by `timeout` (seconds, default 60). + /// + /// Thrown when fails to make API call + /// + /// Audit timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of List<Object> + System.Threading.Tasks.Task> AccessibilityRunAxAuditAsync(string udid, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Run accessibility audit + /// + /// + /// Run the accessibility audit against the focused app and return the issues found (CLI: `ios ax audit`). Bounded by `timeout` (seconds, default 60). + /// + /// Thrown when fails to make API call + /// + /// Audit timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Object>) + System.Threading.Tasks.Task>> AccessibilityRunAxAuditWithHttpInfoAsync(string udid, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Simulate location from a GPX file + /// + /// + /// Simulate live location tracking from an uploaded GPX file (CLI: `ios setlocationgpx`). Send multipart/form-data with a `gpx` file. + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + System.Threading.Tasks.Task AccessibilitySetLocationGpxAsync(string udid, Object gpx, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Simulate location from a GPX file + /// + /// + /// Simulate live location tracking from an uploaded GPX file (CLI: `ios setlocationgpx`). Send multipart/form-data with a `gpx` file. + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + System.Threading.Tasks.Task> AccessibilitySetLocationGpxWithHttpInfoAsync(string udid, Object gpx, System.Threading.CancellationToken cancellationToken = default); + /// + /// Set VoiceOver state + /// + /// + /// Enable/disable VoiceOver (CLI: `ios voiceover enable|disable`). The desired state comes from the JSON body or the `enabled` query param. + /// + /// Thrown when fails to make API call + /// + /// Desired state (alternative to the request body). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of VoiceOverState + System.Threading.Tasks.Task AccessibilitySetVoiceOverAsync(string udid, bool? enabled = default, AXEnabledRequest? aXEnabledRequest = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Set VoiceOver state + /// + /// + /// Enable/disable VoiceOver (CLI: `ios voiceover enable|disable`). The desired state comes from the JSON body or the `enabled` query param. + /// + /// Thrown when fails to make API call + /// + /// Desired state (alternative to the request body). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (VoiceOverState) + System.Threading.Tasks.Task> AccessibilitySetVoiceOverWithHttpInfoAsync(string udid, bool? enabled = default, AXEnabledRequest? aXEnabledRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Set ZoomTouch state + /// + /// + /// Enable/disable ZoomTouch (CLI: `ios zoomtouch enable|disable`). The desired state comes from the JSON body or the `enabled` query param. + /// + /// Thrown when fails to make API call + /// + /// Desired state (alternative to the request body). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of ZoomTouchState + System.Threading.Tasks.Task AccessibilitySetZoomTouchAsync(string udid, bool? enabled = default, AXEnabledRequest? aXEnabledRequest = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Set ZoomTouch state + /// + /// + /// Enable/disable ZoomTouch (CLI: `ios zoomtouch enable|disable`). The desired state comes from the JSON body or the `enabled` query param. + /// + /// Thrown when fails to make API call + /// + /// Desired state (alternative to the request body). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ZoomTouchState) + System.Threading.Tasks.Task> AccessibilitySetZoomTouchWithHttpInfoAsync(string udid, bool? enabled = default, AXEnabledRequest? aXEnabledRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Activate device + /// + /// + /// Activate the device (complete Setup Assistant / activation). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + System.Threading.Tasks.Task DevicesActivateAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Activate device + /// + /// + /// Activate the device (complete Setup Assistant / activation). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + System.Threading.Tasks.Task> DevicesActivateWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Install profile + /// + /// + /// Install a configuration profile (CLI: `ios profile add`). Send the profile as the raw request body, or as multipart with a `profile` file plus an optional `p12` supervisor identity and `password` for a supervised install. + /// + /// Thrown when fails to make API call + /// + /// + /// (optional) + /// Passphrase for the `.p12` identity. (optional) + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + System.Threading.Tasks.Task DevicesAddProfileAsync(string udid, Object profile, Object? p12 = default, string? password = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Install profile + /// + /// + /// Install a configuration profile (CLI: `ios profile add`). Send the profile as the raw request body, or as multipart with a `profile` file plus an optional `p12` supervisor identity and `password` for a supervised install. + /// + /// Thrown when fails to make API call + /// + /// + /// (optional) + /// Passphrase for the `.p12` identity. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + System.Threading.Tasks.Task> DevicesAddProfileWithHttpInfoAsync(string udid, Object profile, Object? p12 = default, string? password = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Start WDA session + /// + /// + /// Start a WebDriverAgent (XCUITest) session. + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of WdaSession + System.Threading.Tasks.Task DevicesCreateWdaSessionAsync(string udid, WdaConfig wdaConfig, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Start WDA session + /// + /// + /// Start a WebDriverAgent (XCUITest) session. + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (WdaSession) + System.Threading.Tasks.Task> DevicesCreateWdaSessionWithHttpInfoAsync(string udid, WdaConfig wdaConfig, System.Threading.CancellationToken cancellationToken = default); + /// + /// Stop WDA session + /// + /// + /// Stop a running WebDriverAgent session. + /// + /// Thrown when fails to make API call + /// + /// The WDA session id. + /// Cancellation Token to cancel the request. + /// Task of WdaSession + System.Threading.Tasks.Task DevicesDeleteWdaSessionAsync(string udid, string sessionId, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Stop WDA session + /// + /// + /// Stop a running WebDriverAgent session. + /// + /// Thrown when fails to make API call + /// + /// The WDA session id. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (WdaSession) + System.Threading.Tasks.Task> DevicesDeleteWdaSessionWithHttpInfoAsync(string udid, string sessionId, System.Threading.CancellationToken cancellationToken = default); + /// + /// Disable condition + /// + /// + /// Disable the currently active condition inducer profile. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + System.Threading.Tasks.Task DevicesDisableConditionAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Disable condition + /// + /// + /// Disable the currently active condition inducer profile. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + System.Threading.Tasks.Task> DevicesDisableConditionWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable condition + /// + /// + /// Enable a condition inducer profile. + /// + /// Thrown when fails to make API call + /// + /// Identifier of the condition profile type. + /// Identifier of the specific profile to activate. + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + System.Threading.Tasks.Task DevicesEnableConditionAsync(string udid, string profileTypeID, string profileID, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Enable condition + /// + /// + /// Enable a condition inducer profile. + /// + /// Thrown when fails to make API call + /// + /// Identifier of the condition profile type. + /// Identifier of the specific profile to activate. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + System.Threading.Tasks.Task> DevicesEnableConditionWithHttpInfoAsync(string udid, string profileTypeID, string profileID, System.Threading.CancellationToken cancellationToken = default); + /// + /// Erase device + /// + /// + /// Erase all content and settings (CLI: `ios erase`). Destructive: requires `confirm=true`. + /// + /// Thrown when fails to make API call + /// + /// Must be `true` to proceed with the destructive erase. + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + System.Threading.Tasks.Task DevicesEraseAsync(string udid, bool confirm, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Erase device + /// + /// + /// Erase all content and settings (CLI: `ios erase`). Destructive: requires `confirm=true`. + /// + /// Thrown when fails to make API call + /// + /// Must be `true` to proceed with the destructive erase. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + System.Threading.Tasks.Task> DevicesEraseWithHttpInfoAsync(string udid, bool confirm, System.Threading.CancellationToken cancellationToken = default); + /// + /// Get AssistiveTouch + /// + /// + /// Get AssistiveTouch state (CLI: `ios assistivetouch get`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of AssistiveTouchState + System.Threading.Tasks.Task DevicesGetAssistiveTouchAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get AssistiveTouch + /// + /// + /// Get AssistiveTouch state (CLI: `ios assistivetouch get`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (AssistiveTouchState) + System.Threading.Tasks.Task> DevicesGetAssistiveTouchWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Get battery info + /// + /// + /// Get battery diagnostics (CLI: `ios batterycheck`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of BatteryInfo + System.Threading.Tasks.Task DevicesGetBatteryAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get battery info + /// + /// + /// Get battery diagnostics (CLI: `ios batterycheck`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (BatteryInfo) + System.Threading.Tasks.Task> DevicesGetBatteryWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Get developer mode + /// + /// + /// Get developer mode state (CLI: `ios devmode get`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of DevModeState + System.Threading.Tasks.Task DevicesGetDevModeAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get developer mode + /// + /// + /// Get developer mode state (CLI: `ios devmode get`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (DevModeState) + System.Threading.Tasks.Task> DevicesGetDevModeWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Get device date + /// + /// + /// Get the device clock (CLI: `ios date`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of DeviceDate + System.Threading.Tasks.Task DevicesGetDeviceDateAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get device date + /// + /// + /// Get the device clock (CLI: `ios date`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (DeviceDate) + System.Threading.Tasks.Task> DevicesGetDeviceDateWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Get device name + /// + /// + /// Get the device name (CLI: `ios devicename`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of DeviceName + System.Threading.Tasks.Task DevicesGetDeviceNameAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get device name + /// + /// + /// Get the device name (CLI: `ios devicename`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (DeviceName) + System.Threading.Tasks.Task> DevicesGetDeviceNameWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// List diagnostics + /// + /// + /// List all IORegistry/diagnostic values (CLI: `ios diagnostics list`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task DevicesGetDiagnosticsAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// List diagnostics + /// + /// + /// List all IORegistry/diagnostic values (CLI: `ios diagnostics list`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> DevicesGetDiagnosticsWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Get icon layout + /// + /// + /// Get the SpringBoard icon layout (CLI: `ios get-icon-layout`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task DevicesGetIconLayoutAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get icon layout + /// + /// + /// Get the SpringBoard icon layout (CLI: `ios get-icon-layout`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> DevicesGetIconLayoutWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Get device info + /// + /// + /// Get lockdown values plus `instruments:*` keys for the device. Returns an open dictionary of heterogeneous values. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task DevicesGetInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get device info + /// + /// + /// Get lockdown values plus `instruments:*` keys for the device. Returns an open dictionary of heterogeneous values. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> DevicesGetInfoWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Get job + /// + /// + /// Get a job's status. Returns `404` for an unknown job on this device. + /// + /// Thrown when fails to make API call + /// + /// The job id. + /// Cancellation Token to cancel the request. + /// Task of Job + System.Threading.Tasks.Task DevicesGetJobAsync(string udid, string id, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get job + /// + /// + /// Get a job's status. Returns `404` for an unknown job on this device. + /// + /// Thrown when fails to make API call + /// + /// The job id. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Job) + System.Threading.Tasks.Task> DevicesGetJobWithHttpInfoAsync(string udid, string id, System.Threading.CancellationToken cancellationToken = default); + /// + /// Get language + /// + /// + /// Get the device language/locale configuration (CLI: `ios lang`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of LanguageConfiguration + System.Threading.Tasks.Task DevicesGetLanguageAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get language + /// + /// + /// Get the device language/locale configuration (CLI: `ios lang`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (LanguageConfiguration) + System.Threading.Tasks.Task> DevicesGetLanguageWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Get lockdown values + /// + /// + /// Get lockdown values (CLI: `ios lockdown get`). Without `domain` the full set is returned; with `domain` the values are scoped to that lockdown domain. + /// + /// Thrown when fails to make API call + /// + /// Optional lockdown domain to scope the returned values. (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task DevicesGetLockdownValuesAsync(string udid, string? domain = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get lockdown values + /// + /// + /// Get lockdown values (CLI: `ios lockdown get`). Without `domain` the full set is returned; with `domain` the values are scoped to that lockdown domain. + /// + /// Thrown when fails to make API call + /// + /// Optional lockdown domain to scope the returned values. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> DevicesGetLockdownValuesWithHttpInfoAsync(string udid, string? domain = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Query MobileGestalt + /// + /// + /// Query one or more MobileGestalt keys (CLI: `ios mobilegestalt <key>...`). Pass repeated `key` query params. + /// + /// Thrown when fails to make API call + /// + /// One or more MobileGestalt keys to query. + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task DevicesGetMobileGestaltAsync(string udid, List key, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Query MobileGestalt + /// + /// + /// Query one or more MobileGestalt keys (CLI: `ios mobilegestalt <key>...`). Pass repeated `key` query params. + /// + /// Thrown when fails to make API call + /// + /// One or more MobileGestalt keys to query. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> DevicesGetMobileGestaltWithHttpInfoAsync(string udid, List key, System.Threading.CancellationToken cancellationToken = default); + /// + /// Get pasteboard + /// + /// + /// Get the pasteboard (clipboard) text (CLI: `ios pasteboard get`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of PasteboardContent + System.Threading.Tasks.Task DevicesGetPasteboardAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get pasteboard + /// + /// + /// Get the pasteboard (clipboard) text (CLI: `ios pasteboard get`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (PasteboardContent) + System.Threading.Tasks.Task> DevicesGetPasteboardWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// List processes + /// + /// + /// List running processes (CLI: `ios ps [- -apps]`). + /// + /// Thrown when fails to make API call + /// + /// Only return application processes. (optional) + /// Cancellation Token to cancel the request. + /// Task of List<ProcessInfo> + System.Threading.Tasks.Task> DevicesGetProcessesAsync(string udid, bool? apps = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// List processes + /// + /// + /// List running processes (CLI: `ios ps [- -apps]`). + /// + /// Thrown when fails to make API call + /// + /// Only return application processes. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<ProcessInfo>) + System.Threading.Tasks.Task>> DevicesGetProcessesWithHttpInfoAsync(string udid, bool? apps = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// List configuration profiles + /// + /// + /// List installed configuration profiles. Returns an open dictionary. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task DevicesGetProfilesAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// List configuration profiles + /// + /// + /// List installed configuration profiles. Returns an open dictionary. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> DevicesGetProfilesWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Get time format + /// + /// + /// Get the 24-hour clock state (CLI: `ios timeformat get`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of TimeFormatState + System.Threading.Tasks.Task DevicesGetTimeFormatAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get time format + /// + /// + /// Get the 24-hour clock state (CLI: `ios timeformat get`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (TimeFormatState) + System.Threading.Tasks.Task> DevicesGetTimeFormatWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Get wallpaper + /// + /// + /// Get the home-screen wallpaper as PNG (CLI: `ios get-wallpaper`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task DevicesGetWallpaperAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get wallpaper + /// + /// + /// Get the home-screen wallpaper as PNG (CLI: `ios get-wallpaper`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> DevicesGetWallpaperWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Get WDA session + /// + /// + /// Get a running WebDriverAgent session. Returns `404` for an unknown session. + /// + /// Thrown when fails to make API call + /// + /// The WDA session id. + /// Cancellation Token to cancel the request. + /// Task of WdaSession + System.Threading.Tasks.Task DevicesGetWdaSessionAsync(string udid, string sessionId, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get WDA session + /// + /// + /// Get a running WebDriverAgent session. Returns `404` for an unknown session. + /// + /// Thrown when fails to make API call + /// + /// The WDA session id. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (WdaSession) + System.Threading.Tasks.Task> DevicesGetWdaSessionWithHttpInfoAsync(string udid, string sessionId, System.Threading.CancellationToken cancellationToken = default); + /// + /// Install app + /// + /// + /// Install an application from an uploaded `.ipa`/`.app` archive. The multipart `file` part must be 1 byte–200 MB. + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + System.Threading.Tasks.Task DevicesInstallAppAsync(string udid, Object file, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Install app + /// + /// + /// Install an application from an uploaded `.ipa`/`.app` archive. The multipart `file` part must be 1 byte–200 MB. + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + System.Threading.Tasks.Task> DevicesInstallAppWithHttpInfoAsync(string udid, Object file, System.Threading.CancellationToken cancellationToken = default); + /// + /// Kill app + /// + /// + /// Kill a running application by bundle id. + /// + /// Thrown when fails to make API call + /// + /// Bundle id of the app to kill. + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + System.Threading.Tasks.Task DevicesKillAppAsync(string udid, string bundleID, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Kill app + /// + /// + /// Kill a running application by bundle id. + /// + /// Thrown when fails to make API call + /// + /// Bundle id of the app to kill. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + System.Threading.Tasks.Task> DevicesKillAppWithHttpInfoAsync(string udid, string bundleID, System.Threading.CancellationToken cancellationToken = default); + /// + /// Launch app + /// + /// + /// Launch an application by bundle id. + /// + /// Thrown when fails to make API call + /// + /// Bundle id of the app to launch. + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + System.Threading.Tasks.Task DevicesLaunchAppAsync(string udid, string bundleID, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Launch app + /// + /// + /// Launch an application by bundle id. + /// + /// Thrown when fails to make API call + /// + /// Bundle id of the app to launch. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + System.Threading.Tasks.Task> DevicesLaunchAppWithHttpInfoAsync(string udid, string bundleID, System.Threading.CancellationToken cancellationToken = default); + /// + /// List apps + /// + /// + /// List installed applications. Each entry is an open Info.plist map. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of List<AppInfo> + System.Threading.Tasks.Task> DevicesListAppsAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// List apps + /// + /// + /// List installed applications. Each entry is an open Info.plist map. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<AppInfo>) + System.Threading.Tasks.Task>> DevicesListAppsWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// List conditions + /// + /// + /// List available condition inducer profile types. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of List<ProfileType> + System.Threading.Tasks.Task> DevicesListConditionsAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// List conditions + /// + /// + /// List available condition inducer profile types. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<ProfileType>) + System.Threading.Tasks.Task>> DevicesListConditionsWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// List crash reports + /// + /// + /// List crash reports (CLI: `ios crash ls`). + /// + /// Thrown when fails to make API call + /// + /// Optional glob pattern to filter reports. (optional) + /// Cancellation Token to cancel the request. + /// Task of CrashListing + System.Threading.Tasks.Task DevicesListCrashesAsync(string udid, string? pattern = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// List crash reports + /// + /// + /// List crash reports (CLI: `ios crash ls`). + /// + /// Thrown when fails to make API call + /// + /// Optional glob pattern to filter reports. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (CrashListing) + System.Threading.Tasks.Task> DevicesListCrashesWithHttpInfoAsync(string udid, string? pattern = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// List files + /// + /// + /// List a device directory (CLI: `ios file ls`). + /// + /// Thrown when fails to make API call + /// + /// File service domain: `app`, `app-group`, `crash` or `temp`. + /// Bundle/group id for the `app`/`app-group` domains. (optional) + /// Directory path to list (defaults to `.`). (optional) + /// Cancellation Token to cancel the request. + /// Task of FileListing + System.Threading.Tasks.Task DevicesListFilesAsync(string udid, FileDomain domain, string? identifier = default, string? path = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// List files + /// + /// + /// List a device directory (CLI: `ios file ls`). + /// + /// Thrown when fails to make API call + /// + /// File service domain: `app`, `app-group`, `crash` or `temp`. + /// Bundle/group id for the `app`/`app-group` domains. (optional) + /// Directory path to list (defaults to `.`). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FileListing) + System.Threading.Tasks.Task> DevicesListFilesWithHttpInfoAsync(string udid, FileDomain domain, string? identifier = default, string? path = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// List mounted developer images + /// + /// + /// List the hex signatures of Developer Disk Images mounted on the device. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of List<string> + System.Threading.Tasks.Task> DevicesListImagesAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// List mounted developer images + /// + /// + /// List the hex signatures of Developer Disk Images mounted on the device. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<string>) + System.Threading.Tasks.Task>> DevicesListImagesWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// List jobs + /// + /// + /// List jobs for a device. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of List<Job> + System.Threading.Tasks.Task> DevicesListJobsAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// List jobs + /// + /// + /// List jobs for a device. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Job>) + System.Threading.Tasks.Task>> DevicesListJobsWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// List mounted images + /// + /// + /// List mounted developer image signatures (CLI: `ios image list`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of MountedImages + System.Threading.Tasks.Task DevicesListMountedImagesAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// List mounted images + /// + /// + /// List mounted developer image signatures (CLI: `ios image list`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (MountedImages) + System.Threading.Tasks.Task> DevicesListMountedImagesWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Clear passcode (supervised) + /// + /// + /// Clear the device passcode (CLI: `ios mdm clear-passcode`). Requires the base64 unlock token as an additional `token` form field. + /// + /// Thrown when fails to make API call + /// + /// + /// Base64-encoded escrow unlock token. + /// Passphrase for the `.p12` identity. (optional) + /// Cancellation Token to cancel the request. + /// Task of StatusOk + System.Threading.Tasks.Task DevicesMdmClearPasscodeAsync(string udid, Object p12, string token, string? password = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Clear passcode (supervised) + /// + /// + /// Clear the device passcode (CLI: `ios mdm clear-passcode`). Requires the base64 unlock token as an additional `token` form field. + /// + /// Thrown when fails to make API call + /// + /// + /// Base64-encoded escrow unlock token. + /// Passphrase for the `.p12` identity. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (StatusOk) + System.Threading.Tasks.Task> DevicesMdmClearPasscodeWithHttpInfoAsync(string udid, Object p12, string token, string? password = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Clear Screen Time password (supervised) + /// + /// + /// Clear the Screen Time password (CLI: `ios mdm clear-screen-time-password`). + /// + /// Thrown when fails to make API call + /// + /// + /// Passphrase for the `.p12` identity. (optional) + /// Cancellation Token to cancel the request. + /// Task of StatusOk + System.Threading.Tasks.Task DevicesMdmClearScreenTimePasswordAsync(string udid, Object p12, string? password = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Clear Screen Time password (supervised) + /// + /// + /// Clear the Screen Time password (CLI: `ios mdm clear-screen-time-password`). + /// + /// Thrown when fails to make API call + /// + /// + /// Passphrase for the `.p12` identity. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (StatusOk) + System.Threading.Tasks.Task> DevicesMdmClearScreenTimePasswordWithHttpInfoAsync(string udid, Object p12, string? password = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Fetch unlock token (supervised) + /// + /// + /// Fetch the escrow unlock token, base64-encoded (CLI: `ios mdm fetch-unlock-token`). + /// + /// Thrown when fails to make API call + /// + /// + /// Passphrase for the `.p12` identity. (optional) + /// Cancellation Token to cancel the request. + /// Task of UnlockToken + System.Threading.Tasks.Task DevicesMdmFetchUnlockTokenAsync(string udid, Object p12, string? password = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Fetch unlock token (supervised) + /// + /// + /// Fetch the escrow unlock token, base64-encoded (CLI: `ios mdm fetch-unlock-token`). + /// + /// Thrown when fails to make API call + /// + /// + /// Passphrase for the `.p12` identity. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (UnlockToken) + System.Threading.Tasks.Task> DevicesMdmFetchUnlockTokenWithHttpInfoAsync(string udid, Object p12, string? password = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Get MDM security info (supervised) + /// + /// + /// Get device security info (CLI: `ios mdm security-info`). + /// + /// Thrown when fails to make API call + /// + /// + /// Passphrase for the `.p12` identity. (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task DevicesMdmSecurityInfoAsync(string udid, Object p12, string? password = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get MDM security info (supervised) + /// + /// + /// Get device security info (CLI: `ios mdm security-info`). + /// + /// Thrown when fails to make API call + /// + /// + /// Passphrase for the `.p12` identity. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> DevicesMdmSecurityInfoWithHttpInfoAsync(string udid, Object p12, string? password = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Waive memory limit + /// + /// + /// Waive the memory limit for a process (CLI: `ios memlimitoff`). The process name may be given via the `process` query param or the JSON body. + /// + /// Thrown when fails to make API call + /// + /// Process name whose memory limit should be waived. (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of MemLimitResult + System.Threading.Tasks.Task DevicesMemLimitOffAsync(string udid, string? process = default, MemLimitRequest? memLimitRequest = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Waive memory limit + /// + /// + /// Waive the memory limit for a process (CLI: `ios memlimitoff`). The process name may be given via the `process` query param or the JSON body. + /// + /// Thrown when fails to make API call + /// + /// Process name whose memory limit should be waived. (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (MemLimitResult) + System.Threading.Tasks.Task> DevicesMemLimitOffWithHttpInfoAsync(string udid, string? process = default, MemLimitRequest? memLimitRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Mount a developer image + /// + /// + /// Mount a Developer Disk Image. Either let the server auto-resolve and download the correct image (`auto=true`, optionally with `basedir`), or stream the image bytes as the raw request body (up to 2 GiB). + /// + /// Thrown when fails to make API call + /// + /// Auto-resolve and download the matching DDI for the device. (optional) + /// Base directory the server uses to cache/lookup DDIs when `auto=true`. (optional) + /// Raw Developer Disk Image bytes (used when not auto-resolving). Content up to 2 GiB. (optional) + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + System.Threading.Tasks.Task DevicesMountImageAsync(string udid, bool? auto = default, string? basedir = default, Object? body = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Mount a developer image + /// + /// + /// Mount a Developer Disk Image. Either let the server auto-resolve and download the correct image (`auto=true`, optionally with `basedir`), or stream the image bytes as the raw request body (up to 2 GiB). + /// + /// Thrown when fails to make API call + /// + /// Auto-resolve and download the matching DDI for the device. (optional) + /// Base directory the server uses to cache/lookup DDIs when `auto=true`. (optional) + /// Raw Developer Disk Image bytes (used when not auto-resolving). Content up to 2 GiB. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + System.Threading.Tasks.Task> DevicesMountImageWithHttpInfoAsync(string udid, bool? auto = default, string? basedir = default, Object? body = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Pair device + /// + /// + /// Pair with the device. For a supervised pairing (`supervised=true`) upload the supervision identity as `p12file` (multipart) and supply the passphrase in the `Supervision-Password` header. Returns `423` when the device is locked and pairing cannot proceed. + /// + /// Thrown when fails to make API call + /// + /// Whether this is a supervised pairing. + /// + /// Supervision identity passphrase (required when supervised). (optional) + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + System.Threading.Tasks.Task DevicesPairAsync(string udid, bool supervised, Object p12file, string? supervisionPassword = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Pair device + /// + /// + /// Pair with the device. For a supervised pairing (`supervised=true`) upload the supervision identity as `p12file` (multipart) and supply the passphrase in the `Supervision-Password` header. Returns `423` when the device is locked and pairing cannot proceed. + /// + /// Thrown when fails to make API call + /// + /// Whether this is a supervised pairing. + /// + /// Supervision identity passphrase (required when supervised). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + System.Threading.Tasks.Task> DevicesPairWithHttpInfoAsync(string udid, bool supervised, Object p12file, string? supervisionPassword = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Pull file + /// + /// + /// Download a file from the device, streamed as the response body (CLI: `ios file pull`). + /// + /// Thrown when fails to make API call + /// + /// File service domain: `app`, `app-group`, `crash` or `temp`. + /// Remote file path on the device. + /// Bundle/group id for the `app`/`app-group` domains. (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task DevicesPullFileAsync(string udid, FileDomain domain, string remote, string? identifier = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Pull file + /// + /// + /// Download a file from the device, streamed as the response body (CLI: `ios file pull`). + /// + /// Thrown when fails to make API call + /// + /// File service domain: `app`, `app-group`, `crash` or `temp`. + /// Remote file path on the device. + /// Bundle/group id for the `app`/`app-group` domains. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> DevicesPullFileWithHttpInfoAsync(string udid, FileDomain domain, string remote, string? identifier = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Push file + /// + /// + /// Upload the request body to a device path (CLI: `ios file push`). A `Content-Length` header is required. + /// + /// Thrown when fails to make API call + /// + /// File service domain: `app`, `app-group`, `crash` or `temp`. + /// Destination path on the device. + /// Raw file bytes to upload. + /// Bundle/group id for the `app`/`app-group` domains. (optional) + /// Cancellation Token to cancel the request. + /// Task of FilePushResult + System.Threading.Tasks.Task DevicesPushFileAsync(string udid, FileDomain domain, string remote, Object body, string? identifier = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Push file + /// + /// + /// Upload the request body to a device path (CLI: `ios file push`). A `Content-Length` header is required. + /// + /// Thrown when fails to make API call + /// + /// File service domain: `app`, `app-group`, `crash` or `temp`. + /// Destination path on the device. + /// Raw file bytes to upload. + /// Bundle/group id for the `app`/`app-group` domains. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FilePushResult) + System.Threading.Tasks.Task> DevicesPushFileWithHttpInfoAsync(string udid, FileDomain domain, string remote, Object body, string? identifier = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Reboot device + /// + /// + /// Reboot the device (CLI: `ios reboot`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + System.Threading.Tasks.Task DevicesRebootAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Reboot device + /// + /// + /// Reboot the device (CLI: `ios reboot`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + System.Threading.Tasks.Task> DevicesRebootWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete crash reports + /// + /// + /// Delete crash reports (CLI: `ios crash rm`). + /// + /// Thrown when fails to make API call + /// + /// Working directory on the device. + /// Glob pattern of reports to delete. + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + System.Threading.Tasks.Task DevicesRemoveCrashesAsync(string udid, string cwd, string pattern, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Delete crash reports + /// + /// + /// Delete crash reports (CLI: `ios crash rm`). + /// + /// Thrown when fails to make API call + /// + /// Working directory on the device. + /// Glob pattern of reports to delete. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + System.Threading.Tasks.Task> DevicesRemoveCrashesWithHttpInfoAsync(string udid, string cwd, string pattern, System.Threading.CancellationToken cancellationToken = default); + /// + /// Remove HTTP proxy + /// + /// + /// Clear the global HTTP proxy (CLI: `ios httpproxy remove`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + System.Threading.Tasks.Task DevicesRemoveHttpProxyAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Remove HTTP proxy + /// + /// + /// Clear the global HTTP proxy (CLI: `ios httpproxy remove`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + System.Threading.Tasks.Task> DevicesRemoveHttpProxyWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Remove profile + /// + /// + /// Remove a configuration profile by identifier (CLI: `ios profile remove`). + /// + /// Thrown when fails to make API call + /// + /// The profile identifier to remove. + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + System.Threading.Tasks.Task DevicesRemoveProfileAsync(string udid, string name, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Remove profile + /// + /// + /// Remove a configuration profile by identifier (CLI: `ios profile remove`). + /// + /// Thrown when fails to make API call + /// + /// The profile identifier to remove. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + System.Threading.Tasks.Task> DevicesRemoveProfileWithHttpInfoAsync(string udid, string name, System.Threading.CancellationToken cancellationToken = default); + /// + /// Remove wifi + /// + /// + /// Remove a provisioned wifi network (CLI: `ios wifi - -remove`). + /// + /// Thrown when fails to make API call + /// + /// SSID of the network to remove. + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + System.Threading.Tasks.Task DevicesRemoveWifiAsync(string udid, string ssid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Remove wifi + /// + /// + /// Remove a provisioned wifi network (CLI: `ios wifi - -remove`). + /// + /// Thrown when fails to make API call + /// + /// SSID of the network to remove. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + System.Threading.Tasks.Task> DevicesRemoveWifiWithHttpInfoAsync(string udid, string ssid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Reset accessibility + /// + /// + /// Reset accessibility settings on the device. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + System.Threading.Tasks.Task DevicesResetAccessibilityAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Reset accessibility + /// + /// + /// Reset accessibility settings on the device. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + System.Threading.Tasks.Task> DevicesResetAccessibilityWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Reset simulated location + /// + /// + /// Reset the simulated location back to the device's real GPS location. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + System.Threading.Tasks.Task DevicesResetLocationAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Reset simulated location + /// + /// + /// Reset the simulated location back to the device's real GPS location. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + System.Threading.Tasks.Task> DevicesResetLocationWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Capture screenshot + /// + /// + /// Capture a screenshot. Returns raw PNG bytes (`image/png`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task DevicesScreenshotAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Capture screenshot + /// + /// + /// Capture a screenshot. Returns raw PNG bytes (`image/png`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> DevicesScreenshotWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Set AssistiveTouch + /// + /// + /// Enable/disable AssistiveTouch (CLI: `ios assistivetouch enable|disable`). + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of AssistiveTouchState + System.Threading.Tasks.Task DevicesSetAssistiveTouchAsync(string udid, EnabledRequest enabledRequest, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Set AssistiveTouch + /// + /// + /// Enable/disable AssistiveTouch (CLI: `ios assistivetouch enable|disable`). + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (AssistiveTouchState) + System.Threading.Tasks.Task> DevicesSetAssistiveTouchWithHttpInfoAsync(string udid, EnabledRequest enabledRequest, System.Threading.CancellationToken cancellationToken = default); + /// + /// Set developer mode + /// + /// + /// Enable or reveal developer mode (CLI: `ios devmode enable|reveal`). + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + System.Threading.Tasks.Task DevicesSetDevModeAsync(string udid, DevModeRequest devModeRequest, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Set developer mode + /// + /// + /// Enable or reveal developer mode (CLI: `ios devmode enable|reveal`). + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + System.Threading.Tasks.Task> DevicesSetDevModeWithHttpInfoAsync(string udid, DevModeRequest devModeRequest, System.Threading.CancellationToken cancellationToken = default); + /// + /// Set HTTP proxy (supervised) + /// + /// + /// Configure a global HTTP proxy (CLI: `ios httpproxy`). Supervised: send multipart form-data with `host`, `port`, a `p12` supervisor identity and optional `user`/`pass`/`password` fields. + /// + /// Thrown when fails to make API call + /// + /// Proxy host. + /// Proxy port. + /// + /// Proxy username. (optional) + /// Proxy password. (optional) + /// Passphrase for the `.p12` identity. (optional) + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + System.Threading.Tasks.Task DevicesSetHttpProxyAsync(string udid, string host, string port, Object p12, string? user = default, string? pass = default, string? password = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Set HTTP proxy (supervised) + /// + /// + /// Configure a global HTTP proxy (CLI: `ios httpproxy`). Supervised: send multipart form-data with `host`, `port`, a `p12` supervisor identity and optional `user`/`pass`/`password` fields. + /// + /// Thrown when fails to make API call + /// + /// Proxy host. + /// Proxy port. + /// + /// Proxy username. (optional) + /// Proxy password. (optional) + /// Passphrase for the `.p12` identity. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + System.Threading.Tasks.Task> DevicesSetHttpProxyWithHttpInfoAsync(string udid, string host, string port, Object p12, string? user = default, string? pass = default, string? password = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Set icon layout + /// + /// + /// Restore a SpringBoard icon layout (CLI: `ios set-icon-layout`). Body is the layout JSON as returned by GET. + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + System.Threading.Tasks.Task DevicesSetIconLayoutAsync(string udid, Object body, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Set icon layout + /// + /// + /// Restore a SpringBoard icon layout (CLI: `ios set-icon-layout`). Body is the layout JSON as returned by GET. + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + System.Threading.Tasks.Task> DevicesSetIconLayoutWithHttpInfoAsync(string udid, Object body, System.Threading.CancellationToken cancellationToken = default); + /// + /// Set language + /// + /// + /// Set the device language and/or locale (CLI: `ios lang - -setlang - -setlocale`). Returns the resulting configuration. + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of LanguageConfiguration + System.Threading.Tasks.Task DevicesSetLanguageAsync(string udid, SetLanguageRequest setLanguageRequest, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Set language + /// + /// + /// Set the device language and/or locale (CLI: `ios lang - -setlang - -setlocale`). Returns the resulting configuration. + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (LanguageConfiguration) + System.Threading.Tasks.Task> DevicesSetLanguageWithHttpInfoAsync(string udid, SetLanguageRequest setLanguageRequest, System.Threading.CancellationToken cancellationToken = default); + /// + /// Set simulated location + /// + /// + /// Simulate a GPS location on the device. NOTE: the longitude parameter was historically misspelled `longtitude` on the wire. This spec fixes it to `longitude`; the go-ios server accepts `longitude` (and may keep `longtitude` as a deprecated alias). + /// + /// Thrown when fails to make API call + /// + /// Latitude in decimal degrees. + /// Longitude in decimal degrees. + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + System.Threading.Tasks.Task DevicesSetLocationAsync(string udid, string latitude, string longitude, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Set simulated location + /// + /// + /// Simulate a GPS location on the device. NOTE: the longitude parameter was historically misspelled `longtitude` on the wire. This spec fixes it to `longitude`; the go-ios server accepts `longitude` (and may keep `longtitude` as a deprecated alias). + /// + /// Thrown when fails to make API call + /// + /// Latitude in decimal degrees. + /// Longitude in decimal degrees. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + System.Threading.Tasks.Task> DevicesSetLocationWithHttpInfoAsync(string udid, string latitude, string longitude, System.Threading.CancellationToken cancellationToken = default); + /// + /// Set pasteboard + /// + /// + /// Set the pasteboard text from the raw request body (CLI: `ios pasteboard set`). + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + System.Threading.Tasks.Task DevicesSetPasteboardAsync(string udid, string body, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Set pasteboard + /// + /// + /// Set the pasteboard text from the raw request body (CLI: `ios pasteboard set`). + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + System.Threading.Tasks.Task> DevicesSetPasteboardWithHttpInfoAsync(string udid, string body, System.Threading.CancellationToken cancellationToken = default); + /// + /// Set time format + /// + /// + /// Set 24-hour / 12-hour clock (CLI: `ios timeformat 24h|12h`). + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of TimeFormatState + System.Threading.Tasks.Task DevicesSetTimeFormatAsync(string udid, TimeFormatRequest timeFormatRequest, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Set time format + /// + /// + /// Set 24-hour / 12-hour clock (CLI: `ios timeformat 24h|12h`). + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (TimeFormatState) + System.Threading.Tasks.Task> DevicesSetTimeFormatWithHttpInfoAsync(string udid, TimeFormatRequest timeFormatRequest, System.Threading.CancellationToken cancellationToken = default); + /// + /// Set wallpaper (supervised) + /// + /// + /// Set the wallpaper (CLI: `ios set-wallpaper`). Supervised: upload the image and a `.p12` supervisor identity as multipart form-data. + /// + /// Thrown when fails to make API call + /// + /// + /// + /// Passphrase for the `.p12` identity. (optional) + /// Target screen (`home`, `lock`, `both`). (optional) + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + System.Threading.Tasks.Task DevicesSetWallpaperAsync(string udid, Object image, Object p12, string? password = default, string? screen = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Set wallpaper (supervised) + /// + /// + /// Set the wallpaper (CLI: `ios set-wallpaper`). Supervised: upload the image and a `.p12` supervisor identity as multipart form-data. + /// + /// Thrown when fails to make API call + /// + /// + /// + /// Passphrase for the `.p12` identity. (optional) + /// Target screen (`home`, `lock`, `both`). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + System.Threading.Tasks.Task> DevicesSetWallpaperWithHttpInfoAsync(string udid, Object image, Object p12, string? password = default, string? screen = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Provision wifi + /// + /// + /// Provision a wifi network (CLI: `ios wifi`). + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + System.Threading.Tasks.Task DevicesSetWifiAsync(string udid, WifiRequest wifiRequest, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Provision wifi + /// + /// + /// Provision a wifi network (CLI: `ios wifi`). + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + System.Threading.Tasks.Task> DevicesSetWifiWithHttpInfoAsync(string udid, WifiRequest wifiRequest, System.Threading.CancellationToken cancellationToken = default); + /// + /// Shut down device + /// + /// + /// Shut down the device (CLI: `ios shutdown`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + System.Threading.Tasks.Task DevicesShutdownAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Shut down device + /// + /// + /// Shut down the device (CLI: `ios shutdown`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + System.Threading.Tasks.Task> DevicesShutdownWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Start port forward (job) + /// + /// + /// Start a TCP port forward host→device as an async job (CLI: `ios forward`). + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of Job + System.Threading.Tasks.Task DevicesStartForwardAsync(string udid, ForwardRequest forwardRequest, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Start port forward (job) + /// + /// + /// Start a TCP port forward host→device as an async job (CLI: `ios forward`). + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Job) + System.Threading.Tasks.Task> DevicesStartForwardWithHttpInfoAsync(string udid, ForwardRequest forwardRequest, System.Threading.CancellationToken cancellationToken = default); + /// + /// Start test run (job) + /// + /// + /// Start an XCUITest/unit-test run as an async job (CLI: `ios runtest`). Returns `202` with the created job. + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of Job + System.Threading.Tasks.Task DevicesStartRunTestAsync(string udid, RunTestRequest runTestRequest, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Start test run (job) + /// + /// + /// Start an XCUITest/unit-test run as an async job (CLI: `ios runtest`). Returns `202` with the created job. + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Job) + System.Threading.Tasks.Task> DevicesStartRunTestWithHttpInfoAsync(string udid, RunTestRequest runTestRequest, System.Threading.CancellationToken cancellationToken = default); + /// + /// Start WDA runner (job) + /// + /// + /// Start the WebDriverAgent runner as an async job (CLI: `ios runwda`). Body fields are optional and default to the standard WDA bundle id and config. + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of Job + System.Threading.Tasks.Task DevicesStartRunWdaAsync(string udid, RunTestRequest? runTestRequest = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Start WDA runner (job) + /// + /// + /// Start the WebDriverAgent runner as an async job (CLI: `ios runwda`). Body fields are optional and default to the standard WDA bundle id and config. + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Job) + System.Threading.Tasks.Task> DevicesStartRunWdaWithHttpInfoAsync(string udid, RunTestRequest? runTestRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Stop or delete job + /// + /// + /// Stop a running job, or purge an already-terminal one from the registry (CLI: Ctrl-C on the equivalent command). + /// + /// Thrown when fails to make API call + /// + /// The job id. + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + System.Threading.Tasks.Task DevicesStopJobAsync(string udid, string id, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Stop or delete job + /// + /// + /// Stop a running job, or purge an already-terminal one from the registry (CLI: Ctrl-C on the equivalent command). + /// + /// Thrown when fails to make API call + /// + /// The job id. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + System.Threading.Tasks.Task> DevicesStopJobWithHttpInfoAsync(string udid, string id, System.Threading.CancellationToken cancellationToken = default); + /// + /// Stream job logs (SSE) + /// + /// + /// Stream a job's log output as Server-Sent Events: the buffered history first, then live lines until the job ends or the client disconnects. + /// + /// Thrown when fails to make API call + /// + /// The job id. + /// Cancellation Token to cancel the request. + /// Task of string + System.Threading.Tasks.Task DevicesStreamJobLogsAsync(string udid, string id, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Stream job logs (SSE) + /// + /// + /// Stream a job's log output as Server-Sent Events: the buffered history first, then live lines until the job ends or the client disconnects. + /// + /// Thrown when fails to make API call + /// + /// The job id. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (string) + System.Threading.Tasks.Task> DevicesStreamJobLogsWithHttpInfoAsync(string udid, string id, System.Threading.CancellationToken cancellationToken = default); + /// + /// Stream device attach/detach (SSE) + /// + /// + /// Stream device attach/detach events as Server-Sent Events. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of string + System.Threading.Tasks.Task DevicesStreamListenAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Stream device attach/detach (SSE) + /// + /// + /// Stream device attach/detach events as Server-Sent Events. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (string) + System.Threading.Tasks.Task> DevicesStreamListenWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Stream app-state notifications (SSE) + /// + /// + /// Stream application state-change notifications as Server-Sent Events. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of string + System.Threading.Tasks.Task DevicesStreamNotificationsAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Stream app-state notifications (SSE) + /// + /// + /// Stream application state-change notifications as Server-Sent Events. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (string) + System.Threading.Tasks.Task> DevicesStreamNotificationsWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Stream os_log trace (SSE) + /// + /// + /// Stream structured os_log trace entries as Server-Sent Events. All filters are optional and combine with AND semantics. + /// + /// Thrown when fails to make API call + /// + /// Only include entries from this process id. (optional) + /// Minimum log level to include (e.g. `info`, `debug`, `error`). (optional) + /// Only include entries from this subsystem. (optional) + /// Only include entries whose message matches this substring/pattern. (optional) + /// Exclude entries whose message matches this substring/pattern. (optional) + /// Cancellation Token to cancel the request. + /// Task of string + System.Threading.Tasks.Task DevicesStreamOsTraceAsync(string udid, int? pid = default, string? level = default, string? subsystem = default, string? match = default, string? exclude = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Stream os_log trace (SSE) + /// + /// + /// Stream structured os_log trace entries as Server-Sent Events. All filters are optional and combine with AND semantics. + /// + /// Thrown when fails to make API call + /// + /// Only include entries from this process id. (optional) + /// Minimum log level to include (e.g. `info`, `debug`, `error`). (optional) + /// Only include entries from this subsystem. (optional) + /// Only include entries whose message matches this substring/pattern. (optional) + /// Exclude entries whose message matches this substring/pattern. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (string) + System.Threading.Tasks.Task> DevicesStreamOsTraceWithHttpInfoAsync(string udid, int? pid = default, string? level = default, string? subsystem = default, string? match = default, string? exclude = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Stream syslog (SSE) + /// + /// + /// Stream device syslog lines as Server-Sent Events. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of string + System.Threading.Tasks.Task DevicesStreamSyslogAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Stream syslog (SSE) + /// + /// + /// Stream device syslog lines as Server-Sent Events. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (string) + System.Threading.Tasks.Task> DevicesStreamSyslogWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Stream CPU usage (SSE) + /// + /// + /// Stream CPU-usage samples as Server-Sent Events (CLI: `ios sysmontap`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of string + System.Threading.Tasks.Task DevicesStreamSysmontapAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Stream CPU usage (SSE) + /// + /// + /// Stream CPU-usage samples as Server-Sent Events (CLI: `ios sysmontap`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (string) + System.Threading.Tasks.Task> DevicesStreamSysmontapWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Uninstall app + /// + /// + /// Uninstall an application by bundle id. + /// + /// Thrown when fails to make API call + /// + /// Bundle id of the app to uninstall. + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + System.Threading.Tasks.Task DevicesUninstallAppAsync(string udid, string bundleID, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Uninstall app + /// + /// + /// Uninstall an application by bundle id. + /// + /// Thrown when fails to make API call + /// + /// Bundle id of the app to uninstall. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + System.Threading.Tasks.Task> DevicesUninstallAppWithHttpInfoAsync(string udid, string bundleID, System.Threading.CancellationToken cancellationToken = default); + /// + /// Unmount developer image + /// + /// + /// Unmount the developer disk image (CLI: `ios image unmount`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + System.Threading.Tasks.Task DevicesUnmountImageAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Unmount developer image + /// + /// + /// Unmount the developer disk image (CLI: `ios image unmount`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + System.Threading.Tasks.Task> DevicesUnmountImageWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Get battery IORegistry + /// + /// + /// Get the battery IORegistry stats (Temperature, Voltage, CurrentCapacity, ...) via the diagnostics relay (CLI: `ios diagnostics ioregistry`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of BatteryRegistry + System.Threading.Tasks.Task DiagnosticsNetGetBatteryRegistryAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get battery IORegistry + /// + /// + /// Get the battery IORegistry stats (Temperature, Voltage, CurrentCapacity, ...) via the diagnostics relay (CLI: `ios diagnostics ioregistry`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (BatteryRegistry) + System.Threading.Tasks.Task> DiagnosticsNetGetBatteryRegistryWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Get device IP / network info + /// + /// + /// Resolve the device's network addresses (MAC/IPv4/IPv6) by sniffing pcapd (CLI: `ios ip`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of NetworkInfo + System.Threading.Tasks.Task DiagnosticsNetGetDeviceIpAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get device IP / network info + /// + /// + /// Resolve the device's network addresses (MAC/IPv4/IPv6) by sniffing pcapd (CLI: `ios ip`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (NetworkInfo) + System.Threading.Tasks.Task> DiagnosticsNetGetDeviceIpWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Get disk space info + /// + /// + /// Get filesystem info for the device (total/free/used bytes, block size) via AFC (CLI: `ios diskspace`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of DiskSpaceInfo + System.Threading.Tasks.Task DiagnosticsNetGetDiskSpaceAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get disk space info + /// + /// + /// Get filesystem info for the device (total/free/used bytes, block size) via AFC (CLI: `ios diskspace`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (DiskSpaceInfo) + System.Threading.Tasks.Task> DiagnosticsNetGetDiskSpaceWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Get RSD service list + /// + /// + /// Get the device's RSD (Remote Service Discovery) service list (CLI: `ios rsd ls`). Requires a running tunnel (iOS 17+); devices without RSD return `400`. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task DiagnosticsNetGetRsdServicesAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get RSD service list + /// + /// + /// Get the device's RSD (Remote Service Discovery) service list (CLI: `ios rsd ls`). Requires a running tunnel (iOS 17+); devices without RSD return `400`. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> DiagnosticsNetGetRsdServicesWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// List a directory over AFC + /// + /// + /// List a device directory over AFC (CLI: `ios fsync ls`). + /// + /// Thrown when fails to make API call + /// + /// App bundle id to scope to its container (else the media dir). (optional) + /// Device-side path (rejects `..` elements). (optional) + /// Cancellation Token to cancel the request. + /// Task of FsyncListing + System.Threading.Tasks.Task FsyncFsyncLsAsync(string udid, string? bundleID = default, string? path = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// List a directory over AFC + /// + /// + /// List a device directory over AFC (CLI: `ios fsync ls`). + /// + /// Thrown when fails to make API call + /// + /// App bundle id to scope to its container (else the media dir). (optional) + /// Device-side path (rejects `..` elements). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FsyncListing) + System.Threading.Tasks.Task> FsyncFsyncLsWithHttpInfoAsync(string udid, string? bundleID = default, string? path = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a directory over AFC + /// + /// + /// Create a directory over AFC (CLI: `ios fsync mkdir`). + /// + /// Thrown when fails to make API call + /// + /// Directory path to create (required). + /// App bundle id to scope to its container (else the media dir). (optional) + /// Cancellation Token to cancel the request. + /// Task of FsyncMessage + System.Threading.Tasks.Task FsyncFsyncMkdirAsync(string udid, string path, string? bundleID = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Create a directory over AFC + /// + /// + /// Create a directory over AFC (CLI: `ios fsync mkdir`). + /// + /// Thrown when fails to make API call + /// + /// Directory path to create (required). + /// App bundle id to scope to its container (else the media dir). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FsyncMessage) + System.Threading.Tasks.Task> FsyncFsyncMkdirWithHttpInfoAsync(string udid, string path, string? bundleID = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Download a file over AFC + /// + /// + /// Download a file from the device over AFC (CLI: `ios fsync pull`). Returns the raw file bytes. `path` is required. + /// + /// Thrown when fails to make API call + /// + /// Remote file path on the device (required). + /// App bundle id to scope to its container (else the media dir). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task FsyncFsyncPullAsync(string udid, string path, string? bundleID = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Download a file over AFC + /// + /// + /// Download a file from the device over AFC (CLI: `ios fsync pull`). Returns the raw file bytes. `path` is required. + /// + /// Thrown when fails to make API call + /// + /// Remote file path on the device (required). + /// App bundle id to scope to its container (else the media dir). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> FsyncFsyncPullWithHttpInfoAsync(string udid, string path, string? bundleID = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Upload a file over AFC + /// + /// + /// Upload a file to the device over AFC (CLI: `ios fsync push`). Accepts either raw bytes (application/octet-stream) or a multipart form with a `file` field. `path` is required. Bounded server-side; oversized uploads get `413`. + /// + /// Thrown when fails to make API call + /// + /// Destination path on the device (required). + /// Raw file bytes to upload (application/octet-stream). + /// App bundle id to scope to its container (else the media dir). (optional) + /// Cancellation Token to cancel the request. + /// Task of FsyncPushResult + System.Threading.Tasks.Task FsyncFsyncPushAsync(string udid, string path, Object body, string? bundleID = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Upload a file over AFC + /// + /// + /// Upload a file to the device over AFC (CLI: `ios fsync push`). Accepts either raw bytes (application/octet-stream) or a multipart form with a `file` field. `path` is required. Bounded server-side; oversized uploads get `413`. + /// + /// Thrown when fails to make API call + /// + /// Destination path on the device (required). + /// Raw file bytes to upload (application/octet-stream). + /// App bundle id to scope to its container (else the media dir). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FsyncPushResult) + System.Threading.Tasks.Task> FsyncFsyncPushWithHttpInfoAsync(string udid, string path, Object body, string? bundleID = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Remove a file or directory over AFC + /// + /// + /// Remove a file or directory over AFC (CLI: `ios fsync rm`). Pass `recursive=true` to delete a non-empty directory. + /// + /// Thrown when fails to make API call + /// + /// Path to remove (required). + /// App bundle id to scope to its container (else the media dir). (optional) + /// Remove directory contents recursively. (optional) + /// Cancellation Token to cancel the request. + /// Task of FsyncMessage + System.Threading.Tasks.Task FsyncFsyncRmAsync(string udid, string path, string? bundleID = default, bool? recursive = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Remove a file or directory over AFC + /// + /// + /// Remove a file or directory over AFC (CLI: `ios fsync rm`). Pass `recursive=true` to delete a non-empty directory. + /// + /// Thrown when fails to make API call + /// + /// Path to remove (required). + /// App bundle id to scope to its container (else the media dir). (optional) + /// Remove directory contents recursively. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FsyncMessage) + System.Threading.Tasks.Task> FsyncFsyncRmWithHttpInfoAsync(string udid, string path, string? bundleID = default, bool? recursive = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Recursively list a directory over AFC + /// + /// + /// Recursively list a device directory over AFC (CLI: `ios fsync tree`). + /// + /// Thrown when fails to make API call + /// + /// App bundle id to scope to its container (else the media dir). (optional) + /// Device-side path (rejects `..` elements). (optional) + /// Cancellation Token to cancel the request. + /// Task of FsyncTreeListing + System.Threading.Tasks.Task FsyncFsyncTreeAsync(string udid, string? bundleID = default, string? path = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Recursively list a directory over AFC + /// + /// + /// Recursively list a device directory over AFC (CLI: `ios fsync tree`). + /// + /// Thrown when fails to make API call + /// + /// App bundle id to scope to its container (else the media dir). (optional) + /// Device-side path (rejects `..` elements). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FsyncTreeListing) + System.Threading.Tasks.Task> FsyncFsyncTreeWithHttpInfoAsync(string udid, string? bundleID = default, string? path = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Get device cloud configuration + /// + /// + /// Get the device cloud configuration (supervision status, skip-setup options, organization info). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task FsyncGetCloudConfigAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get device cloud configuration + /// + /// + /// Get the device cloud configuration (supervision status, skip-setup options, organization info). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> FsyncGetCloudConfigWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// List setup skip options + /// + /// + /// List all setup-pane skip options usable when preparing a device (CLI: `ios prepare printskip`). Static, device-free list. + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of PrepareSkipOptions + System.Threading.Tasks.Task GetPrepareSkipOptionsAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// List setup skip options + /// + /// + /// List all setup-pane skip options usable when preparing a device (CLI: `ios prepare printskip`). Static, device-free list. + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (PrepareSkipOptions) + System.Threading.Tasks.Task> GetPrepareSkipOptionsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default); + /// + /// List devices + /// + /// + /// List all attached / reachable devices. + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of DeviceList + System.Threading.Tasks.Task ListDevicesAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// List devices + /// + /// + /// List all attached / reachable devices. + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (DeviceList) + System.Threading.Tasks.Task> ListDevicesWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default); + /// + /// List tunnels + /// + /// + /// List running device tunnels (CLI: `ios tunnel ls`). + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of List<Tunnel> + System.Threading.Tasks.Task> ListTunnelsAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// List tunnels + /// + /// + /// List running device tunnels (CLI: `ios tunnel ls`). + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Tunnel>) + System.Threading.Tasks.Task>> ListTunnelsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate a supervision certificate + /// + /// + /// Generate a self-signed supervision identity (CLI: `ios prepare create-cert`) and return the DER (base64) and PEM for both the certificate and private key. Host-scoped (device-free). + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of SupervisionCert + System.Threading.Tasks.Task PrepareCreateCertAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Generate a supervision certificate + /// + /// + /// Generate a self-signed supervision identity (CLI: `ios prepare create-cert`) and return the DER (base64) and PEM for both the certificate and private key. Host-scoped (device-free). + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SupervisionCert) + System.Threading.Tasks.Task> PrepareCreateCertWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default); + /// + /// Prepare (and optionally supervise) a device + /// + /// + /// Run the device preparation/provisioning flow (CLI: `ios prepare`). Send multipart/form-data. To supervise the device include a `cert` file (DER/PEM/P12 supervision identity) and optional `p12password`; without a cert the device is prepared without supervision. + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// P12 password (when `cert` is a P12). (optional) + /// Setup panes to skip (see /prepare/skip-options). Repeatable. (optional) + /// Supervision organization name. (optional) + /// Device locale (default en_US). (optional) + /// Device language (default en). (optional) + /// Cancellation Token to cancel the request. + /// Task of PrepareResult + System.Threading.Tasks.Task PreparePrepareDeviceAsync(string udid, Object? cert = default, string? p12password = default, List? skip = default, string? orgname = default, string? locale = default, string? lang = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Prepare (and optionally supervise) a device + /// + /// + /// Run the device preparation/provisioning flow (CLI: `ios prepare`). Send multipart/form-data. To supervise the device include a `cert` file (DER/PEM/P12 supervision identity) and optional `p12password`; without a cert the device is prepared without supervision. + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// P12 password (when `cert` is a P12). (optional) + /// Setup panes to skip (see /prepare/skip-options). Repeatable. (optional) + /// Supervision organization name. (optional) + /// Device locale (default en_US). (optional) + /// Device language (default en). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (PrepareResult) + System.Threading.Tasks.Task> PreparePrepareDeviceWithHttpInfoAsync(string udid, Object? cert = default, string? p12password = default, List? skip = default, string? orgname = default, string? locale = default, string? lang = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Refresh tunnel + /// + /// + /// Restart the tunnel for a device and wait for it to come up (CLI: `ios tunnel refresh`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of Tunnel + System.Threading.Tasks.Task RefreshTunnelAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Refresh tunnel + /// + /// + /// Restart the tunnel for a device and wait for it to come up (CLI: `ios tunnel refresh`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Tunnel) + System.Threading.Tasks.Task> RefreshTunnelWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Shut down tunnel agent + /// + /// + /// Shut down the tunnel agent (CLI: `ios tunnel stopagent`). + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of AgentShutdown + System.Threading.Tasks.Task ShutdownTunnelAgentAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Shut down tunnel agent + /// + /// + /// Shut down the tunnel agent (CLI: `ios tunnel stopagent`). + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (AgentShutdown) + System.Threading.Tasks.Task> ShutdownTunnelAgentWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default); + /// + /// Resign an app/IPA + /// + /// + /// Resign an uploaded app/IPA with an uploaded P12 identity and provisioning profile, returning the signed IPA. Synchronous. Host-scoped. + /// + /// Thrown when fails to make API call + /// + /// + /// + /// P12 password. (optional) + /// Override bundle id. (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task SignAppAsync(Object ipa, Object p12file, Object profile, string? p12password = default, string? bundleid = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Resign an app/IPA + /// + /// + /// Resign an uploaded app/IPA with an uploaded P12 identity and provisioning profile, returning the signed IPA. Synchronous. Host-scoped. + /// + /// Thrown when fails to make API call + /// + /// + /// + /// P12 password. (optional) + /// Override bundle id. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> SignAppWithHttpInfoAsync(Object ipa, Object p12file, Object profile, string? p12password = default, string? bundleid = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a signing certificate + /// + /// + /// Create one App Store Connect signing certificate and return its P12 (certificate + private key) as a downloadable `application/x-pkcs12` file. The P12 password is echoed in the `X-P12-Password` response header and the certificate resource id in `X-Certificate-Id`. Host-scoped (device-free). + /// + /// Thrown when fails to make API call + /// + /// App Store Connect key id. + /// App Store Connect issuer id. + /// Revoke existing iOS Development certificates first. (optional) + /// Password to protect the generated P12. (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task SignCertificateAsync(Object ascPrivateKey, string ascKeyId, string ascIssuerId, string? revokeExisting = default, string? p12password = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Create a signing certificate + /// + /// + /// Create one App Store Connect signing certificate and return its P12 (certificate + private key) as a downloadable `application/x-pkcs12` file. The P12 password is echoed in the `X-P12-Password` response header and the certificate resource id in `X-Certificate-Id`. Host-scoped (device-free). + /// + /// Thrown when fails to make API call + /// + /// App Store Connect key id. + /// App Store Connect issuer id. + /// Revoke existing iOS Development certificates first. (optional) + /// Password to protect the generated P12. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> SignCertificateWithHttpInfoAsync(Object ascPrivateKey, string ascKeyId, string ascIssuerId, string? revokeExisting = default, string? p12password = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a provisioning profile + P12 + /// + /// + /// Create a bundle id, development certificate and provisioning profile via App Store Connect and return both artifacts base64-encoded in a JSON envelope. The target device udid is supplied as a form field. Host-scoped. + /// + /// Thrown when fails to make API call + /// + /// App Store Connect key id. + /// App Store Connect issuer id. + /// App bundle identifier. + /// Target device udid to register against the profile. + /// Bundle display name. (optional) + /// Provisioning profile name. (optional) + /// Device display name. (optional) + /// Reuse an existing certificate (no new P12 is generated). (optional) + /// Revoke existing certificates first. (optional) + /// Password to protect the generated P12. (optional) + /// Cancellation Token to cancel the request. + /// Task of ProvisioningResult + System.Threading.Tasks.Task SignProvisionAsync(Object ascPrivateKey, string ascKeyId, string ascIssuerId, string bundleid, string udid, string? bundlename = default, string? profilename = default, string? devicename = default, string? certificateId = default, string? revokeExisting = default, string? p12password = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Create a provisioning profile + P12 + /// + /// + /// Create a bundle id, development certificate and provisioning profile via App Store Connect and return both artifacts base64-encoded in a JSON envelope. The target device udid is supplied as a form field. Host-scoped. + /// + /// Thrown when fails to make API call + /// + /// App Store Connect key id. + /// App Store Connect issuer id. + /// App bundle identifier. + /// Target device udid to register against the profile. + /// Bundle display name. (optional) + /// Provisioning profile name. (optional) + /// Device display name. (optional) + /// Reuse an existing certificate (no new P12 is generated). (optional) + /// Revoke existing certificates first. (optional) + /// Password to protect the generated P12. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ProvisioningResult) + System.Threading.Tasks.Task> SignProvisionWithHttpInfoAsync(Object ascPrivateKey, string ascKeyId, string ascIssuerId, string bundleid, string udid, string? bundlename = default, string? profilename = default, string? devicename = default, string? certificateId = default, string? revokeExisting = default, string? p12password = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Stop tunnel + /// + /// + /// Stop the tunnel for a device (CLI: `ios tunnel stop - -udid`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of TunnelStopped + System.Threading.Tasks.Task StopTunnelAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Stop tunnel + /// + /// + /// Stop the tunnel for a device (CLI: `ios tunnel stop - -udid`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (TunnelStopped) + System.Threading.Tasks.Task> StopTunnelWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + /// + /// Stream a live pcap capture (binary) + /// + /// + /// Stream a live packet capture from the device as a libpcap byte stream (pipeable into wireshark/tshark). Runs until `timeout` (seconds) elapses, the default timeout is reached, or the client disconnects. + /// + /// Thrown when fails to make API call + /// + /// Capture duration in seconds (default 60, max 3600). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task StreamsPcapAsync(string udid, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Stream a live pcap capture (binary) + /// + /// + /// Stream a live packet capture from the device as a libpcap byte stream (pipeable into wireshark/tshark). Runs until `timeout` (seconds) elapses, the default timeout is reached, or the client disconnects. + /// + /// Thrown when fails to make API call + /// + /// Capture duration in seconds (default 60, max 3600). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> StreamsPcapWithHttpInfoAsync(string udid, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Stream screenshots as MJPEG (binary) + /// + /// + /// Serve an MJPEG (multipart/x-mixed-replace) stream of device screenshots captured via the instruments screenshot service. Streams until the client disconnects or the source fails. + /// + /// Thrown when fails to make API call + /// + /// Optional JPEG quality (1–100, default 80). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task StreamsScreenshotStreamAsync(string udid, int? quality = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Stream screenshots as MJPEG (binary) + /// + /// + /// Serve an MJPEG (multipart/x-mixed-replace) stream of device screenshots captured via the instruments screenshot service. Streams until the client disconnects or the source fails. + /// + /// Thrown when fails to make API call + /// + /// Optional JPEG quality (1–100, default 80). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> StreamsScreenshotStreamWithHttpInfoAsync(string udid, int? quality = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Stream UI video (binary) + /// + /// + /// Open a live UI video stream against a forwarded WDA/DeviceKit backend and pipe it straight through to the client. Default codec is MJPEG (multipart/x-mixed-replace); `codec=h264` returns an H.264 elementary stream (requires the devicekit backend). Streams until the client disconnects or the backend ends. Requires a running, forwarded WDA/DeviceKit backend (see the UI routes). + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Video codec: `mjpeg` (default) or `h264` (devicekit backend only). (optional) + /// Target frames per second (backend-dependent). (optional) + /// JPEG quality for the mjpeg codec. (optional) + /// Scale factor (backend-dependent). (optional) + /// Target bitrate for the h264 codec. (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task StreamsUiStreamAsync(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default, string? codec = default, string? fps = default, string? quality = default, string? scale = default, string? bitrate = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Stream UI video (binary) + /// + /// + /// Open a live UI video stream against a forwarded WDA/DeviceKit backend and pipe it straight through to the client. Default codec is MJPEG (multipart/x-mixed-replace); `codec=h264` returns an H.264 elementary stream (requires the devicekit backend). Streams until the client disconnects or the backend ends. Requires a running, forwarded WDA/DeviceKit backend (see the UI routes). + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Video codec: `mjpeg` (default) or `h264` (devicekit backend only). (optional) + /// Target frames per second (backend-dependent). (optional) + /// JPEG quality for the mjpeg codec. (optional) + /// Scale factor (backend-dependent). (optional) + /// Target bitrate for the h264 codec. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> StreamsUiStreamWithHttpInfoAsync(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default, string? codec = default, string? fps = default, string? quality = default, string? scale = default, string? bitrate = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Raw backend passthrough + /// + /// + /// Raw passthrough to the backend. For WDA supply `method`/`path`/`body`; for DeviceKit supply `rpcMethod`/`rpcParams`. The backend response is forwarded verbatim. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task UIUiApiAsync(string udid, UIAPIRequest uIAPIRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Raw backend passthrough + /// + /// + /// Raw passthrough to the backend. For WDA supply `method`/`path`/`body`; for DeviceKit supply `rpcMethod`/`rpcParams`. The backend response is forwarded verbatim. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> UIUiApiWithHttpInfoAsync(string udid, UIAPIRequest uIAPIRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Foreground app (UI backend) + /// + /// + /// Bring the backgrounded app to the foreground. Only the devicekit backend supports this; WDA returns `501`. The request body is ignored. + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task UIUiAppForegroundAsync(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Foreground app (UI backend) + /// + /// + /// Bring the backgrounded app to the foreground. Only the devicekit backend supports this; WDA returns `501`. The request body is ignored. + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> UIUiAppForegroundWithHttpInfoAsync(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Launch app (UI backend) + /// + /// + /// Launch the app identified by `bundleId`. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task UIUiAppLaunchAsync(string udid, UIAppRequest uIAppRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Launch app (UI backend) + /// + /// + /// Launch the app identified by `bundleId`. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> UIUiAppLaunchWithHttpInfoAsync(string udid, UIAppRequest uIAppRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Terminate app (UI backend) + /// + /// + /// Terminate the app identified by `bundleId`. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task UIUiAppTerminateAsync(string udid, UIAppRequest uIAppRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Terminate app (UI backend) + /// + /// + /// Terminate the app identified by `bundleId`. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> UIUiAppTerminateWithHttpInfoAsync(string udid, UIAppRequest uIAppRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Press hardware button + /// + /// + /// Press a hardware button by name (WDA supports only `home`). + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task UIUiButtonAsync(string udid, UIButtonRequest uIButtonRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Press hardware button + /// + /// + /// Press a hardware button by name (WDA supports only `home`). + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> UIUiButtonWithHttpInfoAsync(string udid, UIButtonRequest uIButtonRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Get orientation + /// + /// + /// Get the current device orientation payload. + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task UIUiGetOrientationAsync(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get orientation + /// + /// + /// Get the current device orientation payload. + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> UIUiGetOrientationWithHttpInfoAsync(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Long press + /// + /// + /// Press and hold at (x,y). + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task UIUiLongPressAsync(string udid, UILongPressRequest uILongPressRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Long press + /// + /// + /// Press and hold at (x,y). + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> UIUiLongPressWithHttpInfoAsync(string udid, UILongPressRequest uILongPressRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// UI screenshot (PNG) + /// + /// + /// Capture the screen and return raw PNG bytes. + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task UIUiScreenshotAsync(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// UI screenshot (PNG) + /// + /// + /// Capture the screen and return raw PNG bytes. + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> UIUiScreenshotWithHttpInfoAsync(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Set orientation + /// + /// + /// Set the device orientation. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task UIUiSetOrientationAsync(string udid, UIOrientationRequest uIOrientationRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Set orientation + /// + /// + /// Set the device orientation. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> UIUiSetOrientationWithHttpInfoAsync(string udid, UIOrientationRequest uIOrientationRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// UI source hierarchy + /// + /// + /// Return the current view hierarchy (XML for WDA; backend Content-Type preserved). + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task UIUiSourceAsync(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// UI source hierarchy + /// + /// + /// Return the current view hierarchy (XML for WDA; backend Content-Type preserved). + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> UIUiSourceWithHttpInfoAsync(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// UI backend status + /// + /// + /// Return the backend status/health payload (WDA /status or DeviceKit /health). + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task UIUiStatusAsync(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// UI backend status + /// + /// + /// Return the backend status/health payload (WDA /status or DeviceKit /health). + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> UIUiStatusWithHttpInfoAsync(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Swipe + /// + /// + /// Drag from (x1,y1) to (x2,y2). + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task UIUiSwipeAsync(string udid, UISwipeRequest uISwipeRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Swipe + /// + /// + /// Drag from (x1,y1) to (x2,y2). + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> UIUiSwipeWithHttpInfoAsync(string udid, UISwipeRequest uISwipeRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Tap + /// + /// + /// Tap at absolute coordinates. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task UIUiTapAsync(string udid, UITapRequest uITapRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Tap + /// + /// + /// Tap at absolute coordinates. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> UIUiTapWithHttpInfoAsync(string udid, UITapRequest uITapRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Type text + /// + /// + /// Send text as keyboard input. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task UIUiTypeAsync(string udid, UITypeRequest uITypeRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Type text + /// + /// + /// Send text as keyboard input. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> UIUiTypeWithHttpInfoAsync(string udid, UITypeRequest uITypeRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// UI window size + /// + /// + /// Return the device window/screen size payload (typically {width,height}). + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task UIUiWindowSizeAsync(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// UI window size + /// + /// + /// Return the device window/screen size payload (typically {width,height}). + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> UIUiWindowSizeWithHttpInfoAsync(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// Evaluate JavaScript in a page + /// + /// + /// Evaluate JavaScript in an inspectable page and return the result (CLI: `ios webinspector eval`). `404` when no matching page exists. + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of WebInspectorEvalResult + System.Threading.Tasks.Task WebInspectorWebInspectorEvalAsync(string udid, WebInspectorEvalRequest webInspectorEvalRequest, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Evaluate JavaScript in a page + /// + /// + /// Evaluate JavaScript in an inspectable page and return the result (CLI: `ios webinspector eval`). `404` when no matching page exists. + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (WebInspectorEvalResult) + System.Threading.Tasks.Task> WebInspectorWebInspectorEvalWithHttpInfoAsync(string udid, WebInspectorEvalRequest webInspectorEvalRequest, System.Threading.CancellationToken cancellationToken = default); + /// + /// Open a URL in a new inspectable page + /// + /// + /// Open a URL in a new inspectable page via a remote automation session (CLI: `ios webinspector launch <url>`). `url` may be a query param or in the body; `bundleId` defaults to Safari. + /// + /// Thrown when fails to make API call + /// + /// URL to open (alternative to the request body). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of WebInspectorLaunchResult + System.Threading.Tasks.Task WebInspectorWebInspectorLaunchAsync(string udid, string? url = default, WebInspectorLaunchRequest? webInspectorLaunchRequest = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Open a URL in a new inspectable page + /// + /// + /// Open a URL in a new inspectable page via a remote automation session (CLI: `ios webinspector launch <url>`). `url` may be a query param or in the body; `bundleId` defaults to Safari. + /// + /// Thrown when fails to make API call + /// + /// URL to open (alternative to the request body). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (WebInspectorLaunchResult) + System.Threading.Tasks.Task> WebInspectorWebInspectorLaunchWithHttpInfoAsync(string udid, string? url = default, WebInspectorLaunchRequest? webInspectorLaunchRequest = default, System.Threading.CancellationToken cancellationToken = default); + /// + /// List inspectable pages + /// + /// + /// List inspectable pages reported by the device (CLI: `ios webinspector list`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of List<Object> + System.Threading.Tasks.Task> WebInspectorWebInspectorPagesAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + + /// + /// List inspectable pages + /// + /// + /// List inspectable pages reported by the device (CLI: `ios webinspector list`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Object>) + System.Threading.Tasks.Task>> WebInspectorWebInspectorPagesWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IDefaultApi : IDefaultApiSync, IDefaultApiAsync + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class DefaultApi : IDisposable, IDefaultApi + { + private GoIos.Sdk.Generated.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// + public DefaultApi() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// The target service's base path in URL format. + /// + /// + public DefaultApi(string basePath) + { + this.Configuration = GoIos.Sdk.Generated.Client.Configuration.MergeConfigurations( + GoIos.Sdk.Generated.Client.GlobalConfiguration.Instance, + new GoIos.Sdk.Generated.Client.Configuration { BasePath = basePath } + ); + this.ApiClient = new GoIos.Sdk.Generated.Client.ApiClient(this.Configuration.BasePath); + this.Client = this.ApiClient; + this.AsynchronousClient = this.ApiClient; + this.ExceptionFactory = GoIos.Sdk.Generated.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class using Configuration object. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// An instance of Configuration. + /// + /// + public DefaultApi(GoIos.Sdk.Generated.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = GoIos.Sdk.Generated.Client.Configuration.MergeConfigurations( + GoIos.Sdk.Generated.Client.GlobalConfiguration.Instance, + configuration + ); + this.ApiClient = new GoIos.Sdk.Generated.Client.ApiClient(this.Configuration.BasePath); + this.Client = this.ApiClient; + this.AsynchronousClient = this.ApiClient; + ExceptionFactory = GoIos.Sdk.Generated.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class. + /// + /// An instance of HttpClient. + /// An optional instance of HttpClientHandler that is used by HttpClient. + /// + /// + /// + /// Some configuration settings will not be applied without passing an HttpClientHandler. + /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. + /// + public DefaultApi(HttpClient client, HttpClientHandler handler = null) : this(client, (string)null, handler) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// An instance of HttpClient. + /// The target service's base path in URL format. + /// An optional instance of HttpClientHandler that is used by HttpClient. + /// + /// + /// + /// + /// Some configuration settings will not be applied without passing an HttpClientHandler. + /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. + /// + public DefaultApi(HttpClient client, string basePath, HttpClientHandler handler = null) + { + if (client == null) throw new ArgumentNullException("client"); + + this.Configuration = GoIos.Sdk.Generated.Client.Configuration.MergeConfigurations( + GoIos.Sdk.Generated.Client.GlobalConfiguration.Instance, + new GoIos.Sdk.Generated.Client.Configuration { BasePath = basePath } + ); + this.ApiClient = new GoIos.Sdk.Generated.Client.ApiClient(client, this.Configuration.BasePath, handler); + this.Client = this.ApiClient; + this.AsynchronousClient = this.ApiClient; + this.ExceptionFactory = GoIos.Sdk.Generated.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class using Configuration object. + /// + /// An instance of HttpClient. + /// An instance of Configuration. + /// An optional instance of HttpClientHandler that is used by HttpClient. + /// + /// + /// + /// Some configuration settings will not be applied without passing an HttpClientHandler. + /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. + /// + public DefaultApi(HttpClient client, GoIos.Sdk.Generated.Client.Configuration configuration, HttpClientHandler handler = null) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + if (client == null) throw new ArgumentNullException("client"); + + this.Configuration = GoIos.Sdk.Generated.Client.Configuration.MergeConfigurations( + GoIos.Sdk.Generated.Client.GlobalConfiguration.Instance, + configuration + ); + this.ApiClient = new GoIos.Sdk.Generated.Client.ApiClient(client, this.Configuration.BasePath, handler); + this.Client = this.ApiClient; + this.AsynchronousClient = this.ApiClient; + ExceptionFactory = GoIos.Sdk.Generated.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access. + /// The client interface for asynchronous API access. + /// The configuration object. + /// + public DefaultApi(GoIos.Sdk.Generated.Client.ISynchronousClient client, GoIos.Sdk.Generated.Client.IAsynchronousClient asyncClient, GoIos.Sdk.Generated.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Client = client; + this.AsynchronousClient = asyncClient; + this.Configuration = configuration; + this.ExceptionFactory = GoIos.Sdk.Generated.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Disposes resources if they were created by us + /// + public void Dispose() + { + this.ApiClient?.Dispose(); + } + + /// + /// Holds the ApiClient if created + /// + public GoIos.Sdk.Generated.Client.ApiClient ApiClient { get; set; } = null; + + /// + /// The client for accessing this underlying API asynchronously. + /// + public GoIos.Sdk.Generated.Client.IAsynchronousClient AsynchronousClient { get; set; } + + /// + /// The client for accessing this underlying API synchronously. + /// + public GoIos.Sdk.Generated.Client.ISynchronousClient Client { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public GoIos.Sdk.Generated.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public GoIos.Sdk.Generated.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Get accessibility element snapshot Get a snapshot of the currently focused accessibility element (CLI: `ios ax`). + /// + /// Thrown when fails to make API call + /// + /// Object + public Object AccessibilityGetAxSnapshot(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = AccessibilityGetAxSnapshotWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Get accessibility element snapshot Get a snapshot of the currently focused accessibility element (CLI: `ios ax`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse AccessibilityGetAxSnapshotWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->AccessibilityGetAxSnapshot"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/ax", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("AccessibilityGetAxSnapshot", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get accessibility element snapshot Get a snapshot of the currently focused accessibility element (CLI: `ios ax`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task AccessibilityGetAxSnapshotAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await AccessibilityGetAxSnapshotWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get accessibility element snapshot Get a snapshot of the currently focused accessibility element (CLI: `ios ax`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> AccessibilityGetAxSnapshotWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->AccessibilityGetAxSnapshot"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/ax", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("AccessibilityGetAxSnapshot", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get VoiceOver state Get VoiceOver enabled state (CLI: `ios voiceover get`). + /// + /// Thrown when fails to make API call + /// + /// VoiceOverState + public VoiceOverState AccessibilityGetVoiceOver(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = AccessibilityGetVoiceOverWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Get VoiceOver state Get VoiceOver enabled state (CLI: `ios voiceover get`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of VoiceOverState + public GoIos.Sdk.Generated.Client.ApiResponse AccessibilityGetVoiceOverWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->AccessibilityGetVoiceOver"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/voiceover", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("AccessibilityGetVoiceOver", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get VoiceOver state Get VoiceOver enabled state (CLI: `ios voiceover get`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of VoiceOverState + public async System.Threading.Tasks.Task AccessibilityGetVoiceOverAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await AccessibilityGetVoiceOverWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get VoiceOver state Get VoiceOver enabled state (CLI: `ios voiceover get`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (VoiceOverState) + public async System.Threading.Tasks.Task> AccessibilityGetVoiceOverWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->AccessibilityGetVoiceOver"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/voiceover", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("AccessibilityGetVoiceOver", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get ZoomTouch state Get ZoomTouch enabled state (CLI: `ios zoomtouch get`). + /// + /// Thrown when fails to make API call + /// + /// ZoomTouchState + public ZoomTouchState AccessibilityGetZoomTouch(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = AccessibilityGetZoomTouchWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Get ZoomTouch state Get ZoomTouch enabled state (CLI: `ios zoomtouch get`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of ZoomTouchState + public GoIos.Sdk.Generated.Client.ApiResponse AccessibilityGetZoomTouchWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->AccessibilityGetZoomTouch"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/zoom", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("AccessibilityGetZoomTouch", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get ZoomTouch state Get ZoomTouch enabled state (CLI: `ios zoomtouch get`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ZoomTouchState + public async System.Threading.Tasks.Task AccessibilityGetZoomTouchAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await AccessibilityGetZoomTouchWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get ZoomTouch state Get ZoomTouch enabled state (CLI: `ios zoomtouch get`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ZoomTouchState) + public async System.Threading.Tasks.Task> AccessibilityGetZoomTouchWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->AccessibilityGetZoomTouch"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/zoom", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("AccessibilityGetZoomTouch", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Run accessibility audit Run the accessibility audit against the focused app and return the issues found (CLI: `ios ax audit`). Bounded by `timeout` (seconds, default 60). + /// + /// Thrown when fails to make API call + /// + /// Audit timeout in seconds (default 60). (optional) + /// List<Object> + public List AccessibilityRunAxAudit(string udid, int? timeout = default) + { + GoIos.Sdk.Generated.Client.ApiResponse> localVarResponse = AccessibilityRunAxAuditWithHttpInfo(udid, timeout); + return localVarResponse.Data; + } + + /// + /// Run accessibility audit Run the accessibility audit against the focused app and return the issues found (CLI: `ios ax audit`). Bounded by `timeout` (seconds, default 60). + /// + /// Thrown when fails to make API call + /// + /// Audit timeout in seconds (default 60). (optional) + /// ApiResponse of List<Object> + public GoIos.Sdk.Generated.Client.ApiResponse> AccessibilityRunAxAuditWithHttpInfo(string udid, int? timeout = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->AccessibilityRunAxAudit"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post>("/api/v1/device/{udid}/ax/audit", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("AccessibilityRunAxAudit", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Run accessibility audit Run the accessibility audit against the focused app and return the issues found (CLI: `ios ax audit`). Bounded by `timeout` (seconds, default 60). + /// + /// Thrown when fails to make API call + /// + /// Audit timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of List<Object> + public async System.Threading.Tasks.Task> AccessibilityRunAxAuditAsync(string udid, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse> localVarResponse = await AccessibilityRunAxAuditWithHttpInfoAsync(udid, timeout, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Run accessibility audit Run the accessibility audit against the focused app and return the issues found (CLI: `ios ax audit`). Bounded by `timeout` (seconds, default 60). + /// + /// Thrown when fails to make API call + /// + /// Audit timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Object>) + public async System.Threading.Tasks.Task>> AccessibilityRunAxAuditWithHttpInfoAsync(string udid, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->AccessibilityRunAxAudit"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync>("/api/v1/device/{udid}/ax/audit", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("AccessibilityRunAxAudit", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Simulate location from a GPX file Simulate live location tracking from an uploaded GPX file (CLI: `ios setlocationgpx`). Send multipart/form-data with a `gpx` file. + /// + /// Thrown when fails to make API call + /// + /// + /// GenericResponse + public GenericResponse AccessibilitySetLocationGpx(string udid, Object gpx) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = AccessibilitySetLocationGpxWithHttpInfo(udid, gpx); + return localVarResponse.Data; + } + + /// + /// Simulate location from a GPX file Simulate live location tracking from an uploaded GPX file (CLI: `ios setlocationgpx`). Send multipart/form-data with a `gpx` file. + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of GenericResponse + public GoIos.Sdk.Generated.Client.ApiResponse AccessibilitySetLocationGpxWithHttpInfo(string udid, Object gpx) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->AccessibilitySetLocationGpx"); + + // verify the required parameter 'gpx' is set + if (gpx == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'gpx' when calling DefaultApi->AccessibilitySetLocationGpx"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.FormParameters.Add("gpx", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(gpx)); // form parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/api/v1/device/{udid}/setlocation/gpx", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("AccessibilitySetLocationGpx", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Simulate location from a GPX file Simulate live location tracking from an uploaded GPX file (CLI: `ios setlocationgpx`). Send multipart/form-data with a `gpx` file. + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + public async System.Threading.Tasks.Task AccessibilitySetLocationGpxAsync(string udid, Object gpx, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await AccessibilitySetLocationGpxWithHttpInfoAsync(udid, gpx, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Simulate location from a GPX file Simulate live location tracking from an uploaded GPX file (CLI: `ios setlocationgpx`). Send multipart/form-data with a `gpx` file. + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + public async System.Threading.Tasks.Task> AccessibilitySetLocationGpxWithHttpInfoAsync(string udid, Object gpx, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->AccessibilitySetLocationGpx"); + + // verify the required parameter 'gpx' is set + if (gpx == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'gpx' when calling DefaultApi->AccessibilitySetLocationGpx"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.FormParameters.Add("gpx", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(gpx)); // form parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PutAsync("/api/v1/device/{udid}/setlocation/gpx", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("AccessibilitySetLocationGpx", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Set VoiceOver state Enable/disable VoiceOver (CLI: `ios voiceover enable|disable`). The desired state comes from the JSON body or the `enabled` query param. + /// + /// Thrown when fails to make API call + /// + /// Desired state (alternative to the request body). (optional) + /// (optional) + /// VoiceOverState + public VoiceOverState AccessibilitySetVoiceOver(string udid, bool? enabled = default, AXEnabledRequest? aXEnabledRequest = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = AccessibilitySetVoiceOverWithHttpInfo(udid, enabled, aXEnabledRequest); + return localVarResponse.Data; + } + + /// + /// Set VoiceOver state Enable/disable VoiceOver (CLI: `ios voiceover enable|disable`). The desired state comes from the JSON body or the `enabled` query param. + /// + /// Thrown when fails to make API call + /// + /// Desired state (alternative to the request body). (optional) + /// (optional) + /// ApiResponse of VoiceOverState + public GoIos.Sdk.Generated.Client.ApiResponse AccessibilitySetVoiceOverWithHttpInfo(string udid, bool? enabled = default, AXEnabledRequest? aXEnabledRequest = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->AccessibilitySetVoiceOver"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (enabled != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "enabled", enabled)); + } + localVarRequestOptions.Data = aXEnabledRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/api/v1/device/{udid}/voiceover", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("AccessibilitySetVoiceOver", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Set VoiceOver state Enable/disable VoiceOver (CLI: `ios voiceover enable|disable`). The desired state comes from the JSON body or the `enabled` query param. + /// + /// Thrown when fails to make API call + /// + /// Desired state (alternative to the request body). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of VoiceOverState + public async System.Threading.Tasks.Task AccessibilitySetVoiceOverAsync(string udid, bool? enabled = default, AXEnabledRequest? aXEnabledRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await AccessibilitySetVoiceOverWithHttpInfoAsync(udid, enabled, aXEnabledRequest, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Set VoiceOver state Enable/disable VoiceOver (CLI: `ios voiceover enable|disable`). The desired state comes from the JSON body or the `enabled` query param. + /// + /// Thrown when fails to make API call + /// + /// Desired state (alternative to the request body). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (VoiceOverState) + public async System.Threading.Tasks.Task> AccessibilitySetVoiceOverWithHttpInfoAsync(string udid, bool? enabled = default, AXEnabledRequest? aXEnabledRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->AccessibilitySetVoiceOver"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (enabled != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "enabled", enabled)); + } + localVarRequestOptions.Data = aXEnabledRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PutAsync("/api/v1/device/{udid}/voiceover", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("AccessibilitySetVoiceOver", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Set ZoomTouch state Enable/disable ZoomTouch (CLI: `ios zoomtouch enable|disable`). The desired state comes from the JSON body or the `enabled` query param. + /// + /// Thrown when fails to make API call + /// + /// Desired state (alternative to the request body). (optional) + /// (optional) + /// ZoomTouchState + public ZoomTouchState AccessibilitySetZoomTouch(string udid, bool? enabled = default, AXEnabledRequest? aXEnabledRequest = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = AccessibilitySetZoomTouchWithHttpInfo(udid, enabled, aXEnabledRequest); + return localVarResponse.Data; + } + + /// + /// Set ZoomTouch state Enable/disable ZoomTouch (CLI: `ios zoomtouch enable|disable`). The desired state comes from the JSON body or the `enabled` query param. + /// + /// Thrown when fails to make API call + /// + /// Desired state (alternative to the request body). (optional) + /// (optional) + /// ApiResponse of ZoomTouchState + public GoIos.Sdk.Generated.Client.ApiResponse AccessibilitySetZoomTouchWithHttpInfo(string udid, bool? enabled = default, AXEnabledRequest? aXEnabledRequest = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->AccessibilitySetZoomTouch"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (enabled != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "enabled", enabled)); + } + localVarRequestOptions.Data = aXEnabledRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/api/v1/device/{udid}/zoom", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("AccessibilitySetZoomTouch", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Set ZoomTouch state Enable/disable ZoomTouch (CLI: `ios zoomtouch enable|disable`). The desired state comes from the JSON body or the `enabled` query param. + /// + /// Thrown when fails to make API call + /// + /// Desired state (alternative to the request body). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of ZoomTouchState + public async System.Threading.Tasks.Task AccessibilitySetZoomTouchAsync(string udid, bool? enabled = default, AXEnabledRequest? aXEnabledRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await AccessibilitySetZoomTouchWithHttpInfoAsync(udid, enabled, aXEnabledRequest, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Set ZoomTouch state Enable/disable ZoomTouch (CLI: `ios zoomtouch enable|disable`). The desired state comes from the JSON body or the `enabled` query param. + /// + /// Thrown when fails to make API call + /// + /// Desired state (alternative to the request body). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ZoomTouchState) + public async System.Threading.Tasks.Task> AccessibilitySetZoomTouchWithHttpInfoAsync(string udid, bool? enabled = default, AXEnabledRequest? aXEnabledRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->AccessibilitySetZoomTouch"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (enabled != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "enabled", enabled)); + } + localVarRequestOptions.Data = aXEnabledRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PutAsync("/api/v1/device/{udid}/zoom", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("AccessibilitySetZoomTouch", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Activate device Activate the device (complete Setup Assistant / activation). + /// + /// Thrown when fails to make API call + /// + /// GenericResponse + public GenericResponse DevicesActivate(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesActivateWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Activate device Activate the device (complete Setup Assistant / activation). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of GenericResponse + public GoIos.Sdk.Generated.Client.ApiResponse DevicesActivateWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesActivate"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/activate", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesActivate", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Activate device Activate the device (complete Setup Assistant / activation). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + public async System.Threading.Tasks.Task DevicesActivateAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesActivateWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Activate device Activate the device (complete Setup Assistant / activation). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + public async System.Threading.Tasks.Task> DevicesActivateWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesActivate"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/activate", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesActivate", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Install profile Install a configuration profile (CLI: `ios profile add`). Send the profile as the raw request body, or as multipart with a `profile` file plus an optional `p12` supervisor identity and `password` for a supervised install. + /// + /// Thrown when fails to make API call + /// + /// + /// (optional) + /// Passphrase for the `.p12` identity. (optional) + /// GenericResponse + public GenericResponse DevicesAddProfile(string udid, Object profile, Object? p12 = default, string? password = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesAddProfileWithHttpInfo(udid, profile, p12, password); + return localVarResponse.Data; + } + + /// + /// Install profile Install a configuration profile (CLI: `ios profile add`). Send the profile as the raw request body, or as multipart with a `profile` file plus an optional `p12` supervisor identity and `password` for a supervised install. + /// + /// Thrown when fails to make API call + /// + /// + /// (optional) + /// Passphrase for the `.p12` identity. (optional) + /// ApiResponse of GenericResponse + public GoIos.Sdk.Generated.Client.ApiResponse DevicesAddProfileWithHttpInfo(string udid, Object profile, Object? p12 = default, string? password = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesAddProfile"); + + // verify the required parameter 'profile' is set + if (profile == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'profile' when calling DefaultApi->DevicesAddProfile"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.FormParameters.Add("profile", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(profile)); // form parameter + if (p12 != null) + { + localVarRequestOptions.FormParameters.Add("p12", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(p12)); // form parameter + } + if (password != null) + { + localVarRequestOptions.FormParameters.Add("password", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(password)); // form parameter + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/profiles", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesAddProfile", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Install profile Install a configuration profile (CLI: `ios profile add`). Send the profile as the raw request body, or as multipart with a `profile` file plus an optional `p12` supervisor identity and `password` for a supervised install. + /// + /// Thrown when fails to make API call + /// + /// + /// (optional) + /// Passphrase for the `.p12` identity. (optional) + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + public async System.Threading.Tasks.Task DevicesAddProfileAsync(string udid, Object profile, Object? p12 = default, string? password = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesAddProfileWithHttpInfoAsync(udid, profile, p12, password, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Install profile Install a configuration profile (CLI: `ios profile add`). Send the profile as the raw request body, or as multipart with a `profile` file plus an optional `p12` supervisor identity and `password` for a supervised install. + /// + /// Thrown when fails to make API call + /// + /// + /// (optional) + /// Passphrase for the `.p12` identity. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + public async System.Threading.Tasks.Task> DevicesAddProfileWithHttpInfoAsync(string udid, Object profile, Object? p12 = default, string? password = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesAddProfile"); + + // verify the required parameter 'profile' is set + if (profile == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'profile' when calling DefaultApi->DevicesAddProfile"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.FormParameters.Add("profile", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(profile)); // form parameter + if (p12 != null) + { + localVarRequestOptions.FormParameters.Add("p12", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(p12)); // form parameter + } + if (password != null) + { + localVarRequestOptions.FormParameters.Add("password", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(password)); // form parameter + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/profiles", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesAddProfile", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Start WDA session Start a WebDriverAgent (XCUITest) session. + /// + /// Thrown when fails to make API call + /// + /// + /// WdaSession + public WdaSession DevicesCreateWdaSession(string udid, WdaConfig wdaConfig) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesCreateWdaSessionWithHttpInfo(udid, wdaConfig); + return localVarResponse.Data; + } + + /// + /// Start WDA session Start a WebDriverAgent (XCUITest) session. + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of WdaSession + public GoIos.Sdk.Generated.Client.ApiResponse DevicesCreateWdaSessionWithHttpInfo(string udid, WdaConfig wdaConfig) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesCreateWdaSession"); + + // verify the required parameter 'wdaConfig' is set + if (wdaConfig == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'wdaConfig' when calling DefaultApi->DevicesCreateWdaSession"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.Data = wdaConfig; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/wda/session", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesCreateWdaSession", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Start WDA session Start a WebDriverAgent (XCUITest) session. + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of WdaSession + public async System.Threading.Tasks.Task DevicesCreateWdaSessionAsync(string udid, WdaConfig wdaConfig, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesCreateWdaSessionWithHttpInfoAsync(udid, wdaConfig, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Start WDA session Start a WebDriverAgent (XCUITest) session. + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (WdaSession) + public async System.Threading.Tasks.Task> DevicesCreateWdaSessionWithHttpInfoAsync(string udid, WdaConfig wdaConfig, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesCreateWdaSession"); + + // verify the required parameter 'wdaConfig' is set + if (wdaConfig == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'wdaConfig' when calling DefaultApi->DevicesCreateWdaSession"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.Data = wdaConfig; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/wda/session", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesCreateWdaSession", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Stop WDA session Stop a running WebDriverAgent session. + /// + /// Thrown when fails to make API call + /// + /// The WDA session id. + /// WdaSession + public WdaSession DevicesDeleteWdaSession(string udid, string sessionId) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesDeleteWdaSessionWithHttpInfo(udid, sessionId); + return localVarResponse.Data; + } + + /// + /// Stop WDA session Stop a running WebDriverAgent session. + /// + /// Thrown when fails to make API call + /// + /// The WDA session id. + /// ApiResponse of WdaSession + public GoIos.Sdk.Generated.Client.ApiResponse DevicesDeleteWdaSessionWithHttpInfo(string udid, string sessionId) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesDeleteWdaSession"); + + // verify the required parameter 'sessionId' is set + if (sessionId == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'sessionId' when calling DefaultApi->DevicesDeleteWdaSession"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.PathParameters.Add("sessionId", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(sessionId)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Delete("/api/v1/device/{udid}/wda/session/{sessionId}", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesDeleteWdaSession", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Stop WDA session Stop a running WebDriverAgent session. + /// + /// Thrown when fails to make API call + /// + /// The WDA session id. + /// Cancellation Token to cancel the request. + /// Task of WdaSession + public async System.Threading.Tasks.Task DevicesDeleteWdaSessionAsync(string udid, string sessionId, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesDeleteWdaSessionWithHttpInfoAsync(udid, sessionId, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Stop WDA session Stop a running WebDriverAgent session. + /// + /// Thrown when fails to make API call + /// + /// The WDA session id. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (WdaSession) + public async System.Threading.Tasks.Task> DevicesDeleteWdaSessionWithHttpInfoAsync(string udid, string sessionId, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesDeleteWdaSession"); + + // verify the required parameter 'sessionId' is set + if (sessionId == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'sessionId' when calling DefaultApi->DevicesDeleteWdaSession"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.PathParameters.Add("sessionId", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(sessionId)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/api/v1/device/{udid}/wda/session/{sessionId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesDeleteWdaSession", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Disable condition Disable the currently active condition inducer profile. + /// + /// Thrown when fails to make API call + /// + /// GenericResponse + public GenericResponse DevicesDisableCondition(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesDisableConditionWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Disable condition Disable the currently active condition inducer profile. + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of GenericResponse + public GoIos.Sdk.Generated.Client.ApiResponse DevicesDisableConditionWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesDisableCondition"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/disable-condition", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesDisableCondition", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Disable condition Disable the currently active condition inducer profile. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + public async System.Threading.Tasks.Task DevicesDisableConditionAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesDisableConditionWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Disable condition Disable the currently active condition inducer profile. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + public async System.Threading.Tasks.Task> DevicesDisableConditionWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesDisableCondition"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/disable-condition", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesDisableCondition", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Enable condition Enable a condition inducer profile. + /// + /// Thrown when fails to make API call + /// + /// Identifier of the condition profile type. + /// Identifier of the specific profile to activate. + /// GenericResponse + public GenericResponse DevicesEnableCondition(string udid, string profileTypeID, string profileID) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesEnableConditionWithHttpInfo(udid, profileTypeID, profileID); + return localVarResponse.Data; + } + + /// + /// Enable condition Enable a condition inducer profile. + /// + /// Thrown when fails to make API call + /// + /// Identifier of the condition profile type. + /// Identifier of the specific profile to activate. + /// ApiResponse of GenericResponse + public GoIos.Sdk.Generated.Client.ApiResponse DevicesEnableConditionWithHttpInfo(string udid, string profileTypeID, string profileID) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesEnableCondition"); + + // verify the required parameter 'profileTypeID' is set + if (profileTypeID == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'profileTypeID' when calling DefaultApi->DevicesEnableCondition"); + + // verify the required parameter 'profileID' is set + if (profileID == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'profileID' when calling DefaultApi->DevicesEnableCondition"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "profileTypeID", profileTypeID)); + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "profileID", profileID)); + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/api/v1/device/{udid}/enable-condition", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesEnableCondition", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Enable condition Enable a condition inducer profile. + /// + /// Thrown when fails to make API call + /// + /// Identifier of the condition profile type. + /// Identifier of the specific profile to activate. + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + public async System.Threading.Tasks.Task DevicesEnableConditionAsync(string udid, string profileTypeID, string profileID, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesEnableConditionWithHttpInfoAsync(udid, profileTypeID, profileID, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Enable condition Enable a condition inducer profile. + /// + /// Thrown when fails to make API call + /// + /// Identifier of the condition profile type. + /// Identifier of the specific profile to activate. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + public async System.Threading.Tasks.Task> DevicesEnableConditionWithHttpInfoAsync(string udid, string profileTypeID, string profileID, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesEnableCondition"); + + // verify the required parameter 'profileTypeID' is set + if (profileTypeID == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'profileTypeID' when calling DefaultApi->DevicesEnableCondition"); + + // verify the required parameter 'profileID' is set + if (profileID == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'profileID' when calling DefaultApi->DevicesEnableCondition"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "profileTypeID", profileTypeID)); + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "profileID", profileID)); + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PutAsync("/api/v1/device/{udid}/enable-condition", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesEnableCondition", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Erase device Erase all content and settings (CLI: `ios erase`). Destructive: requires `confirm=true`. + /// + /// Thrown when fails to make API call + /// + /// Must be `true` to proceed with the destructive erase. + /// GenericResponse + public GenericResponse DevicesErase(string udid, bool confirm) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesEraseWithHttpInfo(udid, confirm); + return localVarResponse.Data; + } + + /// + /// Erase device Erase all content and settings (CLI: `ios erase`). Destructive: requires `confirm=true`. + /// + /// Thrown when fails to make API call + /// + /// Must be `true` to proceed with the destructive erase. + /// ApiResponse of GenericResponse + public GoIos.Sdk.Generated.Client.ApiResponse DevicesEraseWithHttpInfo(string udid, bool confirm) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesErase"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "confirm", confirm)); + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/erase", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesErase", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Erase device Erase all content and settings (CLI: `ios erase`). Destructive: requires `confirm=true`. + /// + /// Thrown when fails to make API call + /// + /// Must be `true` to proceed with the destructive erase. + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + public async System.Threading.Tasks.Task DevicesEraseAsync(string udid, bool confirm, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesEraseWithHttpInfoAsync(udid, confirm, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Erase device Erase all content and settings (CLI: `ios erase`). Destructive: requires `confirm=true`. + /// + /// Thrown when fails to make API call + /// + /// Must be `true` to proceed with the destructive erase. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + public async System.Threading.Tasks.Task> DevicesEraseWithHttpInfoAsync(string udid, bool confirm, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesErase"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "confirm", confirm)); + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/erase", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesErase", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get AssistiveTouch Get AssistiveTouch state (CLI: `ios assistivetouch get`). + /// + /// Thrown when fails to make API call + /// + /// AssistiveTouchState + public AssistiveTouchState DevicesGetAssistiveTouch(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesGetAssistiveTouchWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Get AssistiveTouch Get AssistiveTouch state (CLI: `ios assistivetouch get`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of AssistiveTouchState + public GoIos.Sdk.Generated.Client.ApiResponse DevicesGetAssistiveTouchWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetAssistiveTouch"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/assistivetouch", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetAssistiveTouch", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get AssistiveTouch Get AssistiveTouch state (CLI: `ios assistivetouch get`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of AssistiveTouchState + public async System.Threading.Tasks.Task DevicesGetAssistiveTouchAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesGetAssistiveTouchWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get AssistiveTouch Get AssistiveTouch state (CLI: `ios assistivetouch get`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (AssistiveTouchState) + public async System.Threading.Tasks.Task> DevicesGetAssistiveTouchWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetAssistiveTouch"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/assistivetouch", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetAssistiveTouch", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get battery info Get battery diagnostics (CLI: `ios batterycheck`). + /// + /// Thrown when fails to make API call + /// + /// BatteryInfo + public BatteryInfo DevicesGetBattery(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesGetBatteryWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Get battery info Get battery diagnostics (CLI: `ios batterycheck`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of BatteryInfo + public GoIos.Sdk.Generated.Client.ApiResponse DevicesGetBatteryWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetBattery"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/battery", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetBattery", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get battery info Get battery diagnostics (CLI: `ios batterycheck`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of BatteryInfo + public async System.Threading.Tasks.Task DevicesGetBatteryAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesGetBatteryWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get battery info Get battery diagnostics (CLI: `ios batterycheck`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (BatteryInfo) + public async System.Threading.Tasks.Task> DevicesGetBatteryWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetBattery"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/battery", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetBattery", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get developer mode Get developer mode state (CLI: `ios devmode get`). + /// + /// Thrown when fails to make API call + /// + /// DevModeState + public DevModeState DevicesGetDevMode(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesGetDevModeWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Get developer mode Get developer mode state (CLI: `ios devmode get`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of DevModeState + public GoIos.Sdk.Generated.Client.ApiResponse DevicesGetDevModeWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetDevMode"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/devmode", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetDevMode", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get developer mode Get developer mode state (CLI: `ios devmode get`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of DevModeState + public async System.Threading.Tasks.Task DevicesGetDevModeAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesGetDevModeWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get developer mode Get developer mode state (CLI: `ios devmode get`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (DevModeState) + public async System.Threading.Tasks.Task> DevicesGetDevModeWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetDevMode"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/devmode", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetDevMode", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get device date Get the device clock (CLI: `ios date`). + /// + /// Thrown when fails to make API call + /// + /// DeviceDate + public DeviceDate DevicesGetDeviceDate(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesGetDeviceDateWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Get device date Get the device clock (CLI: `ios date`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of DeviceDate + public GoIos.Sdk.Generated.Client.ApiResponse DevicesGetDeviceDateWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetDeviceDate"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/date", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetDeviceDate", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get device date Get the device clock (CLI: `ios date`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of DeviceDate + public async System.Threading.Tasks.Task DevicesGetDeviceDateAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesGetDeviceDateWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get device date Get the device clock (CLI: `ios date`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (DeviceDate) + public async System.Threading.Tasks.Task> DevicesGetDeviceDateWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetDeviceDate"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/date", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetDeviceDate", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get device name Get the device name (CLI: `ios devicename`). + /// + /// Thrown when fails to make API call + /// + /// DeviceName + public DeviceName DevicesGetDeviceName(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesGetDeviceNameWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Get device name Get the device name (CLI: `ios devicename`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of DeviceName + public GoIos.Sdk.Generated.Client.ApiResponse DevicesGetDeviceNameWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetDeviceName"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/devicename", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetDeviceName", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get device name Get the device name (CLI: `ios devicename`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of DeviceName + public async System.Threading.Tasks.Task DevicesGetDeviceNameAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesGetDeviceNameWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get device name Get the device name (CLI: `ios devicename`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (DeviceName) + public async System.Threading.Tasks.Task> DevicesGetDeviceNameWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetDeviceName"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/devicename", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetDeviceName", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// List diagnostics List all IORegistry/diagnostic values (CLI: `ios diagnostics list`). + /// + /// Thrown when fails to make API call + /// + /// Object + public Object DevicesGetDiagnostics(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesGetDiagnosticsWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// List diagnostics List all IORegistry/diagnostic values (CLI: `ios diagnostics list`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse DevicesGetDiagnosticsWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetDiagnostics"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/diagnostics", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetDiagnostics", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// List diagnostics List all IORegistry/diagnostic values (CLI: `ios diagnostics list`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task DevicesGetDiagnosticsAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesGetDiagnosticsWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// List diagnostics List all IORegistry/diagnostic values (CLI: `ios diagnostics list`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> DevicesGetDiagnosticsWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetDiagnostics"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/diagnostics", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetDiagnostics", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get icon layout Get the SpringBoard icon layout (CLI: `ios get-icon-layout`). + /// + /// Thrown when fails to make API call + /// + /// Object + public Object DevicesGetIconLayout(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesGetIconLayoutWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Get icon layout Get the SpringBoard icon layout (CLI: `ios get-icon-layout`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse DevicesGetIconLayoutWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetIconLayout"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/icon-layout", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetIconLayout", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get icon layout Get the SpringBoard icon layout (CLI: `ios get-icon-layout`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task DevicesGetIconLayoutAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesGetIconLayoutWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get icon layout Get the SpringBoard icon layout (CLI: `ios get-icon-layout`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> DevicesGetIconLayoutWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetIconLayout"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/icon-layout", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetIconLayout", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get device info Get lockdown values plus `instruments:*` keys for the device. Returns an open dictionary of heterogeneous values. + /// + /// Thrown when fails to make API call + /// + /// Object + public Object DevicesGetInfo(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesGetInfoWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Get device info Get lockdown values plus `instruments:*` keys for the device. Returns an open dictionary of heterogeneous values. + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse DevicesGetInfoWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetInfo"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/info", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetInfo", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get device info Get lockdown values plus `instruments:*` keys for the device. Returns an open dictionary of heterogeneous values. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task DevicesGetInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesGetInfoWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get device info Get lockdown values plus `instruments:*` keys for the device. Returns an open dictionary of heterogeneous values. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> DevicesGetInfoWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetInfo"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/info", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetInfo", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get job Get a job's status. Returns `404` for an unknown job on this device. + /// + /// Thrown when fails to make API call + /// + /// The job id. + /// Job + public Job DevicesGetJob(string udid, string id) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesGetJobWithHttpInfo(udid, id); + return localVarResponse.Data; + } + + /// + /// Get job Get a job's status. Returns `404` for an unknown job on this device. + /// + /// Thrown when fails to make API call + /// + /// The job id. + /// ApiResponse of Job + public GoIos.Sdk.Generated.Client.ApiResponse DevicesGetJobWithHttpInfo(string udid, string id) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetJob"); + + // verify the required parameter 'id' is set + if (id == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling DefaultApi->DevicesGetJob"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.PathParameters.Add("id", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/jobs/{id}", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetJob", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get job Get a job's status. Returns `404` for an unknown job on this device. + /// + /// Thrown when fails to make API call + /// + /// The job id. + /// Cancellation Token to cancel the request. + /// Task of Job + public async System.Threading.Tasks.Task DevicesGetJobAsync(string udid, string id, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesGetJobWithHttpInfoAsync(udid, id, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get job Get a job's status. Returns `404` for an unknown job on this device. + /// + /// Thrown when fails to make API call + /// + /// The job id. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Job) + public async System.Threading.Tasks.Task> DevicesGetJobWithHttpInfoAsync(string udid, string id, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetJob"); + + // verify the required parameter 'id' is set + if (id == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling DefaultApi->DevicesGetJob"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.PathParameters.Add("id", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/jobs/{id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetJob", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get language Get the device language/locale configuration (CLI: `ios lang`). + /// + /// Thrown when fails to make API call + /// + /// LanguageConfiguration + public LanguageConfiguration DevicesGetLanguage(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesGetLanguageWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Get language Get the device language/locale configuration (CLI: `ios lang`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of LanguageConfiguration + public GoIos.Sdk.Generated.Client.ApiResponse DevicesGetLanguageWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetLanguage"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/lang", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetLanguage", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get language Get the device language/locale configuration (CLI: `ios lang`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of LanguageConfiguration + public async System.Threading.Tasks.Task DevicesGetLanguageAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesGetLanguageWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get language Get the device language/locale configuration (CLI: `ios lang`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (LanguageConfiguration) + public async System.Threading.Tasks.Task> DevicesGetLanguageWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetLanguage"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/lang", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetLanguage", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get lockdown values Get lockdown values (CLI: `ios lockdown get`). Without `domain` the full set is returned; with `domain` the values are scoped to that lockdown domain. + /// + /// Thrown when fails to make API call + /// + /// Optional lockdown domain to scope the returned values. (optional) + /// Object + public Object DevicesGetLockdownValues(string udid, string? domain = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesGetLockdownValuesWithHttpInfo(udid, domain); + return localVarResponse.Data; + } + + /// + /// Get lockdown values Get lockdown values (CLI: `ios lockdown get`). Without `domain` the full set is returned; with `domain` the values are scoped to that lockdown domain. + /// + /// Thrown when fails to make API call + /// + /// Optional lockdown domain to scope the returned values. (optional) + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse DevicesGetLockdownValuesWithHttpInfo(string udid, string? domain = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetLockdownValues"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (domain != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "domain", domain)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/lockdown", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetLockdownValues", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get lockdown values Get lockdown values (CLI: `ios lockdown get`). Without `domain` the full set is returned; with `domain` the values are scoped to that lockdown domain. + /// + /// Thrown when fails to make API call + /// + /// Optional lockdown domain to scope the returned values. (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task DevicesGetLockdownValuesAsync(string udid, string? domain = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesGetLockdownValuesWithHttpInfoAsync(udid, domain, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get lockdown values Get lockdown values (CLI: `ios lockdown get`). Without `domain` the full set is returned; with `domain` the values are scoped to that lockdown domain. + /// + /// Thrown when fails to make API call + /// + /// Optional lockdown domain to scope the returned values. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> DevicesGetLockdownValuesWithHttpInfoAsync(string udid, string? domain = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetLockdownValues"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (domain != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "domain", domain)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/lockdown", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetLockdownValues", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Query MobileGestalt Query one or more MobileGestalt keys (CLI: `ios mobilegestalt <key>...`). Pass repeated `key` query params. + /// + /// Thrown when fails to make API call + /// + /// One or more MobileGestalt keys to query. + /// Object + public Object DevicesGetMobileGestalt(string udid, List key) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesGetMobileGestaltWithHttpInfo(udid, key); + return localVarResponse.Data; + } + + /// + /// Query MobileGestalt Query one or more MobileGestalt keys (CLI: `ios mobilegestalt <key>...`). Pass repeated `key` query params. + /// + /// Thrown when fails to make API call + /// + /// One or more MobileGestalt keys to query. + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse DevicesGetMobileGestaltWithHttpInfo(string udid, List key) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetMobileGestalt"); + + // verify the required parameter 'key' is set + if (key == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'key' when calling DefaultApi->DevicesGetMobileGestalt"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("csv", "key", key)); + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/mobilegestalt", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetMobileGestalt", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Query MobileGestalt Query one or more MobileGestalt keys (CLI: `ios mobilegestalt <key>...`). Pass repeated `key` query params. + /// + /// Thrown when fails to make API call + /// + /// One or more MobileGestalt keys to query. + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task DevicesGetMobileGestaltAsync(string udid, List key, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesGetMobileGestaltWithHttpInfoAsync(udid, key, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Query MobileGestalt Query one or more MobileGestalt keys (CLI: `ios mobilegestalt <key>...`). Pass repeated `key` query params. + /// + /// Thrown when fails to make API call + /// + /// One or more MobileGestalt keys to query. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> DevicesGetMobileGestaltWithHttpInfoAsync(string udid, List key, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetMobileGestalt"); + + // verify the required parameter 'key' is set + if (key == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'key' when calling DefaultApi->DevicesGetMobileGestalt"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("csv", "key", key)); + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/mobilegestalt", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetMobileGestalt", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get pasteboard Get the pasteboard (clipboard) text (CLI: `ios pasteboard get`). + /// + /// Thrown when fails to make API call + /// + /// PasteboardContent + public PasteboardContent DevicesGetPasteboard(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesGetPasteboardWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Get pasteboard Get the pasteboard (clipboard) text (CLI: `ios pasteboard get`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of PasteboardContent + public GoIos.Sdk.Generated.Client.ApiResponse DevicesGetPasteboardWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetPasteboard"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/pasteboard", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetPasteboard", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get pasteboard Get the pasteboard (clipboard) text (CLI: `ios pasteboard get`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of PasteboardContent + public async System.Threading.Tasks.Task DevicesGetPasteboardAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesGetPasteboardWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get pasteboard Get the pasteboard (clipboard) text (CLI: `ios pasteboard get`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (PasteboardContent) + public async System.Threading.Tasks.Task> DevicesGetPasteboardWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetPasteboard"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/pasteboard", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetPasteboard", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// List processes List running processes (CLI: `ios ps [- -apps]`). + /// + /// Thrown when fails to make API call + /// + /// Only return application processes. (optional) + /// List<ProcessInfo> + public List DevicesGetProcesses(string udid, bool? apps = default) + { + GoIos.Sdk.Generated.Client.ApiResponse> localVarResponse = DevicesGetProcessesWithHttpInfo(udid, apps); + return localVarResponse.Data; + } + + /// + /// List processes List running processes (CLI: `ios ps [- -apps]`). + /// + /// Thrown when fails to make API call + /// + /// Only return application processes. (optional) + /// ApiResponse of List<ProcessInfo> + public GoIos.Sdk.Generated.Client.ApiResponse> DevicesGetProcessesWithHttpInfo(string udid, bool? apps = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetProcesses"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (apps != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "apps", apps)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/api/v1/device/{udid}/processes", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetProcesses", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// List processes List running processes (CLI: `ios ps [- -apps]`). + /// + /// Thrown when fails to make API call + /// + /// Only return application processes. (optional) + /// Cancellation Token to cancel the request. + /// Task of List<ProcessInfo> + public async System.Threading.Tasks.Task> DevicesGetProcessesAsync(string udid, bool? apps = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse> localVarResponse = await DevicesGetProcessesWithHttpInfoAsync(udid, apps, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// List processes List running processes (CLI: `ios ps [- -apps]`). + /// + /// Thrown when fails to make API call + /// + /// Only return application processes. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<ProcessInfo>) + public async System.Threading.Tasks.Task>> DevicesGetProcessesWithHttpInfoAsync(string udid, bool? apps = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetProcesses"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (apps != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "apps", apps)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync>("/api/v1/device/{udid}/processes", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetProcesses", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// List configuration profiles List installed configuration profiles. Returns an open dictionary. + /// + /// Thrown when fails to make API call + /// + /// Object + public Object DevicesGetProfiles(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesGetProfilesWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// List configuration profiles List installed configuration profiles. Returns an open dictionary. + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse DevicesGetProfilesWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetProfiles"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/profiles", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetProfiles", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// List configuration profiles List installed configuration profiles. Returns an open dictionary. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task DevicesGetProfilesAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesGetProfilesWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// List configuration profiles List installed configuration profiles. Returns an open dictionary. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> DevicesGetProfilesWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetProfiles"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/profiles", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetProfiles", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get time format Get the 24-hour clock state (CLI: `ios timeformat get`). + /// + /// Thrown when fails to make API call + /// + /// TimeFormatState + public TimeFormatState DevicesGetTimeFormat(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesGetTimeFormatWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Get time format Get the 24-hour clock state (CLI: `ios timeformat get`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of TimeFormatState + public GoIos.Sdk.Generated.Client.ApiResponse DevicesGetTimeFormatWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetTimeFormat"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/timeformat", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetTimeFormat", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get time format Get the 24-hour clock state (CLI: `ios timeformat get`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of TimeFormatState + public async System.Threading.Tasks.Task DevicesGetTimeFormatAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesGetTimeFormatWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get time format Get the 24-hour clock state (CLI: `ios timeformat get`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (TimeFormatState) + public async System.Threading.Tasks.Task> DevicesGetTimeFormatWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetTimeFormat"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/timeformat", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetTimeFormat", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get wallpaper Get the home-screen wallpaper as PNG (CLI: `ios get-wallpaper`). + /// + /// Thrown when fails to make API call + /// + /// Object + public Object DevicesGetWallpaper(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesGetWallpaperWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Get wallpaper Get the home-screen wallpaper as PNG (CLI: `ios get-wallpaper`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse DevicesGetWallpaperWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetWallpaper"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "image/png", + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/wallpaper", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetWallpaper", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get wallpaper Get the home-screen wallpaper as PNG (CLI: `ios get-wallpaper`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task DevicesGetWallpaperAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesGetWallpaperWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get wallpaper Get the home-screen wallpaper as PNG (CLI: `ios get-wallpaper`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> DevicesGetWallpaperWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetWallpaper"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "image/png", + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/wallpaper", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetWallpaper", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get WDA session Get a running WebDriverAgent session. Returns `404` for an unknown session. + /// + /// Thrown when fails to make API call + /// + /// The WDA session id. + /// WdaSession + public WdaSession DevicesGetWdaSession(string udid, string sessionId) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesGetWdaSessionWithHttpInfo(udid, sessionId); + return localVarResponse.Data; + } + + /// + /// Get WDA session Get a running WebDriverAgent session. Returns `404` for an unknown session. + /// + /// Thrown when fails to make API call + /// + /// The WDA session id. + /// ApiResponse of WdaSession + public GoIos.Sdk.Generated.Client.ApiResponse DevicesGetWdaSessionWithHttpInfo(string udid, string sessionId) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetWdaSession"); + + // verify the required parameter 'sessionId' is set + if (sessionId == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'sessionId' when calling DefaultApi->DevicesGetWdaSession"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.PathParameters.Add("sessionId", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(sessionId)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/wda/session/{sessionId}", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetWdaSession", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get WDA session Get a running WebDriverAgent session. Returns `404` for an unknown session. + /// + /// Thrown when fails to make API call + /// + /// The WDA session id. + /// Cancellation Token to cancel the request. + /// Task of WdaSession + public async System.Threading.Tasks.Task DevicesGetWdaSessionAsync(string udid, string sessionId, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesGetWdaSessionWithHttpInfoAsync(udid, sessionId, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get WDA session Get a running WebDriverAgent session. Returns `404` for an unknown session. + /// + /// Thrown when fails to make API call + /// + /// The WDA session id. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (WdaSession) + public async System.Threading.Tasks.Task> DevicesGetWdaSessionWithHttpInfoAsync(string udid, string sessionId, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesGetWdaSession"); + + // verify the required parameter 'sessionId' is set + if (sessionId == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'sessionId' when calling DefaultApi->DevicesGetWdaSession"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.PathParameters.Add("sessionId", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(sessionId)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/wda/session/{sessionId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesGetWdaSession", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Install app Install an application from an uploaded `.ipa`/`.app` archive. The multipart `file` part must be 1 byte–200 MB. + /// + /// Thrown when fails to make API call + /// + /// + /// GenericResponse + public GenericResponse DevicesInstallApp(string udid, Object file) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesInstallAppWithHttpInfo(udid, file); + return localVarResponse.Data; + } + + /// + /// Install app Install an application from an uploaded `.ipa`/`.app` archive. The multipart `file` part must be 1 byte–200 MB. + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of GenericResponse + public GoIos.Sdk.Generated.Client.ApiResponse DevicesInstallAppWithHttpInfo(string udid, Object file) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesInstallApp"); + + // verify the required parameter 'file' is set + if (file == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'file' when calling DefaultApi->DevicesInstallApp"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.FormParameters.Add("file", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(file)); // form parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/apps/install", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesInstallApp", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Install app Install an application from an uploaded `.ipa`/`.app` archive. The multipart `file` part must be 1 byte–200 MB. + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + public async System.Threading.Tasks.Task DevicesInstallAppAsync(string udid, Object file, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesInstallAppWithHttpInfoAsync(udid, file, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Install app Install an application from an uploaded `.ipa`/`.app` archive. The multipart `file` part must be 1 byte–200 MB. + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + public async System.Threading.Tasks.Task> DevicesInstallAppWithHttpInfoAsync(string udid, Object file, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesInstallApp"); + + // verify the required parameter 'file' is set + if (file == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'file' when calling DefaultApi->DevicesInstallApp"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.FormParameters.Add("file", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(file)); // form parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/apps/install", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesInstallApp", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Kill app Kill a running application by bundle id. + /// + /// Thrown when fails to make API call + /// + /// Bundle id of the app to kill. + /// GenericResponse + public GenericResponse DevicesKillApp(string udid, string bundleID) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesKillAppWithHttpInfo(udid, bundleID); + return localVarResponse.Data; + } + + /// + /// Kill app Kill a running application by bundle id. + /// + /// Thrown when fails to make API call + /// + /// Bundle id of the app to kill. + /// ApiResponse of GenericResponse + public GoIos.Sdk.Generated.Client.ApiResponse DevicesKillAppWithHttpInfo(string udid, string bundleID) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesKillApp"); + + // verify the required parameter 'bundleID' is set + if (bundleID == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'bundleID' when calling DefaultApi->DevicesKillApp"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "bundleID", bundleID)); + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/apps/kill", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesKillApp", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Kill app Kill a running application by bundle id. + /// + /// Thrown when fails to make API call + /// + /// Bundle id of the app to kill. + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + public async System.Threading.Tasks.Task DevicesKillAppAsync(string udid, string bundleID, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesKillAppWithHttpInfoAsync(udid, bundleID, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Kill app Kill a running application by bundle id. + /// + /// Thrown when fails to make API call + /// + /// Bundle id of the app to kill. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + public async System.Threading.Tasks.Task> DevicesKillAppWithHttpInfoAsync(string udid, string bundleID, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesKillApp"); + + // verify the required parameter 'bundleID' is set + if (bundleID == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'bundleID' when calling DefaultApi->DevicesKillApp"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "bundleID", bundleID)); + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/apps/kill", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesKillApp", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Launch app Launch an application by bundle id. + /// + /// Thrown when fails to make API call + /// + /// Bundle id of the app to launch. + /// GenericResponse + public GenericResponse DevicesLaunchApp(string udid, string bundleID) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesLaunchAppWithHttpInfo(udid, bundleID); + return localVarResponse.Data; + } + + /// + /// Launch app Launch an application by bundle id. + /// + /// Thrown when fails to make API call + /// + /// Bundle id of the app to launch. + /// ApiResponse of GenericResponse + public GoIos.Sdk.Generated.Client.ApiResponse DevicesLaunchAppWithHttpInfo(string udid, string bundleID) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesLaunchApp"); + + // verify the required parameter 'bundleID' is set + if (bundleID == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'bundleID' when calling DefaultApi->DevicesLaunchApp"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "bundleID", bundleID)); + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/apps/launch", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesLaunchApp", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Launch app Launch an application by bundle id. + /// + /// Thrown when fails to make API call + /// + /// Bundle id of the app to launch. + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + public async System.Threading.Tasks.Task DevicesLaunchAppAsync(string udid, string bundleID, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesLaunchAppWithHttpInfoAsync(udid, bundleID, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Launch app Launch an application by bundle id. + /// + /// Thrown when fails to make API call + /// + /// Bundle id of the app to launch. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + public async System.Threading.Tasks.Task> DevicesLaunchAppWithHttpInfoAsync(string udid, string bundleID, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesLaunchApp"); + + // verify the required parameter 'bundleID' is set + if (bundleID == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'bundleID' when calling DefaultApi->DevicesLaunchApp"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "bundleID", bundleID)); + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/apps/launch", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesLaunchApp", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// List apps List installed applications. Each entry is an open Info.plist map. + /// + /// Thrown when fails to make API call + /// + /// List<AppInfo> + public List DevicesListApps(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse> localVarResponse = DevicesListAppsWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// List apps List installed applications. Each entry is an open Info.plist map. + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of List<AppInfo> + public GoIos.Sdk.Generated.Client.ApiResponse> DevicesListAppsWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesListApps"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/api/v1/device/{udid}/apps/", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesListApps", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// List apps List installed applications. Each entry is an open Info.plist map. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of List<AppInfo> + public async System.Threading.Tasks.Task> DevicesListAppsAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse> localVarResponse = await DevicesListAppsWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// List apps List installed applications. Each entry is an open Info.plist map. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<AppInfo>) + public async System.Threading.Tasks.Task>> DevicesListAppsWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesListApps"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync>("/api/v1/device/{udid}/apps/", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesListApps", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// List conditions List available condition inducer profile types. + /// + /// Thrown when fails to make API call + /// + /// List<ProfileType> + public List DevicesListConditions(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse> localVarResponse = DevicesListConditionsWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// List conditions List available condition inducer profile types. + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of List<ProfileType> + public GoIos.Sdk.Generated.Client.ApiResponse> DevicesListConditionsWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesListConditions"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/api/v1/device/{udid}/conditions", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesListConditions", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// List conditions List available condition inducer profile types. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of List<ProfileType> + public async System.Threading.Tasks.Task> DevicesListConditionsAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse> localVarResponse = await DevicesListConditionsWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// List conditions List available condition inducer profile types. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<ProfileType>) + public async System.Threading.Tasks.Task>> DevicesListConditionsWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesListConditions"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync>("/api/v1/device/{udid}/conditions", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesListConditions", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// List crash reports List crash reports (CLI: `ios crash ls`). + /// + /// Thrown when fails to make API call + /// + /// Optional glob pattern to filter reports. (optional) + /// CrashListing + public CrashListing DevicesListCrashes(string udid, string? pattern = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesListCrashesWithHttpInfo(udid, pattern); + return localVarResponse.Data; + } + + /// + /// List crash reports List crash reports (CLI: `ios crash ls`). + /// + /// Thrown when fails to make API call + /// + /// Optional glob pattern to filter reports. (optional) + /// ApiResponse of CrashListing + public GoIos.Sdk.Generated.Client.ApiResponse DevicesListCrashesWithHttpInfo(string udid, string? pattern = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesListCrashes"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (pattern != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "pattern", pattern)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/crashes", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesListCrashes", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// List crash reports List crash reports (CLI: `ios crash ls`). + /// + /// Thrown when fails to make API call + /// + /// Optional glob pattern to filter reports. (optional) + /// Cancellation Token to cancel the request. + /// Task of CrashListing + public async System.Threading.Tasks.Task DevicesListCrashesAsync(string udid, string? pattern = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesListCrashesWithHttpInfoAsync(udid, pattern, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// List crash reports List crash reports (CLI: `ios crash ls`). + /// + /// Thrown when fails to make API call + /// + /// Optional glob pattern to filter reports. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (CrashListing) + public async System.Threading.Tasks.Task> DevicesListCrashesWithHttpInfoAsync(string udid, string? pattern = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesListCrashes"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (pattern != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "pattern", pattern)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/crashes", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesListCrashes", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// List files List a device directory (CLI: `ios file ls`). + /// + /// Thrown when fails to make API call + /// + /// File service domain: `app`, `app-group`, `crash` or `temp`. + /// Bundle/group id for the `app`/`app-group` domains. (optional) + /// Directory path to list (defaults to `.`). (optional) + /// FileListing + public FileListing DevicesListFiles(string udid, FileDomain domain, string? identifier = default, string? path = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesListFilesWithHttpInfo(udid, domain, identifier, path); + return localVarResponse.Data; + } + + /// + /// List files List a device directory (CLI: `ios file ls`). + /// + /// Thrown when fails to make API call + /// + /// File service domain: `app`, `app-group`, `crash` or `temp`. + /// Bundle/group id for the `app`/`app-group` domains. (optional) + /// Directory path to list (defaults to `.`). (optional) + /// ApiResponse of FileListing + public GoIos.Sdk.Generated.Client.ApiResponse DevicesListFilesWithHttpInfo(string udid, FileDomain domain, string? identifier = default, string? path = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesListFiles"); + + // verify the required parameter 'domain' is set + if (domain == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'domain' when calling DefaultApi->DevicesListFiles"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "domain", domain)); + if (identifier != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "identifier", identifier)); + } + if (path != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "path", path)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/files", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesListFiles", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// List files List a device directory (CLI: `ios file ls`). + /// + /// Thrown when fails to make API call + /// + /// File service domain: `app`, `app-group`, `crash` or `temp`. + /// Bundle/group id for the `app`/`app-group` domains. (optional) + /// Directory path to list (defaults to `.`). (optional) + /// Cancellation Token to cancel the request. + /// Task of FileListing + public async System.Threading.Tasks.Task DevicesListFilesAsync(string udid, FileDomain domain, string? identifier = default, string? path = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesListFilesWithHttpInfoAsync(udid, domain, identifier, path, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// List files List a device directory (CLI: `ios file ls`). + /// + /// Thrown when fails to make API call + /// + /// File service domain: `app`, `app-group`, `crash` or `temp`. + /// Bundle/group id for the `app`/`app-group` domains. (optional) + /// Directory path to list (defaults to `.`). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FileListing) + public async System.Threading.Tasks.Task> DevicesListFilesWithHttpInfoAsync(string udid, FileDomain domain, string? identifier = default, string? path = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesListFiles"); + + // verify the required parameter 'domain' is set + if (domain == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'domain' when calling DefaultApi->DevicesListFiles"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "domain", domain)); + if (identifier != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "identifier", identifier)); + } + if (path != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "path", path)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/files", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesListFiles", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// List mounted developer images List the hex signatures of Developer Disk Images mounted on the device. + /// + /// Thrown when fails to make API call + /// + /// List<string> + public List DevicesListImages(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse> localVarResponse = DevicesListImagesWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// List mounted developer images List the hex signatures of Developer Disk Images mounted on the device. + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of List<string> + public GoIos.Sdk.Generated.Client.ApiResponse> DevicesListImagesWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesListImages"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/api/v1/device/{udid}/image", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesListImages", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// List mounted developer images List the hex signatures of Developer Disk Images mounted on the device. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of List<string> + public async System.Threading.Tasks.Task> DevicesListImagesAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse> localVarResponse = await DevicesListImagesWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// List mounted developer images List the hex signatures of Developer Disk Images mounted on the device. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<string>) + public async System.Threading.Tasks.Task>> DevicesListImagesWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesListImages"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync>("/api/v1/device/{udid}/image", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesListImages", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// List jobs List jobs for a device. + /// + /// Thrown when fails to make API call + /// + /// List<Job> + public List DevicesListJobs(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse> localVarResponse = DevicesListJobsWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// List jobs List jobs for a device. + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of List<Job> + public GoIos.Sdk.Generated.Client.ApiResponse> DevicesListJobsWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesListJobs"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/api/v1/device/{udid}/jobs", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesListJobs", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// List jobs List jobs for a device. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of List<Job> + public async System.Threading.Tasks.Task> DevicesListJobsAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse> localVarResponse = await DevicesListJobsWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// List jobs List jobs for a device. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Job>) + public async System.Threading.Tasks.Task>> DevicesListJobsWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesListJobs"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync>("/api/v1/device/{udid}/jobs", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesListJobs", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// List mounted images List mounted developer image signatures (CLI: `ios image list`). + /// + /// Thrown when fails to make API call + /// + /// MountedImages + public MountedImages DevicesListMountedImages(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesListMountedImagesWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// List mounted images List mounted developer image signatures (CLI: `ios image list`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of MountedImages + public GoIos.Sdk.Generated.Client.ApiResponse DevicesListMountedImagesWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesListMountedImages"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/image/list", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesListMountedImages", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// List mounted images List mounted developer image signatures (CLI: `ios image list`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of MountedImages + public async System.Threading.Tasks.Task DevicesListMountedImagesAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesListMountedImagesWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// List mounted images List mounted developer image signatures (CLI: `ios image list`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (MountedImages) + public async System.Threading.Tasks.Task> DevicesListMountedImagesWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesListMountedImages"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/image/list", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesListMountedImages", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Clear passcode (supervised) Clear the device passcode (CLI: `ios mdm clear-passcode`). Requires the base64 unlock token as an additional `token` form field. + /// + /// Thrown when fails to make API call + /// + /// + /// Base64-encoded escrow unlock token. + /// Passphrase for the `.p12` identity. (optional) + /// StatusOk + public StatusOk DevicesMdmClearPasscode(string udid, Object p12, string token, string? password = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesMdmClearPasscodeWithHttpInfo(udid, p12, token, password); + return localVarResponse.Data; + } + + /// + /// Clear passcode (supervised) Clear the device passcode (CLI: `ios mdm clear-passcode`). Requires the base64 unlock token as an additional `token` form field. + /// + /// Thrown when fails to make API call + /// + /// + /// Base64-encoded escrow unlock token. + /// Passphrase for the `.p12` identity. (optional) + /// ApiResponse of StatusOk + public GoIos.Sdk.Generated.Client.ApiResponse DevicesMdmClearPasscodeWithHttpInfo(string udid, Object p12, string token, string? password = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesMdmClearPasscode"); + + // verify the required parameter 'p12' is set + if (p12 == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'p12' when calling DefaultApi->DevicesMdmClearPasscode"); + + // verify the required parameter 'token' is set + if (token == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'token' when calling DefaultApi->DevicesMdmClearPasscode"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.FormParameters.Add("p12", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(p12)); // form parameter + if (password != null) + { + localVarRequestOptions.FormParameters.Add("password", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(password)); // form parameter + } + localVarRequestOptions.FormParameters.Add("token", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(token)); // form parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/mdm/clear-passcode", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesMdmClearPasscode", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Clear passcode (supervised) Clear the device passcode (CLI: `ios mdm clear-passcode`). Requires the base64 unlock token as an additional `token` form field. + /// + /// Thrown when fails to make API call + /// + /// + /// Base64-encoded escrow unlock token. + /// Passphrase for the `.p12` identity. (optional) + /// Cancellation Token to cancel the request. + /// Task of StatusOk + public async System.Threading.Tasks.Task DevicesMdmClearPasscodeAsync(string udid, Object p12, string token, string? password = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesMdmClearPasscodeWithHttpInfoAsync(udid, p12, token, password, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Clear passcode (supervised) Clear the device passcode (CLI: `ios mdm clear-passcode`). Requires the base64 unlock token as an additional `token` form field. + /// + /// Thrown when fails to make API call + /// + /// + /// Base64-encoded escrow unlock token. + /// Passphrase for the `.p12` identity. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (StatusOk) + public async System.Threading.Tasks.Task> DevicesMdmClearPasscodeWithHttpInfoAsync(string udid, Object p12, string token, string? password = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesMdmClearPasscode"); + + // verify the required parameter 'p12' is set + if (p12 == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'p12' when calling DefaultApi->DevicesMdmClearPasscode"); + + // verify the required parameter 'token' is set + if (token == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'token' when calling DefaultApi->DevicesMdmClearPasscode"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.FormParameters.Add("p12", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(p12)); // form parameter + if (password != null) + { + localVarRequestOptions.FormParameters.Add("password", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(password)); // form parameter + } + localVarRequestOptions.FormParameters.Add("token", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(token)); // form parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/mdm/clear-passcode", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesMdmClearPasscode", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Clear Screen Time password (supervised) Clear the Screen Time password (CLI: `ios mdm clear-screen-time-password`). + /// + /// Thrown when fails to make API call + /// + /// + /// Passphrase for the `.p12` identity. (optional) + /// StatusOk + public StatusOk DevicesMdmClearScreenTimePassword(string udid, Object p12, string? password = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesMdmClearScreenTimePasswordWithHttpInfo(udid, p12, password); + return localVarResponse.Data; + } + + /// + /// Clear Screen Time password (supervised) Clear the Screen Time password (CLI: `ios mdm clear-screen-time-password`). + /// + /// Thrown when fails to make API call + /// + /// + /// Passphrase for the `.p12` identity. (optional) + /// ApiResponse of StatusOk + public GoIos.Sdk.Generated.Client.ApiResponse DevicesMdmClearScreenTimePasswordWithHttpInfo(string udid, Object p12, string? password = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesMdmClearScreenTimePassword"); + + // verify the required parameter 'p12' is set + if (p12 == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'p12' when calling DefaultApi->DevicesMdmClearScreenTimePassword"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.FormParameters.Add("p12", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(p12)); // form parameter + if (password != null) + { + localVarRequestOptions.FormParameters.Add("password", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(password)); // form parameter + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/mdm/clear-screen-time-password", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesMdmClearScreenTimePassword", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Clear Screen Time password (supervised) Clear the Screen Time password (CLI: `ios mdm clear-screen-time-password`). + /// + /// Thrown when fails to make API call + /// + /// + /// Passphrase for the `.p12` identity. (optional) + /// Cancellation Token to cancel the request. + /// Task of StatusOk + public async System.Threading.Tasks.Task DevicesMdmClearScreenTimePasswordAsync(string udid, Object p12, string? password = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesMdmClearScreenTimePasswordWithHttpInfoAsync(udid, p12, password, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Clear Screen Time password (supervised) Clear the Screen Time password (CLI: `ios mdm clear-screen-time-password`). + /// + /// Thrown when fails to make API call + /// + /// + /// Passphrase for the `.p12` identity. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (StatusOk) + public async System.Threading.Tasks.Task> DevicesMdmClearScreenTimePasswordWithHttpInfoAsync(string udid, Object p12, string? password = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesMdmClearScreenTimePassword"); + + // verify the required parameter 'p12' is set + if (p12 == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'p12' when calling DefaultApi->DevicesMdmClearScreenTimePassword"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.FormParameters.Add("p12", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(p12)); // form parameter + if (password != null) + { + localVarRequestOptions.FormParameters.Add("password", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(password)); // form parameter + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/mdm/clear-screen-time-password", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesMdmClearScreenTimePassword", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Fetch unlock token (supervised) Fetch the escrow unlock token, base64-encoded (CLI: `ios mdm fetch-unlock-token`). + /// + /// Thrown when fails to make API call + /// + /// + /// Passphrase for the `.p12` identity. (optional) + /// UnlockToken + public UnlockToken DevicesMdmFetchUnlockToken(string udid, Object p12, string? password = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesMdmFetchUnlockTokenWithHttpInfo(udid, p12, password); + return localVarResponse.Data; + } + + /// + /// Fetch unlock token (supervised) Fetch the escrow unlock token, base64-encoded (CLI: `ios mdm fetch-unlock-token`). + /// + /// Thrown when fails to make API call + /// + /// + /// Passphrase for the `.p12` identity. (optional) + /// ApiResponse of UnlockToken + public GoIos.Sdk.Generated.Client.ApiResponse DevicesMdmFetchUnlockTokenWithHttpInfo(string udid, Object p12, string? password = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesMdmFetchUnlockToken"); + + // verify the required parameter 'p12' is set + if (p12 == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'p12' when calling DefaultApi->DevicesMdmFetchUnlockToken"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.FormParameters.Add("p12", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(p12)); // form parameter + if (password != null) + { + localVarRequestOptions.FormParameters.Add("password", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(password)); // form parameter + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/mdm/fetch-unlock-token", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesMdmFetchUnlockToken", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Fetch unlock token (supervised) Fetch the escrow unlock token, base64-encoded (CLI: `ios mdm fetch-unlock-token`). + /// + /// Thrown when fails to make API call + /// + /// + /// Passphrase for the `.p12` identity. (optional) + /// Cancellation Token to cancel the request. + /// Task of UnlockToken + public async System.Threading.Tasks.Task DevicesMdmFetchUnlockTokenAsync(string udid, Object p12, string? password = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesMdmFetchUnlockTokenWithHttpInfoAsync(udid, p12, password, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Fetch unlock token (supervised) Fetch the escrow unlock token, base64-encoded (CLI: `ios mdm fetch-unlock-token`). + /// + /// Thrown when fails to make API call + /// + /// + /// Passphrase for the `.p12` identity. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (UnlockToken) + public async System.Threading.Tasks.Task> DevicesMdmFetchUnlockTokenWithHttpInfoAsync(string udid, Object p12, string? password = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesMdmFetchUnlockToken"); + + // verify the required parameter 'p12' is set + if (p12 == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'p12' when calling DefaultApi->DevicesMdmFetchUnlockToken"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.FormParameters.Add("p12", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(p12)); // form parameter + if (password != null) + { + localVarRequestOptions.FormParameters.Add("password", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(password)); // form parameter + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/mdm/fetch-unlock-token", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesMdmFetchUnlockToken", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get MDM security info (supervised) Get device security info (CLI: `ios mdm security-info`). + /// + /// Thrown when fails to make API call + /// + /// + /// Passphrase for the `.p12` identity. (optional) + /// Object + public Object DevicesMdmSecurityInfo(string udid, Object p12, string? password = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesMdmSecurityInfoWithHttpInfo(udid, p12, password); + return localVarResponse.Data; + } + + /// + /// Get MDM security info (supervised) Get device security info (CLI: `ios mdm security-info`). + /// + /// Thrown when fails to make API call + /// + /// + /// Passphrase for the `.p12` identity. (optional) + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse DevicesMdmSecurityInfoWithHttpInfo(string udid, Object p12, string? password = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesMdmSecurityInfo"); + + // verify the required parameter 'p12' is set + if (p12 == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'p12' when calling DefaultApi->DevicesMdmSecurityInfo"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.FormParameters.Add("p12", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(p12)); // form parameter + if (password != null) + { + localVarRequestOptions.FormParameters.Add("password", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(password)); // form parameter + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/mdm/security-info", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesMdmSecurityInfo", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get MDM security info (supervised) Get device security info (CLI: `ios mdm security-info`). + /// + /// Thrown when fails to make API call + /// + /// + /// Passphrase for the `.p12` identity. (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task DevicesMdmSecurityInfoAsync(string udid, Object p12, string? password = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesMdmSecurityInfoWithHttpInfoAsync(udid, p12, password, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get MDM security info (supervised) Get device security info (CLI: `ios mdm security-info`). + /// + /// Thrown when fails to make API call + /// + /// + /// Passphrase for the `.p12` identity. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> DevicesMdmSecurityInfoWithHttpInfoAsync(string udid, Object p12, string? password = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesMdmSecurityInfo"); + + // verify the required parameter 'p12' is set + if (p12 == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'p12' when calling DefaultApi->DevicesMdmSecurityInfo"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.FormParameters.Add("p12", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(p12)); // form parameter + if (password != null) + { + localVarRequestOptions.FormParameters.Add("password", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(password)); // form parameter + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/mdm/security-info", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesMdmSecurityInfo", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Waive memory limit Waive the memory limit for a process (CLI: `ios memlimitoff`). The process name may be given via the `process` query param or the JSON body. + /// + /// Thrown when fails to make API call + /// + /// Process name whose memory limit should be waived. (optional) + /// (optional) + /// MemLimitResult + public MemLimitResult DevicesMemLimitOff(string udid, string? process = default, MemLimitRequest? memLimitRequest = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesMemLimitOffWithHttpInfo(udid, process, memLimitRequest); + return localVarResponse.Data; + } + + /// + /// Waive memory limit Waive the memory limit for a process (CLI: `ios memlimitoff`). The process name may be given via the `process` query param or the JSON body. + /// + /// Thrown when fails to make API call + /// + /// Process name whose memory limit should be waived. (optional) + /// (optional) + /// ApiResponse of MemLimitResult + public GoIos.Sdk.Generated.Client.ApiResponse DevicesMemLimitOffWithHttpInfo(string udid, string? process = default, MemLimitRequest? memLimitRequest = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesMemLimitOff"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (process != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "process", process)); + } + localVarRequestOptions.Data = memLimitRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/memlimitoff", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesMemLimitOff", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Waive memory limit Waive the memory limit for a process (CLI: `ios memlimitoff`). The process name may be given via the `process` query param or the JSON body. + /// + /// Thrown when fails to make API call + /// + /// Process name whose memory limit should be waived. (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of MemLimitResult + public async System.Threading.Tasks.Task DevicesMemLimitOffAsync(string udid, string? process = default, MemLimitRequest? memLimitRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesMemLimitOffWithHttpInfoAsync(udid, process, memLimitRequest, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Waive memory limit Waive the memory limit for a process (CLI: `ios memlimitoff`). The process name may be given via the `process` query param or the JSON body. + /// + /// Thrown when fails to make API call + /// + /// Process name whose memory limit should be waived. (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (MemLimitResult) + public async System.Threading.Tasks.Task> DevicesMemLimitOffWithHttpInfoAsync(string udid, string? process = default, MemLimitRequest? memLimitRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesMemLimitOff"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (process != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "process", process)); + } + localVarRequestOptions.Data = memLimitRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/memlimitoff", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesMemLimitOff", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Mount a developer image Mount a Developer Disk Image. Either let the server auto-resolve and download the correct image (`auto=true`, optionally with `basedir`), or stream the image bytes as the raw request body (up to 2 GiB). + /// + /// Thrown when fails to make API call + /// + /// Auto-resolve and download the matching DDI for the device. (optional) + /// Base directory the server uses to cache/lookup DDIs when `auto=true`. (optional) + /// Raw Developer Disk Image bytes (used when not auto-resolving). Content up to 2 GiB. (optional) + /// GenericResponse + public GenericResponse DevicesMountImage(string udid, bool? auto = default, string? basedir = default, Object? body = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesMountImageWithHttpInfo(udid, auto, basedir, body); + return localVarResponse.Data; + } + + /// + /// Mount a developer image Mount a Developer Disk Image. Either let the server auto-resolve and download the correct image (`auto=true`, optionally with `basedir`), or stream the image bytes as the raw request body (up to 2 GiB). + /// + /// Thrown when fails to make API call + /// + /// Auto-resolve and download the matching DDI for the device. (optional) + /// Base directory the server uses to cache/lookup DDIs when `auto=true`. (optional) + /// Raw Developer Disk Image bytes (used when not auto-resolving). Content up to 2 GiB. (optional) + /// ApiResponse of GenericResponse + public GoIos.Sdk.Generated.Client.ApiResponse DevicesMountImageWithHttpInfo(string udid, bool? auto = default, string? basedir = default, Object? body = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesMountImage"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/octet-stream" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (auto != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "auto", auto)); + } + if (basedir != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "basedir", basedir)); + } + localVarRequestOptions.Data = body; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/api/v1/device/{udid}/image", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesMountImage", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Mount a developer image Mount a Developer Disk Image. Either let the server auto-resolve and download the correct image (`auto=true`, optionally with `basedir`), or stream the image bytes as the raw request body (up to 2 GiB). + /// + /// Thrown when fails to make API call + /// + /// Auto-resolve and download the matching DDI for the device. (optional) + /// Base directory the server uses to cache/lookup DDIs when `auto=true`. (optional) + /// Raw Developer Disk Image bytes (used when not auto-resolving). Content up to 2 GiB. (optional) + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + public async System.Threading.Tasks.Task DevicesMountImageAsync(string udid, bool? auto = default, string? basedir = default, Object? body = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesMountImageWithHttpInfoAsync(udid, auto, basedir, body, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Mount a developer image Mount a Developer Disk Image. Either let the server auto-resolve and download the correct image (`auto=true`, optionally with `basedir`), or stream the image bytes as the raw request body (up to 2 GiB). + /// + /// Thrown when fails to make API call + /// + /// Auto-resolve and download the matching DDI for the device. (optional) + /// Base directory the server uses to cache/lookup DDIs when `auto=true`. (optional) + /// Raw Developer Disk Image bytes (used when not auto-resolving). Content up to 2 GiB. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + public async System.Threading.Tasks.Task> DevicesMountImageWithHttpInfoAsync(string udid, bool? auto = default, string? basedir = default, Object? body = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesMountImage"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/octet-stream" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (auto != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "auto", auto)); + } + if (basedir != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "basedir", basedir)); + } + localVarRequestOptions.Data = body; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PutAsync("/api/v1/device/{udid}/image", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesMountImage", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Pair device Pair with the device. For a supervised pairing (`supervised=true`) upload the supervision identity as `p12file` (multipart) and supply the passphrase in the `Supervision-Password` header. Returns `423` when the device is locked and pairing cannot proceed. + /// + /// Thrown when fails to make API call + /// + /// Whether this is a supervised pairing. + /// + /// Supervision identity passphrase (required when supervised). (optional) + /// GenericResponse + public GenericResponse DevicesPair(string udid, bool supervised, Object p12file, string? supervisionPassword = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesPairWithHttpInfo(udid, supervised, p12file, supervisionPassword); + return localVarResponse.Data; + } + + /// + /// Pair device Pair with the device. For a supervised pairing (`supervised=true`) upload the supervision identity as `p12file` (multipart) and supply the passphrase in the `Supervision-Password` header. Returns `423` when the device is locked and pairing cannot proceed. + /// + /// Thrown when fails to make API call + /// + /// Whether this is a supervised pairing. + /// + /// Supervision identity passphrase (required when supervised). (optional) + /// ApiResponse of GenericResponse + public GoIos.Sdk.Generated.Client.ApiResponse DevicesPairWithHttpInfo(string udid, bool supervised, Object p12file, string? supervisionPassword = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesPair"); + + // verify the required parameter 'p12file' is set + if (p12file == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'p12file' when calling DefaultApi->DevicesPair"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "supervised", supervised)); + if (supervisionPassword != null) + { + localVarRequestOptions.HeaderParameters.Add("Supervision-Password", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(supervisionPassword)); // header parameter + } + localVarRequestOptions.FormParameters.Add("p12file", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(p12file)); // form parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/pair", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesPair", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Pair device Pair with the device. For a supervised pairing (`supervised=true`) upload the supervision identity as `p12file` (multipart) and supply the passphrase in the `Supervision-Password` header. Returns `423` when the device is locked and pairing cannot proceed. + /// + /// Thrown when fails to make API call + /// + /// Whether this is a supervised pairing. + /// + /// Supervision identity passphrase (required when supervised). (optional) + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + public async System.Threading.Tasks.Task DevicesPairAsync(string udid, bool supervised, Object p12file, string? supervisionPassword = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesPairWithHttpInfoAsync(udid, supervised, p12file, supervisionPassword, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Pair device Pair with the device. For a supervised pairing (`supervised=true`) upload the supervision identity as `p12file` (multipart) and supply the passphrase in the `Supervision-Password` header. Returns `423` when the device is locked and pairing cannot proceed. + /// + /// Thrown when fails to make API call + /// + /// Whether this is a supervised pairing. + /// + /// Supervision identity passphrase (required when supervised). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + public async System.Threading.Tasks.Task> DevicesPairWithHttpInfoAsync(string udid, bool supervised, Object p12file, string? supervisionPassword = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesPair"); + + // verify the required parameter 'p12file' is set + if (p12file == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'p12file' when calling DefaultApi->DevicesPair"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "supervised", supervised)); + if (supervisionPassword != null) + { + localVarRequestOptions.HeaderParameters.Add("Supervision-Password", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(supervisionPassword)); // header parameter + } + localVarRequestOptions.FormParameters.Add("p12file", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(p12file)); // form parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/pair", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesPair", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Pull file Download a file from the device, streamed as the response body (CLI: `ios file pull`). + /// + /// Thrown when fails to make API call + /// + /// File service domain: `app`, `app-group`, `crash` or `temp`. + /// Remote file path on the device. + /// Bundle/group id for the `app`/`app-group` domains. (optional) + /// Object + public Object DevicesPullFile(string udid, FileDomain domain, string remote, string? identifier = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesPullFileWithHttpInfo(udid, domain, remote, identifier); + return localVarResponse.Data; + } + + /// + /// Pull file Download a file from the device, streamed as the response body (CLI: `ios file pull`). + /// + /// Thrown when fails to make API call + /// + /// File service domain: `app`, `app-group`, `crash` or `temp`. + /// Remote file path on the device. + /// Bundle/group id for the `app`/`app-group` domains. (optional) + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse DevicesPullFileWithHttpInfo(string udid, FileDomain domain, string remote, string? identifier = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesPullFile"); + + // verify the required parameter 'domain' is set + if (domain == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'domain' when calling DefaultApi->DevicesPullFile"); + + // verify the required parameter 'remote' is set + if (remote == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'remote' when calling DefaultApi->DevicesPullFile"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/octet-stream", + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "domain", domain)); + if (identifier != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "identifier", identifier)); + } + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "remote", remote)); + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/files/pull", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesPullFile", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Pull file Download a file from the device, streamed as the response body (CLI: `ios file pull`). + /// + /// Thrown when fails to make API call + /// + /// File service domain: `app`, `app-group`, `crash` or `temp`. + /// Remote file path on the device. + /// Bundle/group id for the `app`/`app-group` domains. (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task DevicesPullFileAsync(string udid, FileDomain domain, string remote, string? identifier = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesPullFileWithHttpInfoAsync(udid, domain, remote, identifier, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Pull file Download a file from the device, streamed as the response body (CLI: `ios file pull`). + /// + /// Thrown when fails to make API call + /// + /// File service domain: `app`, `app-group`, `crash` or `temp`. + /// Remote file path on the device. + /// Bundle/group id for the `app`/`app-group` domains. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> DevicesPullFileWithHttpInfoAsync(string udid, FileDomain domain, string remote, string? identifier = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesPullFile"); + + // verify the required parameter 'domain' is set + if (domain == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'domain' when calling DefaultApi->DevicesPullFile"); + + // verify the required parameter 'remote' is set + if (remote == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'remote' when calling DefaultApi->DevicesPullFile"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/octet-stream", + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "domain", domain)); + if (identifier != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "identifier", identifier)); + } + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "remote", remote)); + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/files/pull", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesPullFile", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Push file Upload the request body to a device path (CLI: `ios file push`). A `Content-Length` header is required. + /// + /// Thrown when fails to make API call + /// + /// File service domain: `app`, `app-group`, `crash` or `temp`. + /// Destination path on the device. + /// Raw file bytes to upload. + /// Bundle/group id for the `app`/`app-group` domains. (optional) + /// FilePushResult + public FilePushResult DevicesPushFile(string udid, FileDomain domain, string remote, Object body, string? identifier = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesPushFileWithHttpInfo(udid, domain, remote, body, identifier); + return localVarResponse.Data; + } + + /// + /// Push file Upload the request body to a device path (CLI: `ios file push`). A `Content-Length` header is required. + /// + /// Thrown when fails to make API call + /// + /// File service domain: `app`, `app-group`, `crash` or `temp`. + /// Destination path on the device. + /// Raw file bytes to upload. + /// Bundle/group id for the `app`/`app-group` domains. (optional) + /// ApiResponse of FilePushResult + public GoIos.Sdk.Generated.Client.ApiResponse DevicesPushFileWithHttpInfo(string udid, FileDomain domain, string remote, Object body, string? identifier = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesPushFile"); + + // verify the required parameter 'domain' is set + if (domain == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'domain' when calling DefaultApi->DevicesPushFile"); + + // verify the required parameter 'remote' is set + if (remote == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'remote' when calling DefaultApi->DevicesPushFile"); + + // verify the required parameter 'body' is set + if (body == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'body' when calling DefaultApi->DevicesPushFile"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/octet-stream" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "domain", domain)); + if (identifier != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "identifier", identifier)); + } + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "remote", remote)); + localVarRequestOptions.Data = body; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/files/push", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesPushFile", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Push file Upload the request body to a device path (CLI: `ios file push`). A `Content-Length` header is required. + /// + /// Thrown when fails to make API call + /// + /// File service domain: `app`, `app-group`, `crash` or `temp`. + /// Destination path on the device. + /// Raw file bytes to upload. + /// Bundle/group id for the `app`/`app-group` domains. (optional) + /// Cancellation Token to cancel the request. + /// Task of FilePushResult + public async System.Threading.Tasks.Task DevicesPushFileAsync(string udid, FileDomain domain, string remote, Object body, string? identifier = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesPushFileWithHttpInfoAsync(udid, domain, remote, body, identifier, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Push file Upload the request body to a device path (CLI: `ios file push`). A `Content-Length` header is required. + /// + /// Thrown when fails to make API call + /// + /// File service domain: `app`, `app-group`, `crash` or `temp`. + /// Destination path on the device. + /// Raw file bytes to upload. + /// Bundle/group id for the `app`/`app-group` domains. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FilePushResult) + public async System.Threading.Tasks.Task> DevicesPushFileWithHttpInfoAsync(string udid, FileDomain domain, string remote, Object body, string? identifier = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesPushFile"); + + // verify the required parameter 'domain' is set + if (domain == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'domain' when calling DefaultApi->DevicesPushFile"); + + // verify the required parameter 'remote' is set + if (remote == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'remote' when calling DefaultApi->DevicesPushFile"); + + // verify the required parameter 'body' is set + if (body == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'body' when calling DefaultApi->DevicesPushFile"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/octet-stream" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "domain", domain)); + if (identifier != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "identifier", identifier)); + } + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "remote", remote)); + localVarRequestOptions.Data = body; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/files/push", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesPushFile", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Reboot device Reboot the device (CLI: `ios reboot`). + /// + /// Thrown when fails to make API call + /// + /// GenericResponse + public GenericResponse DevicesReboot(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesRebootWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Reboot device Reboot the device (CLI: `ios reboot`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of GenericResponse + public GoIos.Sdk.Generated.Client.ApiResponse DevicesRebootWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesReboot"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/reboot", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesReboot", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Reboot device Reboot the device (CLI: `ios reboot`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + public async System.Threading.Tasks.Task DevicesRebootAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesRebootWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Reboot device Reboot the device (CLI: `ios reboot`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + public async System.Threading.Tasks.Task> DevicesRebootWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesReboot"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/reboot", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesReboot", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Delete crash reports Delete crash reports (CLI: `ios crash rm`). + /// + /// Thrown when fails to make API call + /// + /// Working directory on the device. + /// Glob pattern of reports to delete. + /// GenericResponse + public GenericResponse DevicesRemoveCrashes(string udid, string cwd, string pattern) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesRemoveCrashesWithHttpInfo(udid, cwd, pattern); + return localVarResponse.Data; + } + + /// + /// Delete crash reports Delete crash reports (CLI: `ios crash rm`). + /// + /// Thrown when fails to make API call + /// + /// Working directory on the device. + /// Glob pattern of reports to delete. + /// ApiResponse of GenericResponse + public GoIos.Sdk.Generated.Client.ApiResponse DevicesRemoveCrashesWithHttpInfo(string udid, string cwd, string pattern) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesRemoveCrashes"); + + // verify the required parameter 'cwd' is set + if (cwd == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'cwd' when calling DefaultApi->DevicesRemoveCrashes"); + + // verify the required parameter 'pattern' is set + if (pattern == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'pattern' when calling DefaultApi->DevicesRemoveCrashes"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "cwd", cwd)); + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "pattern", pattern)); + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Delete("/api/v1/device/{udid}/crashes", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesRemoveCrashes", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Delete crash reports Delete crash reports (CLI: `ios crash rm`). + /// + /// Thrown when fails to make API call + /// + /// Working directory on the device. + /// Glob pattern of reports to delete. + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + public async System.Threading.Tasks.Task DevicesRemoveCrashesAsync(string udid, string cwd, string pattern, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesRemoveCrashesWithHttpInfoAsync(udid, cwd, pattern, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Delete crash reports Delete crash reports (CLI: `ios crash rm`). + /// + /// Thrown when fails to make API call + /// + /// Working directory on the device. + /// Glob pattern of reports to delete. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + public async System.Threading.Tasks.Task> DevicesRemoveCrashesWithHttpInfoAsync(string udid, string cwd, string pattern, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesRemoveCrashes"); + + // verify the required parameter 'cwd' is set + if (cwd == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'cwd' when calling DefaultApi->DevicesRemoveCrashes"); + + // verify the required parameter 'pattern' is set + if (pattern == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'pattern' when calling DefaultApi->DevicesRemoveCrashes"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "cwd", cwd)); + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "pattern", pattern)); + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/api/v1/device/{udid}/crashes", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesRemoveCrashes", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Remove HTTP proxy Clear the global HTTP proxy (CLI: `ios httpproxy remove`). + /// + /// Thrown when fails to make API call + /// + /// GenericResponse + public GenericResponse DevicesRemoveHttpProxy(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesRemoveHttpProxyWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Remove HTTP proxy Clear the global HTTP proxy (CLI: `ios httpproxy remove`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of GenericResponse + public GoIos.Sdk.Generated.Client.ApiResponse DevicesRemoveHttpProxyWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesRemoveHttpProxy"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Delete("/api/v1/device/{udid}/httpproxy", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesRemoveHttpProxy", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Remove HTTP proxy Clear the global HTTP proxy (CLI: `ios httpproxy remove`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + public async System.Threading.Tasks.Task DevicesRemoveHttpProxyAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesRemoveHttpProxyWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Remove HTTP proxy Clear the global HTTP proxy (CLI: `ios httpproxy remove`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + public async System.Threading.Tasks.Task> DevicesRemoveHttpProxyWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesRemoveHttpProxy"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/api/v1/device/{udid}/httpproxy", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesRemoveHttpProxy", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Remove profile Remove a configuration profile by identifier (CLI: `ios profile remove`). + /// + /// Thrown when fails to make API call + /// + /// The profile identifier to remove. + /// GenericResponse + public GenericResponse DevicesRemoveProfile(string udid, string name) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesRemoveProfileWithHttpInfo(udid, name); + return localVarResponse.Data; + } + + /// + /// Remove profile Remove a configuration profile by identifier (CLI: `ios profile remove`). + /// + /// Thrown when fails to make API call + /// + /// The profile identifier to remove. + /// ApiResponse of GenericResponse + public GoIos.Sdk.Generated.Client.ApiResponse DevicesRemoveProfileWithHttpInfo(string udid, string name) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesRemoveProfile"); + + // verify the required parameter 'name' is set + if (name == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'name' when calling DefaultApi->DevicesRemoveProfile"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.PathParameters.Add("name", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(name)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Delete("/api/v1/device/{udid}/profiles/{name}", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesRemoveProfile", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Remove profile Remove a configuration profile by identifier (CLI: `ios profile remove`). + /// + /// Thrown when fails to make API call + /// + /// The profile identifier to remove. + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + public async System.Threading.Tasks.Task DevicesRemoveProfileAsync(string udid, string name, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesRemoveProfileWithHttpInfoAsync(udid, name, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Remove profile Remove a configuration profile by identifier (CLI: `ios profile remove`). + /// + /// Thrown when fails to make API call + /// + /// The profile identifier to remove. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + public async System.Threading.Tasks.Task> DevicesRemoveProfileWithHttpInfoAsync(string udid, string name, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesRemoveProfile"); + + // verify the required parameter 'name' is set + if (name == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'name' when calling DefaultApi->DevicesRemoveProfile"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.PathParameters.Add("name", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(name)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/api/v1/device/{udid}/profiles/{name}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesRemoveProfile", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Remove wifi Remove a provisioned wifi network (CLI: `ios wifi - -remove`). + /// + /// Thrown when fails to make API call + /// + /// SSID of the network to remove. + /// GenericResponse + public GenericResponse DevicesRemoveWifi(string udid, string ssid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesRemoveWifiWithHttpInfo(udid, ssid); + return localVarResponse.Data; + } + + /// + /// Remove wifi Remove a provisioned wifi network (CLI: `ios wifi - -remove`). + /// + /// Thrown when fails to make API call + /// + /// SSID of the network to remove. + /// ApiResponse of GenericResponse + public GoIos.Sdk.Generated.Client.ApiResponse DevicesRemoveWifiWithHttpInfo(string udid, string ssid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesRemoveWifi"); + + // verify the required parameter 'ssid' is set + if (ssid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'ssid' when calling DefaultApi->DevicesRemoveWifi"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "ssid", ssid)); + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Delete("/api/v1/device/{udid}/wifi", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesRemoveWifi", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Remove wifi Remove a provisioned wifi network (CLI: `ios wifi - -remove`). + /// + /// Thrown when fails to make API call + /// + /// SSID of the network to remove. + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + public async System.Threading.Tasks.Task DevicesRemoveWifiAsync(string udid, string ssid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesRemoveWifiWithHttpInfoAsync(udid, ssid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Remove wifi Remove a provisioned wifi network (CLI: `ios wifi - -remove`). + /// + /// Thrown when fails to make API call + /// + /// SSID of the network to remove. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + public async System.Threading.Tasks.Task> DevicesRemoveWifiWithHttpInfoAsync(string udid, string ssid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesRemoveWifi"); + + // verify the required parameter 'ssid' is set + if (ssid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'ssid' when calling DefaultApi->DevicesRemoveWifi"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "ssid", ssid)); + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/api/v1/device/{udid}/wifi", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesRemoveWifi", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Reset accessibility Reset accessibility settings on the device. + /// + /// Thrown when fails to make API call + /// + /// GenericResponse + public GenericResponse DevicesResetAccessibility(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesResetAccessibilityWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Reset accessibility Reset accessibility settings on the device. + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of GenericResponse + public GoIos.Sdk.Generated.Client.ApiResponse DevicesResetAccessibilityWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesResetAccessibility"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/resetaccessibility", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesResetAccessibility", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Reset accessibility Reset accessibility settings on the device. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + public async System.Threading.Tasks.Task DevicesResetAccessibilityAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesResetAccessibilityWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Reset accessibility Reset accessibility settings on the device. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + public async System.Threading.Tasks.Task> DevicesResetAccessibilityWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesResetAccessibility"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/resetaccessibility", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesResetAccessibility", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Reset simulated location Reset the simulated location back to the device's real GPS location. + /// + /// Thrown when fails to make API call + /// + /// GenericResponse + public GenericResponse DevicesResetLocation(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesResetLocationWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Reset simulated location Reset the simulated location back to the device's real GPS location. + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of GenericResponse + public GoIos.Sdk.Generated.Client.ApiResponse DevicesResetLocationWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesResetLocation"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/resetlocation", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesResetLocation", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Reset simulated location Reset the simulated location back to the device's real GPS location. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + public async System.Threading.Tasks.Task DevicesResetLocationAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesResetLocationWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Reset simulated location Reset the simulated location back to the device's real GPS location. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + public async System.Threading.Tasks.Task> DevicesResetLocationWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesResetLocation"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/resetlocation", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesResetLocation", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Capture screenshot Capture a screenshot. Returns raw PNG bytes (`image/png`). + /// + /// Thrown when fails to make API call + /// + /// Object + public Object DevicesScreenshot(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesScreenshotWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Capture screenshot Capture a screenshot. Returns raw PNG bytes (`image/png`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse DevicesScreenshotWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesScreenshot"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "image/png", + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/screenshot", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesScreenshot", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Capture screenshot Capture a screenshot. Returns raw PNG bytes (`image/png`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task DevicesScreenshotAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesScreenshotWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Capture screenshot Capture a screenshot. Returns raw PNG bytes (`image/png`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> DevicesScreenshotWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesScreenshot"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "image/png", + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/screenshot", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesScreenshot", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Set AssistiveTouch Enable/disable AssistiveTouch (CLI: `ios assistivetouch enable|disable`). + /// + /// Thrown when fails to make API call + /// + /// + /// AssistiveTouchState + public AssistiveTouchState DevicesSetAssistiveTouch(string udid, EnabledRequest enabledRequest) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesSetAssistiveTouchWithHttpInfo(udid, enabledRequest); + return localVarResponse.Data; + } + + /// + /// Set AssistiveTouch Enable/disable AssistiveTouch (CLI: `ios assistivetouch enable|disable`). + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of AssistiveTouchState + public GoIos.Sdk.Generated.Client.ApiResponse DevicesSetAssistiveTouchWithHttpInfo(string udid, EnabledRequest enabledRequest) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesSetAssistiveTouch"); + + // verify the required parameter 'enabledRequest' is set + if (enabledRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'enabledRequest' when calling DefaultApi->DevicesSetAssistiveTouch"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.Data = enabledRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/api/v1/device/{udid}/assistivetouch", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesSetAssistiveTouch", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Set AssistiveTouch Enable/disable AssistiveTouch (CLI: `ios assistivetouch enable|disable`). + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of AssistiveTouchState + public async System.Threading.Tasks.Task DevicesSetAssistiveTouchAsync(string udid, EnabledRequest enabledRequest, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesSetAssistiveTouchWithHttpInfoAsync(udid, enabledRequest, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Set AssistiveTouch Enable/disable AssistiveTouch (CLI: `ios assistivetouch enable|disable`). + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (AssistiveTouchState) + public async System.Threading.Tasks.Task> DevicesSetAssistiveTouchWithHttpInfoAsync(string udid, EnabledRequest enabledRequest, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesSetAssistiveTouch"); + + // verify the required parameter 'enabledRequest' is set + if (enabledRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'enabledRequest' when calling DefaultApi->DevicesSetAssistiveTouch"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.Data = enabledRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PutAsync("/api/v1/device/{udid}/assistivetouch", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesSetAssistiveTouch", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Set developer mode Enable or reveal developer mode (CLI: `ios devmode enable|reveal`). + /// + /// Thrown when fails to make API call + /// + /// + /// GenericResponse + public GenericResponse DevicesSetDevMode(string udid, DevModeRequest devModeRequest) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesSetDevModeWithHttpInfo(udid, devModeRequest); + return localVarResponse.Data; + } + + /// + /// Set developer mode Enable or reveal developer mode (CLI: `ios devmode enable|reveal`). + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of GenericResponse + public GoIos.Sdk.Generated.Client.ApiResponse DevicesSetDevModeWithHttpInfo(string udid, DevModeRequest devModeRequest) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesSetDevMode"); + + // verify the required parameter 'devModeRequest' is set + if (devModeRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'devModeRequest' when calling DefaultApi->DevicesSetDevMode"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.Data = devModeRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/devmode", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesSetDevMode", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Set developer mode Enable or reveal developer mode (CLI: `ios devmode enable|reveal`). + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + public async System.Threading.Tasks.Task DevicesSetDevModeAsync(string udid, DevModeRequest devModeRequest, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesSetDevModeWithHttpInfoAsync(udid, devModeRequest, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Set developer mode Enable or reveal developer mode (CLI: `ios devmode enable|reveal`). + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + public async System.Threading.Tasks.Task> DevicesSetDevModeWithHttpInfoAsync(string udid, DevModeRequest devModeRequest, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesSetDevMode"); + + // verify the required parameter 'devModeRequest' is set + if (devModeRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'devModeRequest' when calling DefaultApi->DevicesSetDevMode"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.Data = devModeRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/devmode", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesSetDevMode", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Set HTTP proxy (supervised) Configure a global HTTP proxy (CLI: `ios httpproxy`). Supervised: send multipart form-data with `host`, `port`, a `p12` supervisor identity and optional `user`/`pass`/`password` fields. + /// + /// Thrown when fails to make API call + /// + /// Proxy host. + /// Proxy port. + /// + /// Proxy username. (optional) + /// Proxy password. (optional) + /// Passphrase for the `.p12` identity. (optional) + /// GenericResponse + public GenericResponse DevicesSetHttpProxy(string udid, string host, string port, Object p12, string? user = default, string? pass = default, string? password = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesSetHttpProxyWithHttpInfo(udid, host, port, p12, user, pass, password); + return localVarResponse.Data; + } + + /// + /// Set HTTP proxy (supervised) Configure a global HTTP proxy (CLI: `ios httpproxy`). Supervised: send multipart form-data with `host`, `port`, a `p12` supervisor identity and optional `user`/`pass`/`password` fields. + /// + /// Thrown when fails to make API call + /// + /// Proxy host. + /// Proxy port. + /// + /// Proxy username. (optional) + /// Proxy password. (optional) + /// Passphrase for the `.p12` identity. (optional) + /// ApiResponse of GenericResponse + public GoIos.Sdk.Generated.Client.ApiResponse DevicesSetHttpProxyWithHttpInfo(string udid, string host, string port, Object p12, string? user = default, string? pass = default, string? password = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesSetHttpProxy"); + + // verify the required parameter 'host' is set + if (host == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'host' when calling DefaultApi->DevicesSetHttpProxy"); + + // verify the required parameter 'port' is set + if (port == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'port' when calling DefaultApi->DevicesSetHttpProxy"); + + // verify the required parameter 'p12' is set + if (p12 == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'p12' when calling DefaultApi->DevicesSetHttpProxy"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.FormParameters.Add("host", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(host)); // form parameter + localVarRequestOptions.FormParameters.Add("port", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(port)); // form parameter + localVarRequestOptions.FormParameters.Add("p12", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(p12)); // form parameter + if (user != null) + { + localVarRequestOptions.FormParameters.Add("user", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(user)); // form parameter + } + if (pass != null) + { + localVarRequestOptions.FormParameters.Add("pass", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(pass)); // form parameter + } + if (password != null) + { + localVarRequestOptions.FormParameters.Add("password", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(password)); // form parameter + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/api/v1/device/{udid}/httpproxy", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesSetHttpProxy", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Set HTTP proxy (supervised) Configure a global HTTP proxy (CLI: `ios httpproxy`). Supervised: send multipart form-data with `host`, `port`, a `p12` supervisor identity and optional `user`/`pass`/`password` fields. + /// + /// Thrown when fails to make API call + /// + /// Proxy host. + /// Proxy port. + /// + /// Proxy username. (optional) + /// Proxy password. (optional) + /// Passphrase for the `.p12` identity. (optional) + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + public async System.Threading.Tasks.Task DevicesSetHttpProxyAsync(string udid, string host, string port, Object p12, string? user = default, string? pass = default, string? password = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesSetHttpProxyWithHttpInfoAsync(udid, host, port, p12, user, pass, password, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Set HTTP proxy (supervised) Configure a global HTTP proxy (CLI: `ios httpproxy`). Supervised: send multipart form-data with `host`, `port`, a `p12` supervisor identity and optional `user`/`pass`/`password` fields. + /// + /// Thrown when fails to make API call + /// + /// Proxy host. + /// Proxy port. + /// + /// Proxy username. (optional) + /// Proxy password. (optional) + /// Passphrase for the `.p12` identity. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + public async System.Threading.Tasks.Task> DevicesSetHttpProxyWithHttpInfoAsync(string udid, string host, string port, Object p12, string? user = default, string? pass = default, string? password = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesSetHttpProxy"); + + // verify the required parameter 'host' is set + if (host == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'host' when calling DefaultApi->DevicesSetHttpProxy"); + + // verify the required parameter 'port' is set + if (port == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'port' when calling DefaultApi->DevicesSetHttpProxy"); + + // verify the required parameter 'p12' is set + if (p12 == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'p12' when calling DefaultApi->DevicesSetHttpProxy"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.FormParameters.Add("host", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(host)); // form parameter + localVarRequestOptions.FormParameters.Add("port", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(port)); // form parameter + localVarRequestOptions.FormParameters.Add("p12", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(p12)); // form parameter + if (user != null) + { + localVarRequestOptions.FormParameters.Add("user", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(user)); // form parameter + } + if (pass != null) + { + localVarRequestOptions.FormParameters.Add("pass", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(pass)); // form parameter + } + if (password != null) + { + localVarRequestOptions.FormParameters.Add("password", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(password)); // form parameter + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PutAsync("/api/v1/device/{udid}/httpproxy", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesSetHttpProxy", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Set icon layout Restore a SpringBoard icon layout (CLI: `ios set-icon-layout`). Body is the layout JSON as returned by GET. + /// + /// Thrown when fails to make API call + /// + /// + /// GenericResponse + public GenericResponse DevicesSetIconLayout(string udid, Object body) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesSetIconLayoutWithHttpInfo(udid, body); + return localVarResponse.Data; + } + + /// + /// Set icon layout Restore a SpringBoard icon layout (CLI: `ios set-icon-layout`). Body is the layout JSON as returned by GET. + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of GenericResponse + public GoIos.Sdk.Generated.Client.ApiResponse DevicesSetIconLayoutWithHttpInfo(string udid, Object body) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesSetIconLayout"); + + // verify the required parameter 'body' is set + if (body == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'body' when calling DefaultApi->DevicesSetIconLayout"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.Data = body; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/api/v1/device/{udid}/icon-layout", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesSetIconLayout", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Set icon layout Restore a SpringBoard icon layout (CLI: `ios set-icon-layout`). Body is the layout JSON as returned by GET. + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + public async System.Threading.Tasks.Task DevicesSetIconLayoutAsync(string udid, Object body, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesSetIconLayoutWithHttpInfoAsync(udid, body, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Set icon layout Restore a SpringBoard icon layout (CLI: `ios set-icon-layout`). Body is the layout JSON as returned by GET. + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + public async System.Threading.Tasks.Task> DevicesSetIconLayoutWithHttpInfoAsync(string udid, Object body, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesSetIconLayout"); + + // verify the required parameter 'body' is set + if (body == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'body' when calling DefaultApi->DevicesSetIconLayout"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.Data = body; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PutAsync("/api/v1/device/{udid}/icon-layout", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesSetIconLayout", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Set language Set the device language and/or locale (CLI: `ios lang - -setlang - -setlocale`). Returns the resulting configuration. + /// + /// Thrown when fails to make API call + /// + /// + /// LanguageConfiguration + public LanguageConfiguration DevicesSetLanguage(string udid, SetLanguageRequest setLanguageRequest) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesSetLanguageWithHttpInfo(udid, setLanguageRequest); + return localVarResponse.Data; + } + + /// + /// Set language Set the device language and/or locale (CLI: `ios lang - -setlang - -setlocale`). Returns the resulting configuration. + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of LanguageConfiguration + public GoIos.Sdk.Generated.Client.ApiResponse DevicesSetLanguageWithHttpInfo(string udid, SetLanguageRequest setLanguageRequest) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesSetLanguage"); + + // verify the required parameter 'setLanguageRequest' is set + if (setLanguageRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'setLanguageRequest' when calling DefaultApi->DevicesSetLanguage"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.Data = setLanguageRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/api/v1/device/{udid}/lang", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesSetLanguage", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Set language Set the device language and/or locale (CLI: `ios lang - -setlang - -setlocale`). Returns the resulting configuration. + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of LanguageConfiguration + public async System.Threading.Tasks.Task DevicesSetLanguageAsync(string udid, SetLanguageRequest setLanguageRequest, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesSetLanguageWithHttpInfoAsync(udid, setLanguageRequest, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Set language Set the device language and/or locale (CLI: `ios lang - -setlang - -setlocale`). Returns the resulting configuration. + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (LanguageConfiguration) + public async System.Threading.Tasks.Task> DevicesSetLanguageWithHttpInfoAsync(string udid, SetLanguageRequest setLanguageRequest, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesSetLanguage"); + + // verify the required parameter 'setLanguageRequest' is set + if (setLanguageRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'setLanguageRequest' when calling DefaultApi->DevicesSetLanguage"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.Data = setLanguageRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PutAsync("/api/v1/device/{udid}/lang", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesSetLanguage", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Set simulated location Simulate a GPS location on the device. NOTE: the longitude parameter was historically misspelled `longtitude` on the wire. This spec fixes it to `longitude`; the go-ios server accepts `longitude` (and may keep `longtitude` as a deprecated alias). + /// + /// Thrown when fails to make API call + /// + /// Latitude in decimal degrees. + /// Longitude in decimal degrees. + /// GenericResponse + public GenericResponse DevicesSetLocation(string udid, string latitude, string longitude) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesSetLocationWithHttpInfo(udid, latitude, longitude); + return localVarResponse.Data; + } + + /// + /// Set simulated location Simulate a GPS location on the device. NOTE: the longitude parameter was historically misspelled `longtitude` on the wire. This spec fixes it to `longitude`; the go-ios server accepts `longitude` (and may keep `longtitude` as a deprecated alias). + /// + /// Thrown when fails to make API call + /// + /// Latitude in decimal degrees. + /// Longitude in decimal degrees. + /// ApiResponse of GenericResponse + public GoIos.Sdk.Generated.Client.ApiResponse DevicesSetLocationWithHttpInfo(string udid, string latitude, string longitude) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesSetLocation"); + + // verify the required parameter 'latitude' is set + if (latitude == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'latitude' when calling DefaultApi->DevicesSetLocation"); + + // verify the required parameter 'longitude' is set + if (longitude == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'longitude' when calling DefaultApi->DevicesSetLocation"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "latitude", latitude)); + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "longitude", longitude)); + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/api/v1/device/{udid}/setlocation", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesSetLocation", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Set simulated location Simulate a GPS location on the device. NOTE: the longitude parameter was historically misspelled `longtitude` on the wire. This spec fixes it to `longitude`; the go-ios server accepts `longitude` (and may keep `longtitude` as a deprecated alias). + /// + /// Thrown when fails to make API call + /// + /// Latitude in decimal degrees. + /// Longitude in decimal degrees. + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + public async System.Threading.Tasks.Task DevicesSetLocationAsync(string udid, string latitude, string longitude, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesSetLocationWithHttpInfoAsync(udid, latitude, longitude, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Set simulated location Simulate a GPS location on the device. NOTE: the longitude parameter was historically misspelled `longtitude` on the wire. This spec fixes it to `longitude`; the go-ios server accepts `longitude` (and may keep `longtitude` as a deprecated alias). + /// + /// Thrown when fails to make API call + /// + /// Latitude in decimal degrees. + /// Longitude in decimal degrees. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + public async System.Threading.Tasks.Task> DevicesSetLocationWithHttpInfoAsync(string udid, string latitude, string longitude, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesSetLocation"); + + // verify the required parameter 'latitude' is set + if (latitude == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'latitude' when calling DefaultApi->DevicesSetLocation"); + + // verify the required parameter 'longitude' is set + if (longitude == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'longitude' when calling DefaultApi->DevicesSetLocation"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "latitude", latitude)); + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "longitude", longitude)); + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PutAsync("/api/v1/device/{udid}/setlocation", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesSetLocation", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Set pasteboard Set the pasteboard text from the raw request body (CLI: `ios pasteboard set`). + /// + /// Thrown when fails to make API call + /// + /// + /// GenericResponse + public GenericResponse DevicesSetPasteboard(string udid, string body) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesSetPasteboardWithHttpInfo(udid, body); + return localVarResponse.Data; + } + + /// + /// Set pasteboard Set the pasteboard text from the raw request body (CLI: `ios pasteboard set`). + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of GenericResponse + public GoIos.Sdk.Generated.Client.ApiResponse DevicesSetPasteboardWithHttpInfo(string udid, string body) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesSetPasteboard"); + + // verify the required parameter 'body' is set + if (body == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'body' when calling DefaultApi->DevicesSetPasteboard"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "text/plain" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.Data = body; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/api/v1/device/{udid}/pasteboard", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesSetPasteboard", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Set pasteboard Set the pasteboard text from the raw request body (CLI: `ios pasteboard set`). + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + public async System.Threading.Tasks.Task DevicesSetPasteboardAsync(string udid, string body, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesSetPasteboardWithHttpInfoAsync(udid, body, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Set pasteboard Set the pasteboard text from the raw request body (CLI: `ios pasteboard set`). + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + public async System.Threading.Tasks.Task> DevicesSetPasteboardWithHttpInfoAsync(string udid, string body, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesSetPasteboard"); + + // verify the required parameter 'body' is set + if (body == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'body' when calling DefaultApi->DevicesSetPasteboard"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "text/plain" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.Data = body; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PutAsync("/api/v1/device/{udid}/pasteboard", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesSetPasteboard", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Set time format Set 24-hour / 12-hour clock (CLI: `ios timeformat 24h|12h`). + /// + /// Thrown when fails to make API call + /// + /// + /// TimeFormatState + public TimeFormatState DevicesSetTimeFormat(string udid, TimeFormatRequest timeFormatRequest) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesSetTimeFormatWithHttpInfo(udid, timeFormatRequest); + return localVarResponse.Data; + } + + /// + /// Set time format Set 24-hour / 12-hour clock (CLI: `ios timeformat 24h|12h`). + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of TimeFormatState + public GoIos.Sdk.Generated.Client.ApiResponse DevicesSetTimeFormatWithHttpInfo(string udid, TimeFormatRequest timeFormatRequest) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesSetTimeFormat"); + + // verify the required parameter 'timeFormatRequest' is set + if (timeFormatRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'timeFormatRequest' when calling DefaultApi->DevicesSetTimeFormat"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.Data = timeFormatRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/api/v1/device/{udid}/timeformat", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesSetTimeFormat", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Set time format Set 24-hour / 12-hour clock (CLI: `ios timeformat 24h|12h`). + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of TimeFormatState + public async System.Threading.Tasks.Task DevicesSetTimeFormatAsync(string udid, TimeFormatRequest timeFormatRequest, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesSetTimeFormatWithHttpInfoAsync(udid, timeFormatRequest, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Set time format Set 24-hour / 12-hour clock (CLI: `ios timeformat 24h|12h`). + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (TimeFormatState) + public async System.Threading.Tasks.Task> DevicesSetTimeFormatWithHttpInfoAsync(string udid, TimeFormatRequest timeFormatRequest, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesSetTimeFormat"); + + // verify the required parameter 'timeFormatRequest' is set + if (timeFormatRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'timeFormatRequest' when calling DefaultApi->DevicesSetTimeFormat"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.Data = timeFormatRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PutAsync("/api/v1/device/{udid}/timeformat", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesSetTimeFormat", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Set wallpaper (supervised) Set the wallpaper (CLI: `ios set-wallpaper`). Supervised: upload the image and a `.p12` supervisor identity as multipart form-data. + /// + /// Thrown when fails to make API call + /// + /// + /// + /// Passphrase for the `.p12` identity. (optional) + /// Target screen (`home`, `lock`, `both`). (optional) + /// GenericResponse + public GenericResponse DevicesSetWallpaper(string udid, Object image, Object p12, string? password = default, string? screen = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesSetWallpaperWithHttpInfo(udid, image, p12, password, screen); + return localVarResponse.Data; + } + + /// + /// Set wallpaper (supervised) Set the wallpaper (CLI: `ios set-wallpaper`). Supervised: upload the image and a `.p12` supervisor identity as multipart form-data. + /// + /// Thrown when fails to make API call + /// + /// + /// + /// Passphrase for the `.p12` identity. (optional) + /// Target screen (`home`, `lock`, `both`). (optional) + /// ApiResponse of GenericResponse + public GoIos.Sdk.Generated.Client.ApiResponse DevicesSetWallpaperWithHttpInfo(string udid, Object image, Object p12, string? password = default, string? screen = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesSetWallpaper"); + + // verify the required parameter 'image' is set + if (image == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'image' when calling DefaultApi->DevicesSetWallpaper"); + + // verify the required parameter 'p12' is set + if (p12 == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'p12' when calling DefaultApi->DevicesSetWallpaper"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.FormParameters.Add("image", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(image)); // form parameter + localVarRequestOptions.FormParameters.Add("p12", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(p12)); // form parameter + if (password != null) + { + localVarRequestOptions.FormParameters.Add("password", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(password)); // form parameter + } + if (screen != null) + { + localVarRequestOptions.FormParameters.Add("screen", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(screen)); // form parameter + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/api/v1/device/{udid}/wallpaper", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesSetWallpaper", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Set wallpaper (supervised) Set the wallpaper (CLI: `ios set-wallpaper`). Supervised: upload the image and a `.p12` supervisor identity as multipart form-data. + /// + /// Thrown when fails to make API call + /// + /// + /// + /// Passphrase for the `.p12` identity. (optional) + /// Target screen (`home`, `lock`, `both`). (optional) + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + public async System.Threading.Tasks.Task DevicesSetWallpaperAsync(string udid, Object image, Object p12, string? password = default, string? screen = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesSetWallpaperWithHttpInfoAsync(udid, image, p12, password, screen, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Set wallpaper (supervised) Set the wallpaper (CLI: `ios set-wallpaper`). Supervised: upload the image and a `.p12` supervisor identity as multipart form-data. + /// + /// Thrown when fails to make API call + /// + /// + /// + /// Passphrase for the `.p12` identity. (optional) + /// Target screen (`home`, `lock`, `both`). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + public async System.Threading.Tasks.Task> DevicesSetWallpaperWithHttpInfoAsync(string udid, Object image, Object p12, string? password = default, string? screen = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesSetWallpaper"); + + // verify the required parameter 'image' is set + if (image == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'image' when calling DefaultApi->DevicesSetWallpaper"); + + // verify the required parameter 'p12' is set + if (p12 == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'p12' when calling DefaultApi->DevicesSetWallpaper"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.FormParameters.Add("image", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(image)); // form parameter + localVarRequestOptions.FormParameters.Add("p12", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(p12)); // form parameter + if (password != null) + { + localVarRequestOptions.FormParameters.Add("password", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(password)); // form parameter + } + if (screen != null) + { + localVarRequestOptions.FormParameters.Add("screen", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(screen)); // form parameter + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PutAsync("/api/v1/device/{udid}/wallpaper", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesSetWallpaper", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Provision wifi Provision a wifi network (CLI: `ios wifi`). + /// + /// Thrown when fails to make API call + /// + /// + /// GenericResponse + public GenericResponse DevicesSetWifi(string udid, WifiRequest wifiRequest) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesSetWifiWithHttpInfo(udid, wifiRequest); + return localVarResponse.Data; + } + + /// + /// Provision wifi Provision a wifi network (CLI: `ios wifi`). + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of GenericResponse + public GoIos.Sdk.Generated.Client.ApiResponse DevicesSetWifiWithHttpInfo(string udid, WifiRequest wifiRequest) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesSetWifi"); + + // verify the required parameter 'wifiRequest' is set + if (wifiRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'wifiRequest' when calling DefaultApi->DevicesSetWifi"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.Data = wifiRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/api/v1/device/{udid}/wifi", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesSetWifi", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Provision wifi Provision a wifi network (CLI: `ios wifi`). + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + public async System.Threading.Tasks.Task DevicesSetWifiAsync(string udid, WifiRequest wifiRequest, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesSetWifiWithHttpInfoAsync(udid, wifiRequest, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Provision wifi Provision a wifi network (CLI: `ios wifi`). + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + public async System.Threading.Tasks.Task> DevicesSetWifiWithHttpInfoAsync(string udid, WifiRequest wifiRequest, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesSetWifi"); + + // verify the required parameter 'wifiRequest' is set + if (wifiRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'wifiRequest' when calling DefaultApi->DevicesSetWifi"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.Data = wifiRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PutAsync("/api/v1/device/{udid}/wifi", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesSetWifi", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Shut down device Shut down the device (CLI: `ios shutdown`). + /// + /// Thrown when fails to make API call + /// + /// GenericResponse + public GenericResponse DevicesShutdown(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesShutdownWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Shut down device Shut down the device (CLI: `ios shutdown`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of GenericResponse + public GoIos.Sdk.Generated.Client.ApiResponse DevicesShutdownWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesShutdown"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/shutdown", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesShutdown", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Shut down device Shut down the device (CLI: `ios shutdown`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + public async System.Threading.Tasks.Task DevicesShutdownAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesShutdownWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Shut down device Shut down the device (CLI: `ios shutdown`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + public async System.Threading.Tasks.Task> DevicesShutdownWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesShutdown"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/shutdown", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesShutdown", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Start port forward (job) Start a TCP port forward host→device as an async job (CLI: `ios forward`). + /// + /// Thrown when fails to make API call + /// + /// + /// Job + public Job DevicesStartForward(string udid, ForwardRequest forwardRequest) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesStartForwardWithHttpInfo(udid, forwardRequest); + return localVarResponse.Data; + } + + /// + /// Start port forward (job) Start a TCP port forward host→device as an async job (CLI: `ios forward`). + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Job + public GoIos.Sdk.Generated.Client.ApiResponse DevicesStartForwardWithHttpInfo(string udid, ForwardRequest forwardRequest) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesStartForward"); + + // verify the required parameter 'forwardRequest' is set + if (forwardRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'forwardRequest' when calling DefaultApi->DevicesStartForward"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.Data = forwardRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/jobs/forward", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesStartForward", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Start port forward (job) Start a TCP port forward host→device as an async job (CLI: `ios forward`). + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of Job + public async System.Threading.Tasks.Task DevicesStartForwardAsync(string udid, ForwardRequest forwardRequest, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesStartForwardWithHttpInfoAsync(udid, forwardRequest, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Start port forward (job) Start a TCP port forward host→device as an async job (CLI: `ios forward`). + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Job) + public async System.Threading.Tasks.Task> DevicesStartForwardWithHttpInfoAsync(string udid, ForwardRequest forwardRequest, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesStartForward"); + + // verify the required parameter 'forwardRequest' is set + if (forwardRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'forwardRequest' when calling DefaultApi->DevicesStartForward"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.Data = forwardRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/jobs/forward", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesStartForward", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Start test run (job) Start an XCUITest/unit-test run as an async job (CLI: `ios runtest`). Returns `202` with the created job. + /// + /// Thrown when fails to make API call + /// + /// + /// Job + public Job DevicesStartRunTest(string udid, RunTestRequest runTestRequest) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesStartRunTestWithHttpInfo(udid, runTestRequest); + return localVarResponse.Data; + } + + /// + /// Start test run (job) Start an XCUITest/unit-test run as an async job (CLI: `ios runtest`). Returns `202` with the created job. + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Job + public GoIos.Sdk.Generated.Client.ApiResponse DevicesStartRunTestWithHttpInfo(string udid, RunTestRequest runTestRequest) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesStartRunTest"); + + // verify the required parameter 'runTestRequest' is set + if (runTestRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'runTestRequest' when calling DefaultApi->DevicesStartRunTest"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.Data = runTestRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/jobs/runtest", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesStartRunTest", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Start test run (job) Start an XCUITest/unit-test run as an async job (CLI: `ios runtest`). Returns `202` with the created job. + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of Job + public async System.Threading.Tasks.Task DevicesStartRunTestAsync(string udid, RunTestRequest runTestRequest, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesStartRunTestWithHttpInfoAsync(udid, runTestRequest, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Start test run (job) Start an XCUITest/unit-test run as an async job (CLI: `ios runtest`). Returns `202` with the created job. + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Job) + public async System.Threading.Tasks.Task> DevicesStartRunTestWithHttpInfoAsync(string udid, RunTestRequest runTestRequest, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesStartRunTest"); + + // verify the required parameter 'runTestRequest' is set + if (runTestRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'runTestRequest' when calling DefaultApi->DevicesStartRunTest"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.Data = runTestRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/jobs/runtest", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesStartRunTest", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Start WDA runner (job) Start the WebDriverAgent runner as an async job (CLI: `ios runwda`). Body fields are optional and default to the standard WDA bundle id and config. + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Job + public Job DevicesStartRunWda(string udid, RunTestRequest? runTestRequest = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesStartRunWdaWithHttpInfo(udid, runTestRequest); + return localVarResponse.Data; + } + + /// + /// Start WDA runner (job) Start the WebDriverAgent runner as an async job (CLI: `ios runwda`). Body fields are optional and default to the standard WDA bundle id and config. + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// ApiResponse of Job + public GoIos.Sdk.Generated.Client.ApiResponse DevicesStartRunWdaWithHttpInfo(string udid, RunTestRequest? runTestRequest = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesStartRunWda"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.Data = runTestRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/jobs/runwda", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesStartRunWda", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Start WDA runner (job) Start the WebDriverAgent runner as an async job (CLI: `ios runwda`). Body fields are optional and default to the standard WDA bundle id and config. + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of Job + public async System.Threading.Tasks.Task DevicesStartRunWdaAsync(string udid, RunTestRequest? runTestRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesStartRunWdaWithHttpInfoAsync(udid, runTestRequest, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Start WDA runner (job) Start the WebDriverAgent runner as an async job (CLI: `ios runwda`). Body fields are optional and default to the standard WDA bundle id and config. + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Job) + public async System.Threading.Tasks.Task> DevicesStartRunWdaWithHttpInfoAsync(string udid, RunTestRequest? runTestRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesStartRunWda"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.Data = runTestRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/jobs/runwda", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesStartRunWda", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Stop or delete job Stop a running job, or purge an already-terminal one from the registry (CLI: Ctrl-C on the equivalent command). + /// + /// Thrown when fails to make API call + /// + /// The job id. + /// GenericResponse + public GenericResponse DevicesStopJob(string udid, string id) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesStopJobWithHttpInfo(udid, id); + return localVarResponse.Data; + } + + /// + /// Stop or delete job Stop a running job, or purge an already-terminal one from the registry (CLI: Ctrl-C on the equivalent command). + /// + /// Thrown when fails to make API call + /// + /// The job id. + /// ApiResponse of GenericResponse + public GoIos.Sdk.Generated.Client.ApiResponse DevicesStopJobWithHttpInfo(string udid, string id) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesStopJob"); + + // verify the required parameter 'id' is set + if (id == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling DefaultApi->DevicesStopJob"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.PathParameters.Add("id", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Delete("/api/v1/device/{udid}/jobs/{id}", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesStopJob", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Stop or delete job Stop a running job, or purge an already-terminal one from the registry (CLI: Ctrl-C on the equivalent command). + /// + /// Thrown when fails to make API call + /// + /// The job id. + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + public async System.Threading.Tasks.Task DevicesStopJobAsync(string udid, string id, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesStopJobWithHttpInfoAsync(udid, id, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Stop or delete job Stop a running job, or purge an already-terminal one from the registry (CLI: Ctrl-C on the equivalent command). + /// + /// Thrown when fails to make API call + /// + /// The job id. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + public async System.Threading.Tasks.Task> DevicesStopJobWithHttpInfoAsync(string udid, string id, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesStopJob"); + + // verify the required parameter 'id' is set + if (id == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling DefaultApi->DevicesStopJob"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.PathParameters.Add("id", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/api/v1/device/{udid}/jobs/{id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesStopJob", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Stream job logs (SSE) Stream a job's log output as Server-Sent Events: the buffered history first, then live lines until the job ends or the client disconnects. + /// + /// Thrown when fails to make API call + /// + /// The job id. + /// string + public string DevicesStreamJobLogs(string udid, string id) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesStreamJobLogsWithHttpInfo(udid, id); + return localVarResponse.Data; + } + + /// + /// Stream job logs (SSE) Stream a job's log output as Server-Sent Events: the buffered history first, then live lines until the job ends or the client disconnects. + /// + /// Thrown when fails to make API call + /// + /// The job id. + /// ApiResponse of string + public GoIos.Sdk.Generated.Client.ApiResponse DevicesStreamJobLogsWithHttpInfo(string udid, string id) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesStreamJobLogs"); + + // verify the required parameter 'id' is set + if (id == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling DefaultApi->DevicesStreamJobLogs"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/event-stream", + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.PathParameters.Add("id", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/jobs/{id}/logs", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesStreamJobLogs", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Stream job logs (SSE) Stream a job's log output as Server-Sent Events: the buffered history first, then live lines until the job ends or the client disconnects. + /// + /// Thrown when fails to make API call + /// + /// The job id. + /// Cancellation Token to cancel the request. + /// Task of string + public async System.Threading.Tasks.Task DevicesStreamJobLogsAsync(string udid, string id, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesStreamJobLogsWithHttpInfoAsync(udid, id, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Stream job logs (SSE) Stream a job's log output as Server-Sent Events: the buffered history first, then live lines until the job ends or the client disconnects. + /// + /// Thrown when fails to make API call + /// + /// The job id. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (string) + public async System.Threading.Tasks.Task> DevicesStreamJobLogsWithHttpInfoAsync(string udid, string id, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesStreamJobLogs"); + + // verify the required parameter 'id' is set + if (id == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'id' when calling DefaultApi->DevicesStreamJobLogs"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/event-stream", + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.PathParameters.Add("id", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(id)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/jobs/{id}/logs", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesStreamJobLogs", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Stream device attach/detach (SSE) Stream device attach/detach events as Server-Sent Events. + /// + /// Thrown when fails to make API call + /// + /// string + public string DevicesStreamListen(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesStreamListenWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Stream device attach/detach (SSE) Stream device attach/detach events as Server-Sent Events. + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of string + public GoIos.Sdk.Generated.Client.ApiResponse DevicesStreamListenWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesStreamListen"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/event-stream", + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/listen", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesStreamListen", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Stream device attach/detach (SSE) Stream device attach/detach events as Server-Sent Events. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of string + public async System.Threading.Tasks.Task DevicesStreamListenAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesStreamListenWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Stream device attach/detach (SSE) Stream device attach/detach events as Server-Sent Events. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (string) + public async System.Threading.Tasks.Task> DevicesStreamListenWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesStreamListen"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/event-stream", + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/listen", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesStreamListen", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Stream app-state notifications (SSE) Stream application state-change notifications as Server-Sent Events. + /// + /// Thrown when fails to make API call + /// + /// string + public string DevicesStreamNotifications(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesStreamNotificationsWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Stream app-state notifications (SSE) Stream application state-change notifications as Server-Sent Events. + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of string + public GoIos.Sdk.Generated.Client.ApiResponse DevicesStreamNotificationsWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesStreamNotifications"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/event-stream", + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/notifications", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesStreamNotifications", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Stream app-state notifications (SSE) Stream application state-change notifications as Server-Sent Events. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of string + public async System.Threading.Tasks.Task DevicesStreamNotificationsAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesStreamNotificationsWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Stream app-state notifications (SSE) Stream application state-change notifications as Server-Sent Events. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (string) + public async System.Threading.Tasks.Task> DevicesStreamNotificationsWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesStreamNotifications"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/event-stream", + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/notifications", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesStreamNotifications", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Stream os_log trace (SSE) Stream structured os_log trace entries as Server-Sent Events. All filters are optional and combine with AND semantics. + /// + /// Thrown when fails to make API call + /// + /// Only include entries from this process id. (optional) + /// Minimum log level to include (e.g. `info`, `debug`, `error`). (optional) + /// Only include entries from this subsystem. (optional) + /// Only include entries whose message matches this substring/pattern. (optional) + /// Exclude entries whose message matches this substring/pattern. (optional) + /// string + public string DevicesStreamOsTrace(string udid, int? pid = default, string? level = default, string? subsystem = default, string? match = default, string? exclude = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesStreamOsTraceWithHttpInfo(udid, pid, level, subsystem, match, exclude); + return localVarResponse.Data; + } + + /// + /// Stream os_log trace (SSE) Stream structured os_log trace entries as Server-Sent Events. All filters are optional and combine with AND semantics. + /// + /// Thrown when fails to make API call + /// + /// Only include entries from this process id. (optional) + /// Minimum log level to include (e.g. `info`, `debug`, `error`). (optional) + /// Only include entries from this subsystem. (optional) + /// Only include entries whose message matches this substring/pattern. (optional) + /// Exclude entries whose message matches this substring/pattern. (optional) + /// ApiResponse of string + public GoIos.Sdk.Generated.Client.ApiResponse DevicesStreamOsTraceWithHttpInfo(string udid, int? pid = default, string? level = default, string? subsystem = default, string? match = default, string? exclude = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesStreamOsTrace"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/event-stream", + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (pid != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "pid", pid)); + } + if (level != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "level", level)); + } + if (subsystem != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "subsystem", subsystem)); + } + if (match != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "match", match)); + } + if (exclude != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "exclude", exclude)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/ostrace", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesStreamOsTrace", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Stream os_log trace (SSE) Stream structured os_log trace entries as Server-Sent Events. All filters are optional and combine with AND semantics. + /// + /// Thrown when fails to make API call + /// + /// Only include entries from this process id. (optional) + /// Minimum log level to include (e.g. `info`, `debug`, `error`). (optional) + /// Only include entries from this subsystem. (optional) + /// Only include entries whose message matches this substring/pattern. (optional) + /// Exclude entries whose message matches this substring/pattern. (optional) + /// Cancellation Token to cancel the request. + /// Task of string + public async System.Threading.Tasks.Task DevicesStreamOsTraceAsync(string udid, int? pid = default, string? level = default, string? subsystem = default, string? match = default, string? exclude = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesStreamOsTraceWithHttpInfoAsync(udid, pid, level, subsystem, match, exclude, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Stream os_log trace (SSE) Stream structured os_log trace entries as Server-Sent Events. All filters are optional and combine with AND semantics. + /// + /// Thrown when fails to make API call + /// + /// Only include entries from this process id. (optional) + /// Minimum log level to include (e.g. `info`, `debug`, `error`). (optional) + /// Only include entries from this subsystem. (optional) + /// Only include entries whose message matches this substring/pattern. (optional) + /// Exclude entries whose message matches this substring/pattern. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (string) + public async System.Threading.Tasks.Task> DevicesStreamOsTraceWithHttpInfoAsync(string udid, int? pid = default, string? level = default, string? subsystem = default, string? match = default, string? exclude = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesStreamOsTrace"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/event-stream", + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (pid != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "pid", pid)); + } + if (level != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "level", level)); + } + if (subsystem != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "subsystem", subsystem)); + } + if (match != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "match", match)); + } + if (exclude != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "exclude", exclude)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/ostrace", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesStreamOsTrace", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Stream syslog (SSE) Stream device syslog lines as Server-Sent Events. + /// + /// Thrown when fails to make API call + /// + /// string + public string DevicesStreamSyslog(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesStreamSyslogWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Stream syslog (SSE) Stream device syslog lines as Server-Sent Events. + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of string + public GoIos.Sdk.Generated.Client.ApiResponse DevicesStreamSyslogWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesStreamSyslog"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/event-stream", + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/syslog", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesStreamSyslog", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Stream syslog (SSE) Stream device syslog lines as Server-Sent Events. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of string + public async System.Threading.Tasks.Task DevicesStreamSyslogAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesStreamSyslogWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Stream syslog (SSE) Stream device syslog lines as Server-Sent Events. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (string) + public async System.Threading.Tasks.Task> DevicesStreamSyslogWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesStreamSyslog"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/event-stream", + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/syslog", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesStreamSyslog", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Stream CPU usage (SSE) Stream CPU-usage samples as Server-Sent Events (CLI: `ios sysmontap`). + /// + /// Thrown when fails to make API call + /// + /// string + public string DevicesStreamSysmontap(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesStreamSysmontapWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Stream CPU usage (SSE) Stream CPU-usage samples as Server-Sent Events (CLI: `ios sysmontap`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of string + public GoIos.Sdk.Generated.Client.ApiResponse DevicesStreamSysmontapWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesStreamSysmontap"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/event-stream", + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/sysmontap", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesStreamSysmontap", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Stream CPU usage (SSE) Stream CPU-usage samples as Server-Sent Events (CLI: `ios sysmontap`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of string + public async System.Threading.Tasks.Task DevicesStreamSysmontapAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesStreamSysmontapWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Stream CPU usage (SSE) Stream CPU-usage samples as Server-Sent Events (CLI: `ios sysmontap`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (string) + public async System.Threading.Tasks.Task> DevicesStreamSysmontapWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesStreamSysmontap"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/event-stream", + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/sysmontap", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesStreamSysmontap", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Uninstall app Uninstall an application by bundle id. + /// + /// Thrown when fails to make API call + /// + /// Bundle id of the app to uninstall. + /// GenericResponse + public GenericResponse DevicesUninstallApp(string udid, string bundleID) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesUninstallAppWithHttpInfo(udid, bundleID); + return localVarResponse.Data; + } + + /// + /// Uninstall app Uninstall an application by bundle id. + /// + /// Thrown when fails to make API call + /// + /// Bundle id of the app to uninstall. + /// ApiResponse of GenericResponse + public GoIos.Sdk.Generated.Client.ApiResponse DevicesUninstallAppWithHttpInfo(string udid, string bundleID) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesUninstallApp"); + + // verify the required parameter 'bundleID' is set + if (bundleID == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'bundleID' when calling DefaultApi->DevicesUninstallApp"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "bundleID", bundleID)); + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/apps/uninstall", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesUninstallApp", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Uninstall app Uninstall an application by bundle id. + /// + /// Thrown when fails to make API call + /// + /// Bundle id of the app to uninstall. + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + public async System.Threading.Tasks.Task DevicesUninstallAppAsync(string udid, string bundleID, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesUninstallAppWithHttpInfoAsync(udid, bundleID, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Uninstall app Uninstall an application by bundle id. + /// + /// Thrown when fails to make API call + /// + /// Bundle id of the app to uninstall. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + public async System.Threading.Tasks.Task> DevicesUninstallAppWithHttpInfoAsync(string udid, string bundleID, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesUninstallApp"); + + // verify the required parameter 'bundleID' is set + if (bundleID == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'bundleID' when calling DefaultApi->DevicesUninstallApp"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "bundleID", bundleID)); + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/apps/uninstall", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesUninstallApp", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Unmount developer image Unmount the developer disk image (CLI: `ios image unmount`). + /// + /// Thrown when fails to make API call + /// + /// GenericResponse + public GenericResponse DevicesUnmountImage(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DevicesUnmountImageWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Unmount developer image Unmount the developer disk image (CLI: `ios image unmount`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of GenericResponse + public GoIos.Sdk.Generated.Client.ApiResponse DevicesUnmountImageWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesUnmountImage"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Delete("/api/v1/device/{udid}/image", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesUnmountImage", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Unmount developer image Unmount the developer disk image (CLI: `ios image unmount`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of GenericResponse + public async System.Threading.Tasks.Task DevicesUnmountImageAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DevicesUnmountImageWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Unmount developer image Unmount the developer disk image (CLI: `ios image unmount`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GenericResponse) + public async System.Threading.Tasks.Task> DevicesUnmountImageWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DevicesUnmountImage"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/api/v1/device/{udid}/image", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DevicesUnmountImage", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get battery IORegistry Get the battery IORegistry stats (Temperature, Voltage, CurrentCapacity, ...) via the diagnostics relay (CLI: `ios diagnostics ioregistry`). + /// + /// Thrown when fails to make API call + /// + /// BatteryRegistry + public BatteryRegistry DiagnosticsNetGetBatteryRegistry(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DiagnosticsNetGetBatteryRegistryWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Get battery IORegistry Get the battery IORegistry stats (Temperature, Voltage, CurrentCapacity, ...) via the diagnostics relay (CLI: `ios diagnostics ioregistry`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of BatteryRegistry + public GoIos.Sdk.Generated.Client.ApiResponse DiagnosticsNetGetBatteryRegistryWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DiagnosticsNetGetBatteryRegistry"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/battery/registry", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DiagnosticsNetGetBatteryRegistry", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get battery IORegistry Get the battery IORegistry stats (Temperature, Voltage, CurrentCapacity, ...) via the diagnostics relay (CLI: `ios diagnostics ioregistry`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of BatteryRegistry + public async System.Threading.Tasks.Task DiagnosticsNetGetBatteryRegistryAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DiagnosticsNetGetBatteryRegistryWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get battery IORegistry Get the battery IORegistry stats (Temperature, Voltage, CurrentCapacity, ...) via the diagnostics relay (CLI: `ios diagnostics ioregistry`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (BatteryRegistry) + public async System.Threading.Tasks.Task> DiagnosticsNetGetBatteryRegistryWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DiagnosticsNetGetBatteryRegistry"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/battery/registry", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DiagnosticsNetGetBatteryRegistry", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get device IP / network info Resolve the device's network addresses (MAC/IPv4/IPv6) by sniffing pcapd (CLI: `ios ip`). + /// + /// Thrown when fails to make API call + /// + /// NetworkInfo + public NetworkInfo DiagnosticsNetGetDeviceIp(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DiagnosticsNetGetDeviceIpWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Get device IP / network info Resolve the device's network addresses (MAC/IPv4/IPv6) by sniffing pcapd (CLI: `ios ip`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of NetworkInfo + public GoIos.Sdk.Generated.Client.ApiResponse DiagnosticsNetGetDeviceIpWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DiagnosticsNetGetDeviceIp"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/ip", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DiagnosticsNetGetDeviceIp", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get device IP / network info Resolve the device's network addresses (MAC/IPv4/IPv6) by sniffing pcapd (CLI: `ios ip`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of NetworkInfo + public async System.Threading.Tasks.Task DiagnosticsNetGetDeviceIpAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DiagnosticsNetGetDeviceIpWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get device IP / network info Resolve the device's network addresses (MAC/IPv4/IPv6) by sniffing pcapd (CLI: `ios ip`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (NetworkInfo) + public async System.Threading.Tasks.Task> DiagnosticsNetGetDeviceIpWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DiagnosticsNetGetDeviceIp"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/ip", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DiagnosticsNetGetDeviceIp", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get disk space info Get filesystem info for the device (total/free/used bytes, block size) via AFC (CLI: `ios diskspace`). + /// + /// Thrown when fails to make API call + /// + /// DiskSpaceInfo + public DiskSpaceInfo DiagnosticsNetGetDiskSpace(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DiagnosticsNetGetDiskSpaceWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Get disk space info Get filesystem info for the device (total/free/used bytes, block size) via AFC (CLI: `ios diskspace`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of DiskSpaceInfo + public GoIos.Sdk.Generated.Client.ApiResponse DiagnosticsNetGetDiskSpaceWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DiagnosticsNetGetDiskSpace"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/diskspace", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DiagnosticsNetGetDiskSpace", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get disk space info Get filesystem info for the device (total/free/used bytes, block size) via AFC (CLI: `ios diskspace`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of DiskSpaceInfo + public async System.Threading.Tasks.Task DiagnosticsNetGetDiskSpaceAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DiagnosticsNetGetDiskSpaceWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get disk space info Get filesystem info for the device (total/free/used bytes, block size) via AFC (CLI: `ios diskspace`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (DiskSpaceInfo) + public async System.Threading.Tasks.Task> DiagnosticsNetGetDiskSpaceWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DiagnosticsNetGetDiskSpace"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/diskspace", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DiagnosticsNetGetDiskSpace", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get RSD service list Get the device's RSD (Remote Service Discovery) service list (CLI: `ios rsd ls`). Requires a running tunnel (iOS 17+); devices without RSD return `400`. + /// + /// Thrown when fails to make API call + /// + /// Object + public Object DiagnosticsNetGetRsdServices(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = DiagnosticsNetGetRsdServicesWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Get RSD service list Get the device's RSD (Remote Service Discovery) service list (CLI: `ios rsd ls`). Requires a running tunnel (iOS 17+); devices without RSD return `400`. + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse DiagnosticsNetGetRsdServicesWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DiagnosticsNetGetRsdServices"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/rsd", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DiagnosticsNetGetRsdServices", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get RSD service list Get the device's RSD (Remote Service Discovery) service list (CLI: `ios rsd ls`). Requires a running tunnel (iOS 17+); devices without RSD return `400`. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task DiagnosticsNetGetRsdServicesAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await DiagnosticsNetGetRsdServicesWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get RSD service list Get the device's RSD (Remote Service Discovery) service list (CLI: `ios rsd ls`). Requires a running tunnel (iOS 17+); devices without RSD return `400`. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> DiagnosticsNetGetRsdServicesWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->DiagnosticsNetGetRsdServices"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/rsd", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DiagnosticsNetGetRsdServices", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// List a directory over AFC List a device directory over AFC (CLI: `ios fsync ls`). + /// + /// Thrown when fails to make API call + /// + /// App bundle id to scope to its container (else the media dir). (optional) + /// Device-side path (rejects `..` elements). (optional) + /// FsyncListing + public FsyncListing FsyncFsyncLs(string udid, string? bundleID = default, string? path = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = FsyncFsyncLsWithHttpInfo(udid, bundleID, path); + return localVarResponse.Data; + } + + /// + /// List a directory over AFC List a device directory over AFC (CLI: `ios fsync ls`). + /// + /// Thrown when fails to make API call + /// + /// App bundle id to scope to its container (else the media dir). (optional) + /// Device-side path (rejects `..` elements). (optional) + /// ApiResponse of FsyncListing + public GoIos.Sdk.Generated.Client.ApiResponse FsyncFsyncLsWithHttpInfo(string udid, string? bundleID = default, string? path = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->FsyncFsyncLs"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (bundleID != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "bundleID", bundleID)); + } + if (path != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "path", path)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/fsync/ls", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FsyncFsyncLs", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// List a directory over AFC List a device directory over AFC (CLI: `ios fsync ls`). + /// + /// Thrown when fails to make API call + /// + /// App bundle id to scope to its container (else the media dir). (optional) + /// Device-side path (rejects `..` elements). (optional) + /// Cancellation Token to cancel the request. + /// Task of FsyncListing + public async System.Threading.Tasks.Task FsyncFsyncLsAsync(string udid, string? bundleID = default, string? path = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await FsyncFsyncLsWithHttpInfoAsync(udid, bundleID, path, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// List a directory over AFC List a device directory over AFC (CLI: `ios fsync ls`). + /// + /// Thrown when fails to make API call + /// + /// App bundle id to scope to its container (else the media dir). (optional) + /// Device-side path (rejects `..` elements). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FsyncListing) + public async System.Threading.Tasks.Task> FsyncFsyncLsWithHttpInfoAsync(string udid, string? bundleID = default, string? path = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->FsyncFsyncLs"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (bundleID != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "bundleID", bundleID)); + } + if (path != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "path", path)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/fsync/ls", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FsyncFsyncLs", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Create a directory over AFC Create a directory over AFC (CLI: `ios fsync mkdir`). + /// + /// Thrown when fails to make API call + /// + /// Directory path to create (required). + /// App bundle id to scope to its container (else the media dir). (optional) + /// FsyncMessage + public FsyncMessage FsyncFsyncMkdir(string udid, string path, string? bundleID = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = FsyncFsyncMkdirWithHttpInfo(udid, path, bundleID); + return localVarResponse.Data; + } + + /// + /// Create a directory over AFC Create a directory over AFC (CLI: `ios fsync mkdir`). + /// + /// Thrown when fails to make API call + /// + /// Directory path to create (required). + /// App bundle id to scope to its container (else the media dir). (optional) + /// ApiResponse of FsyncMessage + public GoIos.Sdk.Generated.Client.ApiResponse FsyncFsyncMkdirWithHttpInfo(string udid, string path, string? bundleID = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->FsyncFsyncMkdir"); + + // verify the required parameter 'path' is set + if (path == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'path' when calling DefaultApi->FsyncFsyncMkdir"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (bundleID != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "bundleID", bundleID)); + } + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "path", path)); + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/fsync/mkdir", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FsyncFsyncMkdir", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Create a directory over AFC Create a directory over AFC (CLI: `ios fsync mkdir`). + /// + /// Thrown when fails to make API call + /// + /// Directory path to create (required). + /// App bundle id to scope to its container (else the media dir). (optional) + /// Cancellation Token to cancel the request. + /// Task of FsyncMessage + public async System.Threading.Tasks.Task FsyncFsyncMkdirAsync(string udid, string path, string? bundleID = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await FsyncFsyncMkdirWithHttpInfoAsync(udid, path, bundleID, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Create a directory over AFC Create a directory over AFC (CLI: `ios fsync mkdir`). + /// + /// Thrown when fails to make API call + /// + /// Directory path to create (required). + /// App bundle id to scope to its container (else the media dir). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FsyncMessage) + public async System.Threading.Tasks.Task> FsyncFsyncMkdirWithHttpInfoAsync(string udid, string path, string? bundleID = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->FsyncFsyncMkdir"); + + // verify the required parameter 'path' is set + if (path == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'path' when calling DefaultApi->FsyncFsyncMkdir"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (bundleID != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "bundleID", bundleID)); + } + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "path", path)); + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/fsync/mkdir", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FsyncFsyncMkdir", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Download a file over AFC Download a file from the device over AFC (CLI: `ios fsync pull`). Returns the raw file bytes. `path` is required. + /// + /// Thrown when fails to make API call + /// + /// Remote file path on the device (required). + /// App bundle id to scope to its container (else the media dir). (optional) + /// Object + public Object FsyncFsyncPull(string udid, string path, string? bundleID = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = FsyncFsyncPullWithHttpInfo(udid, path, bundleID); + return localVarResponse.Data; + } + + /// + /// Download a file over AFC Download a file from the device over AFC (CLI: `ios fsync pull`). Returns the raw file bytes. `path` is required. + /// + /// Thrown when fails to make API call + /// + /// Remote file path on the device (required). + /// App bundle id to scope to its container (else the media dir). (optional) + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse FsyncFsyncPullWithHttpInfo(string udid, string path, string? bundleID = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->FsyncFsyncPull"); + + // verify the required parameter 'path' is set + if (path == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'path' when calling DefaultApi->FsyncFsyncPull"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/octet-stream", + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (bundleID != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "bundleID", bundleID)); + } + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "path", path)); + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/fsync/pull", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FsyncFsyncPull", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Download a file over AFC Download a file from the device over AFC (CLI: `ios fsync pull`). Returns the raw file bytes. `path` is required. + /// + /// Thrown when fails to make API call + /// + /// Remote file path on the device (required). + /// App bundle id to scope to its container (else the media dir). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task FsyncFsyncPullAsync(string udid, string path, string? bundleID = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await FsyncFsyncPullWithHttpInfoAsync(udid, path, bundleID, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Download a file over AFC Download a file from the device over AFC (CLI: `ios fsync pull`). Returns the raw file bytes. `path` is required. + /// + /// Thrown when fails to make API call + /// + /// Remote file path on the device (required). + /// App bundle id to scope to its container (else the media dir). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> FsyncFsyncPullWithHttpInfoAsync(string udid, string path, string? bundleID = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->FsyncFsyncPull"); + + // verify the required parameter 'path' is set + if (path == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'path' when calling DefaultApi->FsyncFsyncPull"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/octet-stream", + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (bundleID != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "bundleID", bundleID)); + } + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "path", path)); + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/fsync/pull", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FsyncFsyncPull", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Upload a file over AFC Upload a file to the device over AFC (CLI: `ios fsync push`). Accepts either raw bytes (application/octet-stream) or a multipart form with a `file` field. `path` is required. Bounded server-side; oversized uploads get `413`. + /// + /// Thrown when fails to make API call + /// + /// Destination path on the device (required). + /// Raw file bytes to upload (application/octet-stream). + /// App bundle id to scope to its container (else the media dir). (optional) + /// FsyncPushResult + public FsyncPushResult FsyncFsyncPush(string udid, string path, Object body, string? bundleID = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = FsyncFsyncPushWithHttpInfo(udid, path, body, bundleID); + return localVarResponse.Data; + } + + /// + /// Upload a file over AFC Upload a file to the device over AFC (CLI: `ios fsync push`). Accepts either raw bytes (application/octet-stream) or a multipart form with a `file` field. `path` is required. Bounded server-side; oversized uploads get `413`. + /// + /// Thrown when fails to make API call + /// + /// Destination path on the device (required). + /// Raw file bytes to upload (application/octet-stream). + /// App bundle id to scope to its container (else the media dir). (optional) + /// ApiResponse of FsyncPushResult + public GoIos.Sdk.Generated.Client.ApiResponse FsyncFsyncPushWithHttpInfo(string udid, string path, Object body, string? bundleID = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->FsyncFsyncPush"); + + // verify the required parameter 'path' is set + if (path == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'path' when calling DefaultApi->FsyncFsyncPush"); + + // verify the required parameter 'body' is set + if (body == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'body' when calling DefaultApi->FsyncFsyncPush"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/octet-stream" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (bundleID != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "bundleID", bundleID)); + } + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "path", path)); + localVarRequestOptions.Data = body; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/fsync/push", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FsyncFsyncPush", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Upload a file over AFC Upload a file to the device over AFC (CLI: `ios fsync push`). Accepts either raw bytes (application/octet-stream) or a multipart form with a `file` field. `path` is required. Bounded server-side; oversized uploads get `413`. + /// + /// Thrown when fails to make API call + /// + /// Destination path on the device (required). + /// Raw file bytes to upload (application/octet-stream). + /// App bundle id to scope to its container (else the media dir). (optional) + /// Cancellation Token to cancel the request. + /// Task of FsyncPushResult + public async System.Threading.Tasks.Task FsyncFsyncPushAsync(string udid, string path, Object body, string? bundleID = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await FsyncFsyncPushWithHttpInfoAsync(udid, path, body, bundleID, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Upload a file over AFC Upload a file to the device over AFC (CLI: `ios fsync push`). Accepts either raw bytes (application/octet-stream) or a multipart form with a `file` field. `path` is required. Bounded server-side; oversized uploads get `413`. + /// + /// Thrown when fails to make API call + /// + /// Destination path on the device (required). + /// Raw file bytes to upload (application/octet-stream). + /// App bundle id to scope to its container (else the media dir). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FsyncPushResult) + public async System.Threading.Tasks.Task> FsyncFsyncPushWithHttpInfoAsync(string udid, string path, Object body, string? bundleID = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->FsyncFsyncPush"); + + // verify the required parameter 'path' is set + if (path == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'path' when calling DefaultApi->FsyncFsyncPush"); + + // verify the required parameter 'body' is set + if (body == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'body' when calling DefaultApi->FsyncFsyncPush"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/octet-stream" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (bundleID != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "bundleID", bundleID)); + } + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "path", path)); + localVarRequestOptions.Data = body; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/fsync/push", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FsyncFsyncPush", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Remove a file or directory over AFC Remove a file or directory over AFC (CLI: `ios fsync rm`). Pass `recursive=true` to delete a non-empty directory. + /// + /// Thrown when fails to make API call + /// + /// Path to remove (required). + /// App bundle id to scope to its container (else the media dir). (optional) + /// Remove directory contents recursively. (optional) + /// FsyncMessage + public FsyncMessage FsyncFsyncRm(string udid, string path, string? bundleID = default, bool? recursive = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = FsyncFsyncRmWithHttpInfo(udid, path, bundleID, recursive); + return localVarResponse.Data; + } + + /// + /// Remove a file or directory over AFC Remove a file or directory over AFC (CLI: `ios fsync rm`). Pass `recursive=true` to delete a non-empty directory. + /// + /// Thrown when fails to make API call + /// + /// Path to remove (required). + /// App bundle id to scope to its container (else the media dir). (optional) + /// Remove directory contents recursively. (optional) + /// ApiResponse of FsyncMessage + public GoIos.Sdk.Generated.Client.ApiResponse FsyncFsyncRmWithHttpInfo(string udid, string path, string? bundleID = default, bool? recursive = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->FsyncFsyncRm"); + + // verify the required parameter 'path' is set + if (path == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'path' when calling DefaultApi->FsyncFsyncRm"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (bundleID != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "bundleID", bundleID)); + } + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "path", path)); + if (recursive != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "recursive", recursive)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Delete("/api/v1/device/{udid}/fsync/rm", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FsyncFsyncRm", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Remove a file or directory over AFC Remove a file or directory over AFC (CLI: `ios fsync rm`). Pass `recursive=true` to delete a non-empty directory. + /// + /// Thrown when fails to make API call + /// + /// Path to remove (required). + /// App bundle id to scope to its container (else the media dir). (optional) + /// Remove directory contents recursively. (optional) + /// Cancellation Token to cancel the request. + /// Task of FsyncMessage + public async System.Threading.Tasks.Task FsyncFsyncRmAsync(string udid, string path, string? bundleID = default, bool? recursive = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await FsyncFsyncRmWithHttpInfoAsync(udid, path, bundleID, recursive, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Remove a file or directory over AFC Remove a file or directory over AFC (CLI: `ios fsync rm`). Pass `recursive=true` to delete a non-empty directory. + /// + /// Thrown when fails to make API call + /// + /// Path to remove (required). + /// App bundle id to scope to its container (else the media dir). (optional) + /// Remove directory contents recursively. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FsyncMessage) + public async System.Threading.Tasks.Task> FsyncFsyncRmWithHttpInfoAsync(string udid, string path, string? bundleID = default, bool? recursive = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->FsyncFsyncRm"); + + // verify the required parameter 'path' is set + if (path == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'path' when calling DefaultApi->FsyncFsyncRm"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (bundleID != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "bundleID", bundleID)); + } + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "path", path)); + if (recursive != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "recursive", recursive)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/api/v1/device/{udid}/fsync/rm", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FsyncFsyncRm", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Recursively list a directory over AFC Recursively list a device directory over AFC (CLI: `ios fsync tree`). + /// + /// Thrown when fails to make API call + /// + /// App bundle id to scope to its container (else the media dir). (optional) + /// Device-side path (rejects `..` elements). (optional) + /// FsyncTreeListing + public FsyncTreeListing FsyncFsyncTree(string udid, string? bundleID = default, string? path = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = FsyncFsyncTreeWithHttpInfo(udid, bundleID, path); + return localVarResponse.Data; + } + + /// + /// Recursively list a directory over AFC Recursively list a device directory over AFC (CLI: `ios fsync tree`). + /// + /// Thrown when fails to make API call + /// + /// App bundle id to scope to its container (else the media dir). (optional) + /// Device-side path (rejects `..` elements). (optional) + /// ApiResponse of FsyncTreeListing + public GoIos.Sdk.Generated.Client.ApiResponse FsyncFsyncTreeWithHttpInfo(string udid, string? bundleID = default, string? path = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->FsyncFsyncTree"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (bundleID != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "bundleID", bundleID)); + } + if (path != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "path", path)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/fsync/tree", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FsyncFsyncTree", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Recursively list a directory over AFC Recursively list a device directory over AFC (CLI: `ios fsync tree`). + /// + /// Thrown when fails to make API call + /// + /// App bundle id to scope to its container (else the media dir). (optional) + /// Device-side path (rejects `..` elements). (optional) + /// Cancellation Token to cancel the request. + /// Task of FsyncTreeListing + public async System.Threading.Tasks.Task FsyncFsyncTreeAsync(string udid, string? bundleID = default, string? path = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await FsyncFsyncTreeWithHttpInfoAsync(udid, bundleID, path, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Recursively list a directory over AFC Recursively list a device directory over AFC (CLI: `ios fsync tree`). + /// + /// Thrown when fails to make API call + /// + /// App bundle id to scope to its container (else the media dir). (optional) + /// Device-side path (rejects `..` elements). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FsyncTreeListing) + public async System.Threading.Tasks.Task> FsyncFsyncTreeWithHttpInfoAsync(string udid, string? bundleID = default, string? path = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->FsyncFsyncTree"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (bundleID != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "bundleID", bundleID)); + } + if (path != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "path", path)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/fsync/tree", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FsyncFsyncTree", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get device cloud configuration Get the device cloud configuration (supervision status, skip-setup options, organization info). + /// + /// Thrown when fails to make API call + /// + /// Object + public Object FsyncGetCloudConfig(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = FsyncGetCloudConfigWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Get device cloud configuration Get the device cloud configuration (supervision status, skip-setup options, organization info). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse FsyncGetCloudConfigWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->FsyncGetCloudConfig"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/cloudconfig", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FsyncGetCloudConfig", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get device cloud configuration Get the device cloud configuration (supervision status, skip-setup options, organization info). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task FsyncGetCloudConfigAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await FsyncGetCloudConfigWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get device cloud configuration Get the device cloud configuration (supervision status, skip-setup options, organization info). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> FsyncGetCloudConfigWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->FsyncGetCloudConfig"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/cloudconfig", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FsyncGetCloudConfig", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// List setup skip options List all setup-pane skip options usable when preparing a device (CLI: `ios prepare printskip`). Static, device-free list. + /// + /// Thrown when fails to make API call + /// PrepareSkipOptions + public PrepareSkipOptions GetPrepareSkipOptions() + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = GetPrepareSkipOptionsWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// List setup skip options List all setup-pane skip options usable when preparing a device (CLI: `ios prepare printskip`). Static, device-free list. + /// + /// Thrown when fails to make API call + /// ApiResponse of PrepareSkipOptions + public GoIos.Sdk.Generated.Client.ApiResponse GetPrepareSkipOptionsWithHttpInfo() + { + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/prepare/skip-options", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetPrepareSkipOptions", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// List setup skip options List all setup-pane skip options usable when preparing a device (CLI: `ios prepare printskip`). Static, device-free list. + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of PrepareSkipOptions + public async System.Threading.Tasks.Task GetPrepareSkipOptionsAsync(System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await GetPrepareSkipOptionsWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// List setup skip options List all setup-pane skip options usable when preparing a device (CLI: `ios prepare printskip`). Static, device-free list. + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (PrepareSkipOptions) + public async System.Threading.Tasks.Task> GetPrepareSkipOptionsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default) + { + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/prepare/skip-options", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetPrepareSkipOptions", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// List devices List all attached / reachable devices. + /// + /// Thrown when fails to make API call + /// DeviceList + public DeviceList ListDevices() + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = ListDevicesWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// List devices List all attached / reachable devices. + /// + /// Thrown when fails to make API call + /// ApiResponse of DeviceList + public GoIos.Sdk.Generated.Client.ApiResponse ListDevicesWithHttpInfo() + { + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/list", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ListDevices", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// List devices List all attached / reachable devices. + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of DeviceList + public async System.Threading.Tasks.Task ListDevicesAsync(System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await ListDevicesWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// List devices List all attached / reachable devices. + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (DeviceList) + public async System.Threading.Tasks.Task> ListDevicesWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default) + { + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/list", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ListDevices", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// List tunnels List running device tunnels (CLI: `ios tunnel ls`). + /// + /// Thrown when fails to make API call + /// List<Tunnel> + public List ListTunnels() + { + GoIos.Sdk.Generated.Client.ApiResponse> localVarResponse = ListTunnelsWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// List tunnels List running device tunnels (CLI: `ios tunnel ls`). + /// + /// Thrown when fails to make API call + /// ApiResponse of List<Tunnel> + public GoIos.Sdk.Generated.Client.ApiResponse> ListTunnelsWithHttpInfo() + { + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/api/v1/tunnels", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ListTunnels", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// List tunnels List running device tunnels (CLI: `ios tunnel ls`). + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of List<Tunnel> + public async System.Threading.Tasks.Task> ListTunnelsAsync(System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse> localVarResponse = await ListTunnelsWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// List tunnels List running device tunnels (CLI: `ios tunnel ls`). + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Tunnel>) + public async System.Threading.Tasks.Task>> ListTunnelsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default) + { + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync>("/api/v1/tunnels", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ListTunnels", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Generate a supervision certificate Generate a self-signed supervision identity (CLI: `ios prepare create-cert`) and return the DER (base64) and PEM for both the certificate and private key. Host-scoped (device-free). + /// + /// Thrown when fails to make API call + /// SupervisionCert + public SupervisionCert PrepareCreateCert() + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = PrepareCreateCertWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Generate a supervision certificate Generate a self-signed supervision identity (CLI: `ios prepare create-cert`) and return the DER (base64) and PEM for both the certificate and private key. Host-scoped (device-free). + /// + /// Thrown when fails to make API call + /// ApiResponse of SupervisionCert + public GoIos.Sdk.Generated.Client.ApiResponse PrepareCreateCertWithHttpInfo() + { + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/prepare/create-cert", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("PrepareCreateCert", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Generate a supervision certificate Generate a self-signed supervision identity (CLI: `ios prepare create-cert`) and return the DER (base64) and PEM for both the certificate and private key. Host-scoped (device-free). + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of SupervisionCert + public async System.Threading.Tasks.Task PrepareCreateCertAsync(System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await PrepareCreateCertWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Generate a supervision certificate Generate a self-signed supervision identity (CLI: `ios prepare create-cert`) and return the DER (base64) and PEM for both the certificate and private key. Host-scoped (device-free). + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SupervisionCert) + public async System.Threading.Tasks.Task> PrepareCreateCertWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default) + { + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/prepare/create-cert", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("PrepareCreateCert", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Prepare (and optionally supervise) a device Run the device preparation/provisioning flow (CLI: `ios prepare`). Send multipart/form-data. To supervise the device include a `cert` file (DER/PEM/P12 supervision identity) and optional `p12password`; without a cert the device is prepared without supervision. + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// P12 password (when `cert` is a P12). (optional) + /// Setup panes to skip (see /prepare/skip-options). Repeatable. (optional) + /// Supervision organization name. (optional) + /// Device locale (default en_US). (optional) + /// Device language (default en). (optional) + /// PrepareResult + public PrepareResult PreparePrepareDevice(string udid, Object? cert = default, string? p12password = default, List? skip = default, string? orgname = default, string? locale = default, string? lang = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = PreparePrepareDeviceWithHttpInfo(udid, cert, p12password, skip, orgname, locale, lang); + return localVarResponse.Data; + } + + /// + /// Prepare (and optionally supervise) a device Run the device preparation/provisioning flow (CLI: `ios prepare`). Send multipart/form-data. To supervise the device include a `cert` file (DER/PEM/P12 supervision identity) and optional `p12password`; without a cert the device is prepared without supervision. + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// P12 password (when `cert` is a P12). (optional) + /// Setup panes to skip (see /prepare/skip-options). Repeatable. (optional) + /// Supervision organization name. (optional) + /// Device locale (default en_US). (optional) + /// Device language (default en). (optional) + /// ApiResponse of PrepareResult + public GoIos.Sdk.Generated.Client.ApiResponse PreparePrepareDeviceWithHttpInfo(string udid, Object? cert = default, string? p12password = default, List? skip = default, string? orgname = default, string? locale = default, string? lang = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->PreparePrepareDevice"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (cert != null) + { + localVarRequestOptions.FormParameters.Add("cert", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(cert)); // form parameter + } + if (p12password != null) + { + localVarRequestOptions.FormParameters.Add("p12password", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(p12password)); // form parameter + } + if (skip != null) + { + localVarRequestOptions.FormParameters.Add("skip", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(skip)); // form parameter + } + if (orgname != null) + { + localVarRequestOptions.FormParameters.Add("orgname", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(orgname)); // form parameter + } + if (locale != null) + { + localVarRequestOptions.FormParameters.Add("locale", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(locale)); // form parameter + } + if (lang != null) + { + localVarRequestOptions.FormParameters.Add("lang", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(lang)); // form parameter + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/prepare", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("PreparePrepareDevice", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Prepare (and optionally supervise) a device Run the device preparation/provisioning flow (CLI: `ios prepare`). Send multipart/form-data. To supervise the device include a `cert` file (DER/PEM/P12 supervision identity) and optional `p12password`; without a cert the device is prepared without supervision. + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// P12 password (when `cert` is a P12). (optional) + /// Setup panes to skip (see /prepare/skip-options). Repeatable. (optional) + /// Supervision organization name. (optional) + /// Device locale (default en_US). (optional) + /// Device language (default en). (optional) + /// Cancellation Token to cancel the request. + /// Task of PrepareResult + public async System.Threading.Tasks.Task PreparePrepareDeviceAsync(string udid, Object? cert = default, string? p12password = default, List? skip = default, string? orgname = default, string? locale = default, string? lang = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await PreparePrepareDeviceWithHttpInfoAsync(udid, cert, p12password, skip, orgname, locale, lang, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Prepare (and optionally supervise) a device Run the device preparation/provisioning flow (CLI: `ios prepare`). Send multipart/form-data. To supervise the device include a `cert` file (DER/PEM/P12 supervision identity) and optional `p12password`; without a cert the device is prepared without supervision. + /// + /// Thrown when fails to make API call + /// + /// (optional) + /// P12 password (when `cert` is a P12). (optional) + /// Setup panes to skip (see /prepare/skip-options). Repeatable. (optional) + /// Supervision organization name. (optional) + /// Device locale (default en_US). (optional) + /// Device language (default en). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (PrepareResult) + public async System.Threading.Tasks.Task> PreparePrepareDeviceWithHttpInfoAsync(string udid, Object? cert = default, string? p12password = default, List? skip = default, string? orgname = default, string? locale = default, string? lang = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->PreparePrepareDevice"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (cert != null) + { + localVarRequestOptions.FormParameters.Add("cert", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(cert)); // form parameter + } + if (p12password != null) + { + localVarRequestOptions.FormParameters.Add("p12password", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(p12password)); // form parameter + } + if (skip != null) + { + localVarRequestOptions.FormParameters.Add("skip", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(skip)); // form parameter + } + if (orgname != null) + { + localVarRequestOptions.FormParameters.Add("orgname", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(orgname)); // form parameter + } + if (locale != null) + { + localVarRequestOptions.FormParameters.Add("locale", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(locale)); // form parameter + } + if (lang != null) + { + localVarRequestOptions.FormParameters.Add("lang", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(lang)); // form parameter + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/prepare", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("PreparePrepareDevice", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Refresh tunnel Restart the tunnel for a device and wait for it to come up (CLI: `ios tunnel refresh`). + /// + /// Thrown when fails to make API call + /// + /// Tunnel + public Tunnel RefreshTunnel(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = RefreshTunnelWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Refresh tunnel Restart the tunnel for a device and wait for it to come up (CLI: `ios tunnel refresh`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Tunnel + public GoIos.Sdk.Generated.Client.ApiResponse RefreshTunnelWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->RefreshTunnel"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/tunnels/{udid}/refresh", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("RefreshTunnel", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Refresh tunnel Restart the tunnel for a device and wait for it to come up (CLI: `ios tunnel refresh`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of Tunnel + public async System.Threading.Tasks.Task RefreshTunnelAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await RefreshTunnelWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Refresh tunnel Restart the tunnel for a device and wait for it to come up (CLI: `ios tunnel refresh`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Tunnel) + public async System.Threading.Tasks.Task> RefreshTunnelWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->RefreshTunnel"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/tunnels/{udid}/refresh", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("RefreshTunnel", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Shut down tunnel agent Shut down the tunnel agent (CLI: `ios tunnel stopagent`). + /// + /// Thrown when fails to make API call + /// AgentShutdown + public AgentShutdown ShutdownTunnelAgent() + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = ShutdownTunnelAgentWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Shut down tunnel agent Shut down the tunnel agent (CLI: `ios tunnel stopagent`). + /// + /// Thrown when fails to make API call + /// ApiResponse of AgentShutdown + public GoIos.Sdk.Generated.Client.ApiResponse ShutdownTunnelAgentWithHttpInfo() + { + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/tunnel-agent/shutdown", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ShutdownTunnelAgent", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Shut down tunnel agent Shut down the tunnel agent (CLI: `ios tunnel stopagent`). + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of AgentShutdown + public async System.Threading.Tasks.Task ShutdownTunnelAgentAsync(System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await ShutdownTunnelAgentWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Shut down tunnel agent Shut down the tunnel agent (CLI: `ios tunnel stopagent`). + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (AgentShutdown) + public async System.Threading.Tasks.Task> ShutdownTunnelAgentWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default) + { + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/tunnel-agent/shutdown", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ShutdownTunnelAgent", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Resign an app/IPA Resign an uploaded app/IPA with an uploaded P12 identity and provisioning profile, returning the signed IPA. Synchronous. Host-scoped. + /// + /// Thrown when fails to make API call + /// + /// + /// + /// P12 password. (optional) + /// Override bundle id. (optional) + /// Object + public Object SignApp(Object ipa, Object p12file, Object profile, string? p12password = default, string? bundleid = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = SignAppWithHttpInfo(ipa, p12file, profile, p12password, bundleid); + return localVarResponse.Data; + } + + /// + /// Resign an app/IPA Resign an uploaded app/IPA with an uploaded P12 identity and provisioning profile, returning the signed IPA. Synchronous. Host-scoped. + /// + /// Thrown when fails to make API call + /// + /// + /// + /// P12 password. (optional) + /// Override bundle id. (optional) + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse SignAppWithHttpInfo(Object ipa, Object p12file, Object profile, string? p12password = default, string? bundleid = default) + { + // verify the required parameter 'ipa' is set + if (ipa == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'ipa' when calling DefaultApi->SignApp"); + + // verify the required parameter 'p12file' is set + if (p12file == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'p12file' when calling DefaultApi->SignApp"); + + // verify the required parameter 'profile' is set + if (profile == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'profile' when calling DefaultApi->SignApp"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/octet-stream", + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.FormParameters.Add("ipa", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(ipa)); // form parameter + localVarRequestOptions.FormParameters.Add("p12file", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(p12file)); // form parameter + localVarRequestOptions.FormParameters.Add("profile", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(profile)); // form parameter + if (p12password != null) + { + localVarRequestOptions.FormParameters.Add("p12password", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(p12password)); // form parameter + } + if (bundleid != null) + { + localVarRequestOptions.FormParameters.Add("bundleid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(bundleid)); // form parameter + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/sign/app", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SignApp", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Resign an app/IPA Resign an uploaded app/IPA with an uploaded P12 identity and provisioning profile, returning the signed IPA. Synchronous. Host-scoped. + /// + /// Thrown when fails to make API call + /// + /// + /// + /// P12 password. (optional) + /// Override bundle id. (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task SignAppAsync(Object ipa, Object p12file, Object profile, string? p12password = default, string? bundleid = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await SignAppWithHttpInfoAsync(ipa, p12file, profile, p12password, bundleid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Resign an app/IPA Resign an uploaded app/IPA with an uploaded P12 identity and provisioning profile, returning the signed IPA. Synchronous. Host-scoped. + /// + /// Thrown when fails to make API call + /// + /// + /// + /// P12 password. (optional) + /// Override bundle id. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> SignAppWithHttpInfoAsync(Object ipa, Object p12file, Object profile, string? p12password = default, string? bundleid = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'ipa' is set + if (ipa == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'ipa' when calling DefaultApi->SignApp"); + + // verify the required parameter 'p12file' is set + if (p12file == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'p12file' when calling DefaultApi->SignApp"); + + // verify the required parameter 'profile' is set + if (profile == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'profile' when calling DefaultApi->SignApp"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/octet-stream", + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.FormParameters.Add("ipa", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(ipa)); // form parameter + localVarRequestOptions.FormParameters.Add("p12file", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(p12file)); // form parameter + localVarRequestOptions.FormParameters.Add("profile", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(profile)); // form parameter + if (p12password != null) + { + localVarRequestOptions.FormParameters.Add("p12password", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(p12password)); // form parameter + } + if (bundleid != null) + { + localVarRequestOptions.FormParameters.Add("bundleid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(bundleid)); // form parameter + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/sign/app", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SignApp", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Create a signing certificate Create one App Store Connect signing certificate and return its P12 (certificate + private key) as a downloadable `application/x-pkcs12` file. The P12 password is echoed in the `X-P12-Password` response header and the certificate resource id in `X-Certificate-Id`. Host-scoped (device-free). + /// + /// Thrown when fails to make API call + /// + /// App Store Connect key id. + /// App Store Connect issuer id. + /// Revoke existing iOS Development certificates first. (optional) + /// Password to protect the generated P12. (optional) + /// Object + public Object SignCertificate(Object ascPrivateKey, string ascKeyId, string ascIssuerId, string? revokeExisting = default, string? p12password = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = SignCertificateWithHttpInfo(ascPrivateKey, ascKeyId, ascIssuerId, revokeExisting, p12password); + return localVarResponse.Data; + } + + /// + /// Create a signing certificate Create one App Store Connect signing certificate and return its P12 (certificate + private key) as a downloadable `application/x-pkcs12` file. The P12 password is echoed in the `X-P12-Password` response header and the certificate resource id in `X-Certificate-Id`. Host-scoped (device-free). + /// + /// Thrown when fails to make API call + /// + /// App Store Connect key id. + /// App Store Connect issuer id. + /// Revoke existing iOS Development certificates first. (optional) + /// Password to protect the generated P12. (optional) + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse SignCertificateWithHttpInfo(Object ascPrivateKey, string ascKeyId, string ascIssuerId, string? revokeExisting = default, string? p12password = default) + { + // verify the required parameter 'ascPrivateKey' is set + if (ascPrivateKey == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'ascPrivateKey' when calling DefaultApi->SignCertificate"); + + // verify the required parameter 'ascKeyId' is set + if (ascKeyId == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'ascKeyId' when calling DefaultApi->SignCertificate"); + + // verify the required parameter 'ascIssuerId' is set + if (ascIssuerId == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'ascIssuerId' when calling DefaultApi->SignCertificate"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/x-pkcs12", + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.FormParameters.Add("asc-private-key", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(ascPrivateKey)); // form parameter + localVarRequestOptions.FormParameters.Add("asc-key-id", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(ascKeyId)); // form parameter + localVarRequestOptions.FormParameters.Add("asc-issuer-id", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(ascIssuerId)); // form parameter + if (revokeExisting != null) + { + localVarRequestOptions.FormParameters.Add("revoke-existing", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(revokeExisting)); // form parameter + } + if (p12password != null) + { + localVarRequestOptions.FormParameters.Add("p12password", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(p12password)); // form parameter + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/sign/certificate", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SignCertificate", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Create a signing certificate Create one App Store Connect signing certificate and return its P12 (certificate + private key) as a downloadable `application/x-pkcs12` file. The P12 password is echoed in the `X-P12-Password` response header and the certificate resource id in `X-Certificate-Id`. Host-scoped (device-free). + /// + /// Thrown when fails to make API call + /// + /// App Store Connect key id. + /// App Store Connect issuer id. + /// Revoke existing iOS Development certificates first. (optional) + /// Password to protect the generated P12. (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task SignCertificateAsync(Object ascPrivateKey, string ascKeyId, string ascIssuerId, string? revokeExisting = default, string? p12password = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await SignCertificateWithHttpInfoAsync(ascPrivateKey, ascKeyId, ascIssuerId, revokeExisting, p12password, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Create a signing certificate Create one App Store Connect signing certificate and return its P12 (certificate + private key) as a downloadable `application/x-pkcs12` file. The P12 password is echoed in the `X-P12-Password` response header and the certificate resource id in `X-Certificate-Id`. Host-scoped (device-free). + /// + /// Thrown when fails to make API call + /// + /// App Store Connect key id. + /// App Store Connect issuer id. + /// Revoke existing iOS Development certificates first. (optional) + /// Password to protect the generated P12. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> SignCertificateWithHttpInfoAsync(Object ascPrivateKey, string ascKeyId, string ascIssuerId, string? revokeExisting = default, string? p12password = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'ascPrivateKey' is set + if (ascPrivateKey == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'ascPrivateKey' when calling DefaultApi->SignCertificate"); + + // verify the required parameter 'ascKeyId' is set + if (ascKeyId == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'ascKeyId' when calling DefaultApi->SignCertificate"); + + // verify the required parameter 'ascIssuerId' is set + if (ascIssuerId == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'ascIssuerId' when calling DefaultApi->SignCertificate"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/x-pkcs12", + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.FormParameters.Add("asc-private-key", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(ascPrivateKey)); // form parameter + localVarRequestOptions.FormParameters.Add("asc-key-id", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(ascKeyId)); // form parameter + localVarRequestOptions.FormParameters.Add("asc-issuer-id", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(ascIssuerId)); // form parameter + if (revokeExisting != null) + { + localVarRequestOptions.FormParameters.Add("revoke-existing", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(revokeExisting)); // form parameter + } + if (p12password != null) + { + localVarRequestOptions.FormParameters.Add("p12password", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(p12password)); // form parameter + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/sign/certificate", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SignCertificate", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Create a provisioning profile + P12 Create a bundle id, development certificate and provisioning profile via App Store Connect and return both artifacts base64-encoded in a JSON envelope. The target device udid is supplied as a form field. Host-scoped. + /// + /// Thrown when fails to make API call + /// + /// App Store Connect key id. + /// App Store Connect issuer id. + /// App bundle identifier. + /// Target device udid to register against the profile. + /// Bundle display name. (optional) + /// Provisioning profile name. (optional) + /// Device display name. (optional) + /// Reuse an existing certificate (no new P12 is generated). (optional) + /// Revoke existing certificates first. (optional) + /// Password to protect the generated P12. (optional) + /// ProvisioningResult + public ProvisioningResult SignProvision(Object ascPrivateKey, string ascKeyId, string ascIssuerId, string bundleid, string udid, string? bundlename = default, string? profilename = default, string? devicename = default, string? certificateId = default, string? revokeExisting = default, string? p12password = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = SignProvisionWithHttpInfo(ascPrivateKey, ascKeyId, ascIssuerId, bundleid, udid, bundlename, profilename, devicename, certificateId, revokeExisting, p12password); + return localVarResponse.Data; + } + + /// + /// Create a provisioning profile + P12 Create a bundle id, development certificate and provisioning profile via App Store Connect and return both artifacts base64-encoded in a JSON envelope. The target device udid is supplied as a form field. Host-scoped. + /// + /// Thrown when fails to make API call + /// + /// App Store Connect key id. + /// App Store Connect issuer id. + /// App bundle identifier. + /// Target device udid to register against the profile. + /// Bundle display name. (optional) + /// Provisioning profile name. (optional) + /// Device display name. (optional) + /// Reuse an existing certificate (no new P12 is generated). (optional) + /// Revoke existing certificates first. (optional) + /// Password to protect the generated P12. (optional) + /// ApiResponse of ProvisioningResult + public GoIos.Sdk.Generated.Client.ApiResponse SignProvisionWithHttpInfo(Object ascPrivateKey, string ascKeyId, string ascIssuerId, string bundleid, string udid, string? bundlename = default, string? profilename = default, string? devicename = default, string? certificateId = default, string? revokeExisting = default, string? p12password = default) + { + // verify the required parameter 'ascPrivateKey' is set + if (ascPrivateKey == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'ascPrivateKey' when calling DefaultApi->SignProvision"); + + // verify the required parameter 'ascKeyId' is set + if (ascKeyId == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'ascKeyId' when calling DefaultApi->SignProvision"); + + // verify the required parameter 'ascIssuerId' is set + if (ascIssuerId == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'ascIssuerId' when calling DefaultApi->SignProvision"); + + // verify the required parameter 'bundleid' is set + if (bundleid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'bundleid' when calling DefaultApi->SignProvision"); + + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->SignProvision"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.FormParameters.Add("asc-private-key", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(ascPrivateKey)); // form parameter + localVarRequestOptions.FormParameters.Add("asc-key-id", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(ascKeyId)); // form parameter + localVarRequestOptions.FormParameters.Add("asc-issuer-id", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(ascIssuerId)); // form parameter + localVarRequestOptions.FormParameters.Add("bundleid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(bundleid)); // form parameter + localVarRequestOptions.FormParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // form parameter + if (bundlename != null) + { + localVarRequestOptions.FormParameters.Add("bundlename", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(bundlename)); // form parameter + } + if (profilename != null) + { + localVarRequestOptions.FormParameters.Add("profilename", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(profilename)); // form parameter + } + if (devicename != null) + { + localVarRequestOptions.FormParameters.Add("devicename", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(devicename)); // form parameter + } + if (certificateId != null) + { + localVarRequestOptions.FormParameters.Add("certificate-id", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(certificateId)); // form parameter + } + if (revokeExisting != null) + { + localVarRequestOptions.FormParameters.Add("revoke-existing", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(revokeExisting)); // form parameter + } + if (p12password != null) + { + localVarRequestOptions.FormParameters.Add("p12password", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(p12password)); // form parameter + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/sign/provision", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SignProvision", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Create a provisioning profile + P12 Create a bundle id, development certificate and provisioning profile via App Store Connect and return both artifacts base64-encoded in a JSON envelope. The target device udid is supplied as a form field. Host-scoped. + /// + /// Thrown when fails to make API call + /// + /// App Store Connect key id. + /// App Store Connect issuer id. + /// App bundle identifier. + /// Target device udid to register against the profile. + /// Bundle display name. (optional) + /// Provisioning profile name. (optional) + /// Device display name. (optional) + /// Reuse an existing certificate (no new P12 is generated). (optional) + /// Revoke existing certificates first. (optional) + /// Password to protect the generated P12. (optional) + /// Cancellation Token to cancel the request. + /// Task of ProvisioningResult + public async System.Threading.Tasks.Task SignProvisionAsync(Object ascPrivateKey, string ascKeyId, string ascIssuerId, string bundleid, string udid, string? bundlename = default, string? profilename = default, string? devicename = default, string? certificateId = default, string? revokeExisting = default, string? p12password = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await SignProvisionWithHttpInfoAsync(ascPrivateKey, ascKeyId, ascIssuerId, bundleid, udid, bundlename, profilename, devicename, certificateId, revokeExisting, p12password, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Create a provisioning profile + P12 Create a bundle id, development certificate and provisioning profile via App Store Connect and return both artifacts base64-encoded in a JSON envelope. The target device udid is supplied as a form field. Host-scoped. + /// + /// Thrown when fails to make API call + /// + /// App Store Connect key id. + /// App Store Connect issuer id. + /// App bundle identifier. + /// Target device udid to register against the profile. + /// Bundle display name. (optional) + /// Provisioning profile name. (optional) + /// Device display name. (optional) + /// Reuse an existing certificate (no new P12 is generated). (optional) + /// Revoke existing certificates first. (optional) + /// Password to protect the generated P12. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ProvisioningResult) + public async System.Threading.Tasks.Task> SignProvisionWithHttpInfoAsync(Object ascPrivateKey, string ascKeyId, string ascIssuerId, string bundleid, string udid, string? bundlename = default, string? profilename = default, string? devicename = default, string? certificateId = default, string? revokeExisting = default, string? p12password = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'ascPrivateKey' is set + if (ascPrivateKey == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'ascPrivateKey' when calling DefaultApi->SignProvision"); + + // verify the required parameter 'ascKeyId' is set + if (ascKeyId == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'ascKeyId' when calling DefaultApi->SignProvision"); + + // verify the required parameter 'ascIssuerId' is set + if (ascIssuerId == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'ascIssuerId' when calling DefaultApi->SignProvision"); + + // verify the required parameter 'bundleid' is set + if (bundleid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'bundleid' when calling DefaultApi->SignProvision"); + + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->SignProvision"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.FormParameters.Add("asc-private-key", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(ascPrivateKey)); // form parameter + localVarRequestOptions.FormParameters.Add("asc-key-id", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(ascKeyId)); // form parameter + localVarRequestOptions.FormParameters.Add("asc-issuer-id", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(ascIssuerId)); // form parameter + localVarRequestOptions.FormParameters.Add("bundleid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(bundleid)); // form parameter + localVarRequestOptions.FormParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // form parameter + if (bundlename != null) + { + localVarRequestOptions.FormParameters.Add("bundlename", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(bundlename)); // form parameter + } + if (profilename != null) + { + localVarRequestOptions.FormParameters.Add("profilename", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(profilename)); // form parameter + } + if (devicename != null) + { + localVarRequestOptions.FormParameters.Add("devicename", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(devicename)); // form parameter + } + if (certificateId != null) + { + localVarRequestOptions.FormParameters.Add("certificate-id", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(certificateId)); // form parameter + } + if (revokeExisting != null) + { + localVarRequestOptions.FormParameters.Add("revoke-existing", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(revokeExisting)); // form parameter + } + if (p12password != null) + { + localVarRequestOptions.FormParameters.Add("p12password", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(p12password)); // form parameter + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/sign/provision", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SignProvision", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Stop tunnel Stop the tunnel for a device (CLI: `ios tunnel stop - -udid`). + /// + /// Thrown when fails to make API call + /// + /// TunnelStopped + public TunnelStopped StopTunnel(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = StopTunnelWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// Stop tunnel Stop the tunnel for a device (CLI: `ios tunnel stop - -udid`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of TunnelStopped + public GoIos.Sdk.Generated.Client.ApiResponse StopTunnelWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->StopTunnel"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Delete("/api/v1/tunnels/{udid}", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("StopTunnel", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Stop tunnel Stop the tunnel for a device (CLI: `ios tunnel stop - -udid`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of TunnelStopped + public async System.Threading.Tasks.Task StopTunnelAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await StopTunnelWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Stop tunnel Stop the tunnel for a device (CLI: `ios tunnel stop - -udid`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (TunnelStopped) + public async System.Threading.Tasks.Task> StopTunnelWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->StopTunnel"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/api/v1/tunnels/{udid}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("StopTunnel", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Stream a live pcap capture (binary) Stream a live packet capture from the device as a libpcap byte stream (pipeable into wireshark/tshark). Runs until `timeout` (seconds) elapses, the default timeout is reached, or the client disconnects. + /// + /// Thrown when fails to make API call + /// + /// Capture duration in seconds (default 60, max 3600). (optional) + /// Object + public Object StreamsPcap(string udid, int? timeout = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = StreamsPcapWithHttpInfo(udid, timeout); + return localVarResponse.Data; + } + + /// + /// Stream a live pcap capture (binary) Stream a live packet capture from the device as a libpcap byte stream (pipeable into wireshark/tshark). Runs until `timeout` (seconds) elapses, the default timeout is reached, or the client disconnects. + /// + /// Thrown when fails to make API call + /// + /// Capture duration in seconds (default 60, max 3600). (optional) + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse StreamsPcapWithHttpInfo(string udid, int? timeout = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->StreamsPcap"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/vnd.tcpdump.pcap", + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/pcap", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("StreamsPcap", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Stream a live pcap capture (binary) Stream a live packet capture from the device as a libpcap byte stream (pipeable into wireshark/tshark). Runs until `timeout` (seconds) elapses, the default timeout is reached, or the client disconnects. + /// + /// Thrown when fails to make API call + /// + /// Capture duration in seconds (default 60, max 3600). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task StreamsPcapAsync(string udid, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await StreamsPcapWithHttpInfoAsync(udid, timeout, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Stream a live pcap capture (binary) Stream a live packet capture from the device as a libpcap byte stream (pipeable into wireshark/tshark). Runs until `timeout` (seconds) elapses, the default timeout is reached, or the client disconnects. + /// + /// Thrown when fails to make API call + /// + /// Capture duration in seconds (default 60, max 3600). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> StreamsPcapWithHttpInfoAsync(string udid, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->StreamsPcap"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/vnd.tcpdump.pcap", + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/pcap", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("StreamsPcap", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Stream screenshots as MJPEG (binary) Serve an MJPEG (multipart/x-mixed-replace) stream of device screenshots captured via the instruments screenshot service. Streams until the client disconnects or the source fails. + /// + /// Thrown when fails to make API call + /// + /// Optional JPEG quality (1–100, default 80). (optional) + /// Object + public Object StreamsScreenshotStream(string udid, int? quality = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = StreamsScreenshotStreamWithHttpInfo(udid, quality); + return localVarResponse.Data; + } + + /// + /// Stream screenshots as MJPEG (binary) Serve an MJPEG (multipart/x-mixed-replace) stream of device screenshots captured via the instruments screenshot service. Streams until the client disconnects or the source fails. + /// + /// Thrown when fails to make API call + /// + /// Optional JPEG quality (1–100, default 80). (optional) + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse StreamsScreenshotStreamWithHttpInfo(string udid, int? quality = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->StreamsScreenshotStream"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "image/jpeg", + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (quality != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "quality", quality)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/screenshot/stream", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("StreamsScreenshotStream", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Stream screenshots as MJPEG (binary) Serve an MJPEG (multipart/x-mixed-replace) stream of device screenshots captured via the instruments screenshot service. Streams until the client disconnects or the source fails. + /// + /// Thrown when fails to make API call + /// + /// Optional JPEG quality (1–100, default 80). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task StreamsScreenshotStreamAsync(string udid, int? quality = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await StreamsScreenshotStreamWithHttpInfoAsync(udid, quality, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Stream screenshots as MJPEG (binary) Serve an MJPEG (multipart/x-mixed-replace) stream of device screenshots captured via the instruments screenshot service. Streams until the client disconnects or the source fails. + /// + /// Thrown when fails to make API call + /// + /// Optional JPEG quality (1–100, default 80). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> StreamsScreenshotStreamWithHttpInfoAsync(string udid, int? quality = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->StreamsScreenshotStream"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "image/jpeg", + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (quality != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "quality", quality)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/screenshot/stream", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("StreamsScreenshotStream", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Stream UI video (binary) Open a live UI video stream against a forwarded WDA/DeviceKit backend and pipe it straight through to the client. Default codec is MJPEG (multipart/x-mixed-replace); `codec=h264` returns an H.264 elementary stream (requires the devicekit backend). Streams until the client disconnects or the backend ends. Requires a running, forwarded WDA/DeviceKit backend (see the UI routes). + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Video codec: `mjpeg` (default) or `h264` (devicekit backend only). (optional) + /// Target frames per second (backend-dependent). (optional) + /// JPEG quality for the mjpeg codec. (optional) + /// Scale factor (backend-dependent). (optional) + /// Target bitrate for the h264 codec. (optional) + /// Object + public Object StreamsUiStream(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default, string? codec = default, string? fps = default, string? quality = default, string? scale = default, string? bitrate = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = StreamsUiStreamWithHttpInfo(udid, backend, wdaUrl, timeout, codec, fps, quality, scale, bitrate); + return localVarResponse.Data; + } + + /// + /// Stream UI video (binary) Open a live UI video stream against a forwarded WDA/DeviceKit backend and pipe it straight through to the client. Default codec is MJPEG (multipart/x-mixed-replace); `codec=h264` returns an H.264 elementary stream (requires the devicekit backend). Streams until the client disconnects or the backend ends. Requires a running, forwarded WDA/DeviceKit backend (see the UI routes). + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Video codec: `mjpeg` (default) or `h264` (devicekit backend only). (optional) + /// Target frames per second (backend-dependent). (optional) + /// JPEG quality for the mjpeg codec. (optional) + /// Scale factor (backend-dependent). (optional) + /// Target bitrate for the h264 codec. (optional) + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse StreamsUiStreamWithHttpInfo(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default, string? codec = default, string? fps = default, string? quality = default, string? scale = default, string? bitrate = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->StreamsUiStream"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/octet-stream", + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (backend != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "backend", backend)); + } + if (wdaUrl != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "wdaUrl", wdaUrl)); + } + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + if (codec != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "codec", codec)); + } + if (fps != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "fps", fps)); + } + if (quality != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "quality", quality)); + } + if (scale != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "scale", scale)); + } + if (bitrate != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "bitrate", bitrate)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/ui/stream", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("StreamsUiStream", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Stream UI video (binary) Open a live UI video stream against a forwarded WDA/DeviceKit backend and pipe it straight through to the client. Default codec is MJPEG (multipart/x-mixed-replace); `codec=h264` returns an H.264 elementary stream (requires the devicekit backend). Streams until the client disconnects or the backend ends. Requires a running, forwarded WDA/DeviceKit backend (see the UI routes). + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Video codec: `mjpeg` (default) or `h264` (devicekit backend only). (optional) + /// Target frames per second (backend-dependent). (optional) + /// JPEG quality for the mjpeg codec. (optional) + /// Scale factor (backend-dependent). (optional) + /// Target bitrate for the h264 codec. (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task StreamsUiStreamAsync(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default, string? codec = default, string? fps = default, string? quality = default, string? scale = default, string? bitrate = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await StreamsUiStreamWithHttpInfoAsync(udid, backend, wdaUrl, timeout, codec, fps, quality, scale, bitrate, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Stream UI video (binary) Open a live UI video stream against a forwarded WDA/DeviceKit backend and pipe it straight through to the client. Default codec is MJPEG (multipart/x-mixed-replace); `codec=h264` returns an H.264 elementary stream (requires the devicekit backend). Streams until the client disconnects or the backend ends. Requires a running, forwarded WDA/DeviceKit backend (see the UI routes). + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Video codec: `mjpeg` (default) or `h264` (devicekit backend only). (optional) + /// Target frames per second (backend-dependent). (optional) + /// JPEG quality for the mjpeg codec. (optional) + /// Scale factor (backend-dependent). (optional) + /// Target bitrate for the h264 codec. (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> StreamsUiStreamWithHttpInfoAsync(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default, string? codec = default, string? fps = default, string? quality = default, string? scale = default, string? bitrate = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->StreamsUiStream"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/octet-stream", + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (backend != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "backend", backend)); + } + if (wdaUrl != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "wdaUrl", wdaUrl)); + } + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + if (codec != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "codec", codec)); + } + if (fps != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "fps", fps)); + } + if (quality != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "quality", quality)); + } + if (scale != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "scale", scale)); + } + if (bitrate != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "bitrate", bitrate)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/ui/stream", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("StreamsUiStream", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Raw backend passthrough Raw passthrough to the backend. For WDA supply `method`/`path`/`body`; for DeviceKit supply `rpcMethod`/`rpcParams`. The backend response is forwarded verbatim. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Object + public Object UIUiApi(string udid, UIAPIRequest uIAPIRequest, string? backend = default, string? wdaUrl = default, int? timeout = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = UIUiApiWithHttpInfo(udid, uIAPIRequest, backend, wdaUrl, timeout); + return localVarResponse.Data; + } + + /// + /// Raw backend passthrough Raw passthrough to the backend. For WDA supply `method`/`path`/`body`; for DeviceKit supply `rpcMethod`/`rpcParams`. The backend response is forwarded verbatim. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse UIUiApiWithHttpInfo(string udid, UIAPIRequest uIAPIRequest, string? backend = default, string? wdaUrl = default, int? timeout = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->UIUiApi"); + + // verify the required parameter 'uIAPIRequest' is set + if (uIAPIRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'uIAPIRequest' when calling DefaultApi->UIUiApi"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (backend != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "backend", backend)); + } + if (wdaUrl != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "wdaUrl", wdaUrl)); + } + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + localVarRequestOptions.Data = uIAPIRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/ui/api", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UIUiApi", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Raw backend passthrough Raw passthrough to the backend. For WDA supply `method`/`path`/`body`; for DeviceKit supply `rpcMethod`/`rpcParams`. The backend response is forwarded verbatim. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task UIUiApiAsync(string udid, UIAPIRequest uIAPIRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await UIUiApiWithHttpInfoAsync(udid, uIAPIRequest, backend, wdaUrl, timeout, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Raw backend passthrough Raw passthrough to the backend. For WDA supply `method`/`path`/`body`; for DeviceKit supply `rpcMethod`/`rpcParams`. The backend response is forwarded verbatim. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> UIUiApiWithHttpInfoAsync(string udid, UIAPIRequest uIAPIRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->UIUiApi"); + + // verify the required parameter 'uIAPIRequest' is set + if (uIAPIRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'uIAPIRequest' when calling DefaultApi->UIUiApi"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (backend != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "backend", backend)); + } + if (wdaUrl != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "wdaUrl", wdaUrl)); + } + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + localVarRequestOptions.Data = uIAPIRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/ui/api", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UIUiApi", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Foreground app (UI backend) Bring the backgrounded app to the foreground. Only the devicekit backend supports this; WDA returns `501`. The request body is ignored. + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Object + public Object UIUiAppForeground(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = UIUiAppForegroundWithHttpInfo(udid, backend, wdaUrl, timeout); + return localVarResponse.Data; + } + + /// + /// Foreground app (UI backend) Bring the backgrounded app to the foreground. Only the devicekit backend supports this; WDA returns `501`. The request body is ignored. + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse UIUiAppForegroundWithHttpInfo(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->UIUiAppForeground"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (backend != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "backend", backend)); + } + if (wdaUrl != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "wdaUrl", wdaUrl)); + } + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/ui/app/foreground", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UIUiAppForeground", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Foreground app (UI backend) Bring the backgrounded app to the foreground. Only the devicekit backend supports this; WDA returns `501`. The request body is ignored. + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task UIUiAppForegroundAsync(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await UIUiAppForegroundWithHttpInfoAsync(udid, backend, wdaUrl, timeout, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Foreground app (UI backend) Bring the backgrounded app to the foreground. Only the devicekit backend supports this; WDA returns `501`. The request body is ignored. + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> UIUiAppForegroundWithHttpInfoAsync(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->UIUiAppForeground"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (backend != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "backend", backend)); + } + if (wdaUrl != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "wdaUrl", wdaUrl)); + } + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/ui/app/foreground", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UIUiAppForeground", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Launch app (UI backend) Launch the app identified by `bundleId`. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Object + public Object UIUiAppLaunch(string udid, UIAppRequest uIAppRequest, string? backend = default, string? wdaUrl = default, int? timeout = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = UIUiAppLaunchWithHttpInfo(udid, uIAppRequest, backend, wdaUrl, timeout); + return localVarResponse.Data; + } + + /// + /// Launch app (UI backend) Launch the app identified by `bundleId`. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse UIUiAppLaunchWithHttpInfo(string udid, UIAppRequest uIAppRequest, string? backend = default, string? wdaUrl = default, int? timeout = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->UIUiAppLaunch"); + + // verify the required parameter 'uIAppRequest' is set + if (uIAppRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'uIAppRequest' when calling DefaultApi->UIUiAppLaunch"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (backend != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "backend", backend)); + } + if (wdaUrl != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "wdaUrl", wdaUrl)); + } + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + localVarRequestOptions.Data = uIAppRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/ui/app/launch", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UIUiAppLaunch", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Launch app (UI backend) Launch the app identified by `bundleId`. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task UIUiAppLaunchAsync(string udid, UIAppRequest uIAppRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await UIUiAppLaunchWithHttpInfoAsync(udid, uIAppRequest, backend, wdaUrl, timeout, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Launch app (UI backend) Launch the app identified by `bundleId`. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> UIUiAppLaunchWithHttpInfoAsync(string udid, UIAppRequest uIAppRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->UIUiAppLaunch"); + + // verify the required parameter 'uIAppRequest' is set + if (uIAppRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'uIAppRequest' when calling DefaultApi->UIUiAppLaunch"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (backend != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "backend", backend)); + } + if (wdaUrl != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "wdaUrl", wdaUrl)); + } + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + localVarRequestOptions.Data = uIAppRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/ui/app/launch", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UIUiAppLaunch", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Terminate app (UI backend) Terminate the app identified by `bundleId`. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Object + public Object UIUiAppTerminate(string udid, UIAppRequest uIAppRequest, string? backend = default, string? wdaUrl = default, int? timeout = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = UIUiAppTerminateWithHttpInfo(udid, uIAppRequest, backend, wdaUrl, timeout); + return localVarResponse.Data; + } + + /// + /// Terminate app (UI backend) Terminate the app identified by `bundleId`. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse UIUiAppTerminateWithHttpInfo(string udid, UIAppRequest uIAppRequest, string? backend = default, string? wdaUrl = default, int? timeout = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->UIUiAppTerminate"); + + // verify the required parameter 'uIAppRequest' is set + if (uIAppRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'uIAppRequest' when calling DefaultApi->UIUiAppTerminate"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (backend != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "backend", backend)); + } + if (wdaUrl != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "wdaUrl", wdaUrl)); + } + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + localVarRequestOptions.Data = uIAppRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/ui/app/terminate", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UIUiAppTerminate", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Terminate app (UI backend) Terminate the app identified by `bundleId`. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task UIUiAppTerminateAsync(string udid, UIAppRequest uIAppRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await UIUiAppTerminateWithHttpInfoAsync(udid, uIAppRequest, backend, wdaUrl, timeout, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Terminate app (UI backend) Terminate the app identified by `bundleId`. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> UIUiAppTerminateWithHttpInfoAsync(string udid, UIAppRequest uIAppRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->UIUiAppTerminate"); + + // verify the required parameter 'uIAppRequest' is set + if (uIAppRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'uIAppRequest' when calling DefaultApi->UIUiAppTerminate"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (backend != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "backend", backend)); + } + if (wdaUrl != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "wdaUrl", wdaUrl)); + } + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + localVarRequestOptions.Data = uIAppRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/ui/app/terminate", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UIUiAppTerminate", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Press hardware button Press a hardware button by name (WDA supports only `home`). + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Object + public Object UIUiButton(string udid, UIButtonRequest uIButtonRequest, string? backend = default, string? wdaUrl = default, int? timeout = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = UIUiButtonWithHttpInfo(udid, uIButtonRequest, backend, wdaUrl, timeout); + return localVarResponse.Data; + } + + /// + /// Press hardware button Press a hardware button by name (WDA supports only `home`). + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse UIUiButtonWithHttpInfo(string udid, UIButtonRequest uIButtonRequest, string? backend = default, string? wdaUrl = default, int? timeout = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->UIUiButton"); + + // verify the required parameter 'uIButtonRequest' is set + if (uIButtonRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'uIButtonRequest' when calling DefaultApi->UIUiButton"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (backend != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "backend", backend)); + } + if (wdaUrl != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "wdaUrl", wdaUrl)); + } + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + localVarRequestOptions.Data = uIButtonRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/ui/button", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UIUiButton", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Press hardware button Press a hardware button by name (WDA supports only `home`). + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task UIUiButtonAsync(string udid, UIButtonRequest uIButtonRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await UIUiButtonWithHttpInfoAsync(udid, uIButtonRequest, backend, wdaUrl, timeout, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Press hardware button Press a hardware button by name (WDA supports only `home`). + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> UIUiButtonWithHttpInfoAsync(string udid, UIButtonRequest uIButtonRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->UIUiButton"); + + // verify the required parameter 'uIButtonRequest' is set + if (uIButtonRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'uIButtonRequest' when calling DefaultApi->UIUiButton"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (backend != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "backend", backend)); + } + if (wdaUrl != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "wdaUrl", wdaUrl)); + } + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + localVarRequestOptions.Data = uIButtonRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/ui/button", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UIUiButton", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get orientation Get the current device orientation payload. + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Object + public Object UIUiGetOrientation(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = UIUiGetOrientationWithHttpInfo(udid, backend, wdaUrl, timeout); + return localVarResponse.Data; + } + + /// + /// Get orientation Get the current device orientation payload. + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse UIUiGetOrientationWithHttpInfo(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->UIUiGetOrientation"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (backend != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "backend", backend)); + } + if (wdaUrl != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "wdaUrl", wdaUrl)); + } + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/ui/orientation", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UIUiGetOrientation", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get orientation Get the current device orientation payload. + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task UIUiGetOrientationAsync(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await UIUiGetOrientationWithHttpInfoAsync(udid, backend, wdaUrl, timeout, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get orientation Get the current device orientation payload. + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> UIUiGetOrientationWithHttpInfoAsync(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->UIUiGetOrientation"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (backend != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "backend", backend)); + } + if (wdaUrl != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "wdaUrl", wdaUrl)); + } + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/ui/orientation", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UIUiGetOrientation", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Long press Press and hold at (x,y). + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Object + public Object UIUiLongPress(string udid, UILongPressRequest uILongPressRequest, string? backend = default, string? wdaUrl = default, int? timeout = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = UIUiLongPressWithHttpInfo(udid, uILongPressRequest, backend, wdaUrl, timeout); + return localVarResponse.Data; + } + + /// + /// Long press Press and hold at (x,y). + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse UIUiLongPressWithHttpInfo(string udid, UILongPressRequest uILongPressRequest, string? backend = default, string? wdaUrl = default, int? timeout = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->UIUiLongPress"); + + // verify the required parameter 'uILongPressRequest' is set + if (uILongPressRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'uILongPressRequest' when calling DefaultApi->UIUiLongPress"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (backend != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "backend", backend)); + } + if (wdaUrl != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "wdaUrl", wdaUrl)); + } + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + localVarRequestOptions.Data = uILongPressRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/ui/longpress", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UIUiLongPress", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Long press Press and hold at (x,y). + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task UIUiLongPressAsync(string udid, UILongPressRequest uILongPressRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await UIUiLongPressWithHttpInfoAsync(udid, uILongPressRequest, backend, wdaUrl, timeout, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Long press Press and hold at (x,y). + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> UIUiLongPressWithHttpInfoAsync(string udid, UILongPressRequest uILongPressRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->UIUiLongPress"); + + // verify the required parameter 'uILongPressRequest' is set + if (uILongPressRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'uILongPressRequest' when calling DefaultApi->UIUiLongPress"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (backend != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "backend", backend)); + } + if (wdaUrl != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "wdaUrl", wdaUrl)); + } + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + localVarRequestOptions.Data = uILongPressRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/ui/longpress", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UIUiLongPress", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// UI screenshot (PNG) Capture the screen and return raw PNG bytes. + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Object + public Object UIUiScreenshot(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = UIUiScreenshotWithHttpInfo(udid, backend, wdaUrl, timeout); + return localVarResponse.Data; + } + + /// + /// UI screenshot (PNG) Capture the screen and return raw PNG bytes. + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse UIUiScreenshotWithHttpInfo(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->UIUiScreenshot"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "image/png", + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (backend != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "backend", backend)); + } + if (wdaUrl != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "wdaUrl", wdaUrl)); + } + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/ui/screenshot", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UIUiScreenshot", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// UI screenshot (PNG) Capture the screen and return raw PNG bytes. + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task UIUiScreenshotAsync(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await UIUiScreenshotWithHttpInfoAsync(udid, backend, wdaUrl, timeout, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// UI screenshot (PNG) Capture the screen and return raw PNG bytes. + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> UIUiScreenshotWithHttpInfoAsync(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->UIUiScreenshot"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "image/png", + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (backend != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "backend", backend)); + } + if (wdaUrl != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "wdaUrl", wdaUrl)); + } + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/ui/screenshot", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UIUiScreenshot", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Set orientation Set the device orientation. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Object + public Object UIUiSetOrientation(string udid, UIOrientationRequest uIOrientationRequest, string? backend = default, string? wdaUrl = default, int? timeout = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = UIUiSetOrientationWithHttpInfo(udid, uIOrientationRequest, backend, wdaUrl, timeout); + return localVarResponse.Data; + } + + /// + /// Set orientation Set the device orientation. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse UIUiSetOrientationWithHttpInfo(string udid, UIOrientationRequest uIOrientationRequest, string? backend = default, string? wdaUrl = default, int? timeout = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->UIUiSetOrientation"); + + // verify the required parameter 'uIOrientationRequest' is set + if (uIOrientationRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'uIOrientationRequest' when calling DefaultApi->UIUiSetOrientation"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (backend != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "backend", backend)); + } + if (wdaUrl != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "wdaUrl", wdaUrl)); + } + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + localVarRequestOptions.Data = uIOrientationRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/api/v1/device/{udid}/ui/orientation", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UIUiSetOrientation", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Set orientation Set the device orientation. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task UIUiSetOrientationAsync(string udid, UIOrientationRequest uIOrientationRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await UIUiSetOrientationWithHttpInfoAsync(udid, uIOrientationRequest, backend, wdaUrl, timeout, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Set orientation Set the device orientation. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> UIUiSetOrientationWithHttpInfoAsync(string udid, UIOrientationRequest uIOrientationRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->UIUiSetOrientation"); + + // verify the required parameter 'uIOrientationRequest' is set + if (uIOrientationRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'uIOrientationRequest' when calling DefaultApi->UIUiSetOrientation"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (backend != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "backend", backend)); + } + if (wdaUrl != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "wdaUrl", wdaUrl)); + } + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + localVarRequestOptions.Data = uIOrientationRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PutAsync("/api/v1/device/{udid}/ui/orientation", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UIUiSetOrientation", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// UI source hierarchy Return the current view hierarchy (XML for WDA; backend Content-Type preserved). + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Object + public Object UIUiSource(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = UIUiSourceWithHttpInfo(udid, backend, wdaUrl, timeout); + return localVarResponse.Data; + } + + /// + /// UI source hierarchy Return the current view hierarchy (XML for WDA; backend Content-Type preserved). + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse UIUiSourceWithHttpInfo(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->UIUiSource"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/xml", + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (backend != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "backend", backend)); + } + if (wdaUrl != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "wdaUrl", wdaUrl)); + } + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/ui/source", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UIUiSource", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// UI source hierarchy Return the current view hierarchy (XML for WDA; backend Content-Type preserved). + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task UIUiSourceAsync(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await UIUiSourceWithHttpInfoAsync(udid, backend, wdaUrl, timeout, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// UI source hierarchy Return the current view hierarchy (XML for WDA; backend Content-Type preserved). + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> UIUiSourceWithHttpInfoAsync(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->UIUiSource"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/xml", + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (backend != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "backend", backend)); + } + if (wdaUrl != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "wdaUrl", wdaUrl)); + } + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/ui/source", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UIUiSource", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// UI backend status Return the backend status/health payload (WDA /status or DeviceKit /health). + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Object + public Object UIUiStatus(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = UIUiStatusWithHttpInfo(udid, backend, wdaUrl, timeout); + return localVarResponse.Data; + } + + /// + /// UI backend status Return the backend status/health payload (WDA /status or DeviceKit /health). + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse UIUiStatusWithHttpInfo(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->UIUiStatus"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (backend != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "backend", backend)); + } + if (wdaUrl != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "wdaUrl", wdaUrl)); + } + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/ui/status", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UIUiStatus", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// UI backend status Return the backend status/health payload (WDA /status or DeviceKit /health). + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task UIUiStatusAsync(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await UIUiStatusWithHttpInfoAsync(udid, backend, wdaUrl, timeout, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// UI backend status Return the backend status/health payload (WDA /status or DeviceKit /health). + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> UIUiStatusWithHttpInfoAsync(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->UIUiStatus"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (backend != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "backend", backend)); + } + if (wdaUrl != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "wdaUrl", wdaUrl)); + } + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/ui/status", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UIUiStatus", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Swipe Drag from (x1,y1) to (x2,y2). + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Object + public Object UIUiSwipe(string udid, UISwipeRequest uISwipeRequest, string? backend = default, string? wdaUrl = default, int? timeout = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = UIUiSwipeWithHttpInfo(udid, uISwipeRequest, backend, wdaUrl, timeout); + return localVarResponse.Data; + } + + /// + /// Swipe Drag from (x1,y1) to (x2,y2). + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse UIUiSwipeWithHttpInfo(string udid, UISwipeRequest uISwipeRequest, string? backend = default, string? wdaUrl = default, int? timeout = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->UIUiSwipe"); + + // verify the required parameter 'uISwipeRequest' is set + if (uISwipeRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'uISwipeRequest' when calling DefaultApi->UIUiSwipe"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (backend != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "backend", backend)); + } + if (wdaUrl != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "wdaUrl", wdaUrl)); + } + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + localVarRequestOptions.Data = uISwipeRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/ui/swipe", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UIUiSwipe", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Swipe Drag from (x1,y1) to (x2,y2). + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task UIUiSwipeAsync(string udid, UISwipeRequest uISwipeRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await UIUiSwipeWithHttpInfoAsync(udid, uISwipeRequest, backend, wdaUrl, timeout, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Swipe Drag from (x1,y1) to (x2,y2). + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> UIUiSwipeWithHttpInfoAsync(string udid, UISwipeRequest uISwipeRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->UIUiSwipe"); + + // verify the required parameter 'uISwipeRequest' is set + if (uISwipeRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'uISwipeRequest' when calling DefaultApi->UIUiSwipe"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (backend != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "backend", backend)); + } + if (wdaUrl != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "wdaUrl", wdaUrl)); + } + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + localVarRequestOptions.Data = uISwipeRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/ui/swipe", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UIUiSwipe", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Tap Tap at absolute coordinates. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Object + public Object UIUiTap(string udid, UITapRequest uITapRequest, string? backend = default, string? wdaUrl = default, int? timeout = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = UIUiTapWithHttpInfo(udid, uITapRequest, backend, wdaUrl, timeout); + return localVarResponse.Data; + } + + /// + /// Tap Tap at absolute coordinates. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse UIUiTapWithHttpInfo(string udid, UITapRequest uITapRequest, string? backend = default, string? wdaUrl = default, int? timeout = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->UIUiTap"); + + // verify the required parameter 'uITapRequest' is set + if (uITapRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'uITapRequest' when calling DefaultApi->UIUiTap"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (backend != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "backend", backend)); + } + if (wdaUrl != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "wdaUrl", wdaUrl)); + } + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + localVarRequestOptions.Data = uITapRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/ui/tap", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UIUiTap", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Tap Tap at absolute coordinates. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task UIUiTapAsync(string udid, UITapRequest uITapRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await UIUiTapWithHttpInfoAsync(udid, uITapRequest, backend, wdaUrl, timeout, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Tap Tap at absolute coordinates. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> UIUiTapWithHttpInfoAsync(string udid, UITapRequest uITapRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->UIUiTap"); + + // verify the required parameter 'uITapRequest' is set + if (uITapRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'uITapRequest' when calling DefaultApi->UIUiTap"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (backend != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "backend", backend)); + } + if (wdaUrl != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "wdaUrl", wdaUrl)); + } + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + localVarRequestOptions.Data = uITapRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/ui/tap", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UIUiTap", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Type text Send text as keyboard input. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Object + public Object UIUiType(string udid, UITypeRequest uITypeRequest, string? backend = default, string? wdaUrl = default, int? timeout = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = UIUiTypeWithHttpInfo(udid, uITypeRequest, backend, wdaUrl, timeout); + return localVarResponse.Data; + } + + /// + /// Type text Send text as keyboard input. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse UIUiTypeWithHttpInfo(string udid, UITypeRequest uITypeRequest, string? backend = default, string? wdaUrl = default, int? timeout = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->UIUiType"); + + // verify the required parameter 'uITypeRequest' is set + if (uITypeRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'uITypeRequest' when calling DefaultApi->UIUiType"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (backend != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "backend", backend)); + } + if (wdaUrl != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "wdaUrl", wdaUrl)); + } + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + localVarRequestOptions.Data = uITypeRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/ui/type", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UIUiType", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Type text Send text as keyboard input. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task UIUiTypeAsync(string udid, UITypeRequest uITypeRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await UIUiTypeWithHttpInfoAsync(udid, uITypeRequest, backend, wdaUrl, timeout, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Type text Send text as keyboard input. + /// + /// Thrown when fails to make API call + /// + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> UIUiTypeWithHttpInfoAsync(string udid, UITypeRequest uITypeRequest, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->UIUiType"); + + // verify the required parameter 'uITypeRequest' is set + if (uITypeRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'uITypeRequest' when calling DefaultApi->UIUiType"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (backend != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "backend", backend)); + } + if (wdaUrl != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "wdaUrl", wdaUrl)); + } + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + localVarRequestOptions.Data = uITypeRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/ui/type", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UIUiType", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// UI window size Return the device window/screen size payload (typically {width,height}). + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Object + public Object UIUiWindowSize(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = UIUiWindowSizeWithHttpInfo(udid, backend, wdaUrl, timeout); + return localVarResponse.Data; + } + + /// + /// UI window size Return the device window/screen size payload (typically {width,height}). + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// ApiResponse of Object + public GoIos.Sdk.Generated.Client.ApiResponse UIUiWindowSizeWithHttpInfo(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->UIUiWindowSize"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (backend != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "backend", backend)); + } + if (wdaUrl != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "wdaUrl", wdaUrl)); + } + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/api/v1/device/{udid}/ui/size", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UIUiWindowSize", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// UI window size Return the device window/screen size payload (typically {width,height}). + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task UIUiWindowSizeAsync(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await UIUiWindowSizeWithHttpInfoAsync(udid, backend, wdaUrl, timeout, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// UI window size Return the device window/screen size payload (typically {width,height}). + /// + /// Thrown when fails to make API call + /// + /// Backend to target: `wda` (default) or `devicekit`. (optional) + /// Forwarded backend base URL (defaults per backend). (optional) + /// Per-request HTTP timeout in seconds (default 60). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> UIUiWindowSizeWithHttpInfoAsync(string udid, string? backend = default, string? wdaUrl = default, int? timeout = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->UIUiWindowSize"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (backend != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "backend", backend)); + } + if (wdaUrl != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "wdaUrl", wdaUrl)); + } + if (timeout != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "timeout", timeout)); + } + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/api/v1/device/{udid}/ui/size", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UIUiWindowSize", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Evaluate JavaScript in a page Evaluate JavaScript in an inspectable page and return the result (CLI: `ios webinspector eval`). `404` when no matching page exists. + /// + /// Thrown when fails to make API call + /// + /// + /// WebInspectorEvalResult + public WebInspectorEvalResult WebInspectorWebInspectorEval(string udid, WebInspectorEvalRequest webInspectorEvalRequest) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = WebInspectorWebInspectorEvalWithHttpInfo(udid, webInspectorEvalRequest); + return localVarResponse.Data; + } + + /// + /// Evaluate JavaScript in a page Evaluate JavaScript in an inspectable page and return the result (CLI: `ios webinspector eval`). `404` when no matching page exists. + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of WebInspectorEvalResult + public GoIos.Sdk.Generated.Client.ApiResponse WebInspectorWebInspectorEvalWithHttpInfo(string udid, WebInspectorEvalRequest webInspectorEvalRequest) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->WebInspectorWebInspectorEval"); + + // verify the required parameter 'webInspectorEvalRequest' is set + if (webInspectorEvalRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'webInspectorEvalRequest' when calling DefaultApi->WebInspectorWebInspectorEval"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.Data = webInspectorEvalRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/webinspector/eval", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("WebInspectorWebInspectorEval", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Evaluate JavaScript in a page Evaluate JavaScript in an inspectable page and return the result (CLI: `ios webinspector eval`). `404` when no matching page exists. + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of WebInspectorEvalResult + public async System.Threading.Tasks.Task WebInspectorWebInspectorEvalAsync(string udid, WebInspectorEvalRequest webInspectorEvalRequest, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await WebInspectorWebInspectorEvalWithHttpInfoAsync(udid, webInspectorEvalRequest, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Evaluate JavaScript in a page Evaluate JavaScript in an inspectable page and return the result (CLI: `ios webinspector eval`). `404` when no matching page exists. + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (WebInspectorEvalResult) + public async System.Threading.Tasks.Task> WebInspectorWebInspectorEvalWithHttpInfoAsync(string udid, WebInspectorEvalRequest webInspectorEvalRequest, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->WebInspectorWebInspectorEval"); + + // verify the required parameter 'webInspectorEvalRequest' is set + if (webInspectorEvalRequest == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'webInspectorEvalRequest' when calling DefaultApi->WebInspectorWebInspectorEval"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + localVarRequestOptions.Data = webInspectorEvalRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/webinspector/eval", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("WebInspectorWebInspectorEval", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Open a URL in a new inspectable page Open a URL in a new inspectable page via a remote automation session (CLI: `ios webinspector launch <url>`). `url` may be a query param or in the body; `bundleId` defaults to Safari. + /// + /// Thrown when fails to make API call + /// + /// URL to open (alternative to the request body). (optional) + /// (optional) + /// WebInspectorLaunchResult + public WebInspectorLaunchResult WebInspectorWebInspectorLaunch(string udid, string? url = default, WebInspectorLaunchRequest? webInspectorLaunchRequest = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = WebInspectorWebInspectorLaunchWithHttpInfo(udid, url, webInspectorLaunchRequest); + return localVarResponse.Data; + } + + /// + /// Open a URL in a new inspectable page Open a URL in a new inspectable page via a remote automation session (CLI: `ios webinspector launch <url>`). `url` may be a query param or in the body; `bundleId` defaults to Safari. + /// + /// Thrown when fails to make API call + /// + /// URL to open (alternative to the request body). (optional) + /// (optional) + /// ApiResponse of WebInspectorLaunchResult + public GoIos.Sdk.Generated.Client.ApiResponse WebInspectorWebInspectorLaunchWithHttpInfo(string udid, string? url = default, WebInspectorLaunchRequest? webInspectorLaunchRequest = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->WebInspectorWebInspectorLaunch"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (url != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "url", url)); + } + localVarRequestOptions.Data = webInspectorLaunchRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/api/v1/device/{udid}/webinspector/launch", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("WebInspectorWebInspectorLaunch", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Open a URL in a new inspectable page Open a URL in a new inspectable page via a remote automation session (CLI: `ios webinspector launch <url>`). `url` may be a query param or in the body; `bundleId` defaults to Safari. + /// + /// Thrown when fails to make API call + /// + /// URL to open (alternative to the request body). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of WebInspectorLaunchResult + public async System.Threading.Tasks.Task WebInspectorWebInspectorLaunchAsync(string udid, string? url = default, WebInspectorLaunchRequest? webInspectorLaunchRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse localVarResponse = await WebInspectorWebInspectorLaunchWithHttpInfoAsync(udid, url, webInspectorLaunchRequest, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Open a URL in a new inspectable page Open a URL in a new inspectable page via a remote automation session (CLI: `ios webinspector launch <url>`). `url` may be a query param or in the body; `bundleId` defaults to Safari. + /// + /// Thrown when fails to make API call + /// + /// URL to open (alternative to the request body). (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (WebInspectorLaunchResult) + public async System.Threading.Tasks.Task> WebInspectorWebInspectorLaunchWithHttpInfoAsync(string udid, string? url = default, WebInspectorLaunchRequest? webInspectorLaunchRequest = default, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->WebInspectorWebInspectorLaunch"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + if (url != null) + { + localVarRequestOptions.QueryParameters.Add(GoIos.Sdk.Generated.Client.ClientUtils.ParameterToMultiMap("", "url", url)); + } + localVarRequestOptions.Data = webInspectorLaunchRequest; + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/api/v1/device/{udid}/webinspector/launch", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("WebInspectorWebInspectorLaunch", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// List inspectable pages List inspectable pages reported by the device (CLI: `ios webinspector list`). + /// + /// Thrown when fails to make API call + /// + /// List<Object> + public List WebInspectorWebInspectorPages(string udid) + { + GoIos.Sdk.Generated.Client.ApiResponse> localVarResponse = WebInspectorWebInspectorPagesWithHttpInfo(udid); + return localVarResponse.Data; + } + + /// + /// List inspectable pages List inspectable pages reported by the device (CLI: `ios webinspector list`). + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of List<Object> + public GoIos.Sdk.Generated.Client.ApiResponse> WebInspectorWebInspectorPagesWithHttpInfo(string udid) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->WebInspectorWebInspectorPages"); + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/api/v1/device/{udid}/webinspector/pages", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("WebInspectorWebInspectorPages", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// List inspectable pages List inspectable pages reported by the device (CLI: `ios webinspector list`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of List<Object> + public async System.Threading.Tasks.Task> WebInspectorWebInspectorPagesAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + GoIos.Sdk.Generated.Client.ApiResponse> localVarResponse = await WebInspectorWebInspectorPagesWithHttpInfoAsync(udid, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// List inspectable pages List inspectable pages reported by the device (CLI: `ios webinspector list`). + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Object>) + public async System.Threading.Tasks.Task>> WebInspectorWebInspectorPagesWithHttpInfoAsync(string udid, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'udid' is set + if (udid == null) + throw new GoIos.Sdk.Generated.Client.ApiException(400, "Missing required parameter 'udid' when calling DefaultApi->WebInspectorWebInspectorPages"); + + + GoIos.Sdk.Generated.Client.RequestOptions localVarRequestOptions = new GoIos.Sdk.Generated.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = GoIos.Sdk.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("udid", GoIos.Sdk.Generated.Client.ClientUtils.ParameterToString(udid)); // path parameter + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync>("/api/v1/device/{udid}/webinspector/pages", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("WebInspectorWebInspectorPages", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + } +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/ApiClient.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/ApiClient.cs new file mode 100644 index 000000000..fcc056e41 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/ApiClient.cs @@ -0,0 +1,788 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters; +using System.Text; +using System.Threading; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using System.Web; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs; +using System.Net.Http; +using System.Net.Http.Headers; +using Polly; + +namespace GoIos.Sdk.Generated.Client +{ + /// + /// To Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON. + /// + internal class CustomJsonCodec + { + private readonly IReadableConfiguration _configuration; + private static readonly string _contentType = "application/json"; + private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + public CustomJsonCodec(IReadableConfiguration configuration) + { + _configuration = configuration; + } + + public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) + { + _serializerSettings = serializerSettings; + _configuration = configuration; + } + + /// + /// Serialize the object into a JSON string. + /// + /// Object to be serialized. + /// A JSON string. + public string Serialize(object obj) + { + if (obj != null && obj is GoIos.Sdk.Generated.Model.AbstractOpenAPISchema) + { + // the object to be serialized is an oneOf/anyOf schema + return ((GoIos.Sdk.Generated.Model.AbstractOpenAPISchema)obj).ToJson(); + } + else + { + return JsonConvert.SerializeObject(obj, _serializerSettings); + } + } + + public async Task Deserialize(HttpResponseMessage response) + { + var result = (T) await Deserialize(response, typeof(T)).ConfigureAwait(false); + return result; + } + + /// + /// Deserialize the JSON string into a proper object. + /// + /// The HTTP response. + /// Object type. + /// Object representation of the JSON string. + internal async Task Deserialize(HttpResponseMessage response, Type type) + { + IList headers = new List(); + // process response headers, e.g. Access-Control-Allow-Methods + foreach (var responseHeader in response.Headers) + { + headers.Add(responseHeader.Key + "=" + ClientUtils.ParameterToString(responseHeader.Value)); + } + + // process response content headers, e.g. Content-Type + foreach (var responseHeader in response.Content.Headers) + { + headers.Add(responseHeader.Key + "=" + ClientUtils.ParameterToString(responseHeader.Value)); + } + + // RFC 2183 & RFC 2616 + var fileNameRegex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$", RegexOptions.IgnoreCase); + if (type == typeof(byte[])) // return byte array + { + return await response.Content.ReadAsByteArrayAsync().ConfigureAwait(false); + } + else if (type == typeof(FileParameter)) + { + if (headers != null) { + foreach (var header in headers) + { + var match = fileNameRegex.Match(header.ToString()); + if (match.Success) + { + string fileName = ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); + return new FileParameter(fileName, await response.Content.ReadAsStreamAsync().ConfigureAwait(false)); + } + } + } + return new FileParameter(await response.Content.ReadAsStreamAsync().ConfigureAwait(false)); + } + + // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) + if (type == typeof(Stream)) + { + var bytes = await response.Content.ReadAsByteArrayAsync().ConfigureAwait(false); + if (headers != null) + { + var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) + ? Path.GetTempPath() + : _configuration.TempFolderPath; + + foreach (var header in headers) + { + var match = fileNameRegex.Match(header.ToString()); + if (match.Success) + { + string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); + File.WriteAllBytes(fileName, bytes); + return new FileStream(fileName, FileMode.Open); + } + } + } + var stream = new MemoryStream(bytes); + return stream; + } + + if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object + { + return DateTime.Parse(await response.Content.ReadAsStringAsync().ConfigureAwait(false), null, System.Globalization.DateTimeStyles.RoundtripKind); + } + + if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type + { + return Convert.ChangeType(await response.Content.ReadAsStringAsync().ConfigureAwait(false), type); + } + + // at this point, it must be a model (json) + try + { + return JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync().ConfigureAwait(false), type, _serializerSettings); + } + catch (Exception e) + { + throw new ApiException(500, e.Message); + } + } + + public string RootElement { get; set; } + public string Namespace { get; set; } + public string DateFormat { get; set; } + + public string ContentType + { + get { return _contentType; } + set { throw new InvalidOperationException("Not allowed to set content type."); } + } + } + /// + /// Provides a default implementation of an Api client (both synchronous and asynchronous implementations), + /// encapsulating general REST accessor use cases. + /// + /// + /// The Dispose method will manage the HttpClient lifecycle when not passed by constructor. + /// + public partial class ApiClient : IDisposable, ISynchronousClient, IAsynchronousClient + { + private readonly string _baseUrl; + + private readonly HttpClientHandler _httpClientHandler; + private readonly HttpClient _httpClient; + private readonly bool _disposeClient; + + /// + /// Specifies the settings on a object. + /// These settings can be adjusted to accommodate custom serialization rules. + /// + public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Initializes a new instance of the , defaulting to the global configurations' base url. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + public ApiClient() : + this(GoIos.Sdk.Generated.Client.GlobalConfiguration.Instance.BasePath) + { + } + + /// + /// Initializes a new instance of the . + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// The target service's base path in URL format. + /// + public ApiClient(string basePath) + { + if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); + + _httpClientHandler = new HttpClientHandler(); + _httpClient = new HttpClient(_httpClientHandler, true); + _disposeClient = true; + _baseUrl = basePath; + } + + /// + /// Initializes a new instance of the , defaulting to the global configurations' base url. + /// + /// An instance of HttpClient. + /// An optional instance of HttpClientHandler that is used by HttpClient. + /// + /// + /// Some configuration settings will not be applied without passing an HttpClientHandler. + /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. + /// + public ApiClient(HttpClient client, HttpClientHandler handler = null) : + this(client, GoIos.Sdk.Generated.Client.GlobalConfiguration.Instance.BasePath, handler) + { + } + + /// + /// Initializes a new instance of the . + /// + /// An instance of HttpClient. + /// The target service's base path in URL format. + /// An optional instance of HttpClientHandler that is used by HttpClient. + /// + /// + /// + /// Some configuration settings will not be applied without passing an HttpClientHandler. + /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. + /// + public ApiClient(HttpClient client, string basePath, HttpClientHandler handler = null) + { + if (client == null) throw new ArgumentNullException("client cannot be null"); + if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); + + _httpClientHandler = handler; + _httpClient = client; + _baseUrl = basePath; + } + + /// + /// Disposes resources if they were created by us + /// + public void Dispose() + { + if(_disposeClient) { + _httpClient.Dispose(); + } + } + + /// Prepares multipart/form-data content + HttpContent PrepareMultipartFormDataContent(RequestOptions options) + { + string boundary = "---------" + Guid.NewGuid().ToString().ToUpperInvariant(); + var multipartContent = new MultipartFormDataContent(boundary); + foreach (var formParameter in options.FormParameters) + { + multipartContent.Add(new StringContent(formParameter.Value), formParameter.Key); + } + + if (options.FileParameters != null && options.FileParameters.Count > 0) + { + foreach (var fileParam in options.FileParameters) + { + foreach (var file in fileParam.Value) + { + var content = new StreamContent(file.Content); + content.Headers.ContentType = new MediaTypeHeaderValue(file.ContentType); + multipartContent.Add(content, fileParam.Key, file.Name); + } + } + } + return multipartContent; + } + + /// + /// Provides all logic for constructing a new HttpRequestMessage. + /// At this point, all information for querying the service is known. Here, it is simply + /// mapped into the a HttpRequestMessage. + /// + /// The http verb. + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// [private] A new HttpRequestMessage instance. + /// + private HttpRequestMessage NewRequest( + HttpMethod method, + string path, + RequestOptions options, + IReadableConfiguration configuration) + { + if (path == null) throw new ArgumentNullException("path"); + if (options == null) throw new ArgumentNullException("options"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + WebRequestPathBuilder builder = new WebRequestPathBuilder(_baseUrl, path); + + builder.AddPathParameters(options.PathParameters); + + builder.AddQueryParameters(options.QueryParameters); + + HttpRequestMessage request = new HttpRequestMessage(method, builder.GetFullUri()); + + if (configuration.UserAgent != null) + { + request.Headers.TryAddWithoutValidation("User-Agent", configuration.UserAgent); + } + + if (configuration.DefaultHeaders != null) + { + foreach (var headerParam in configuration.DefaultHeaders) + { + request.Headers.Add(headerParam.Key, headerParam.Value); + } + } + + if (options.HeaderParameters != null) + { + foreach (var headerParam in options.HeaderParameters) + { + foreach (var value in headerParam.Value) + { + // Todo make content headers actually content headers + request.Headers.TryAddWithoutValidation(headerParam.Key, value); + } + } + } + + List> contentList = new List>(); + + string contentType = null; + if (options.HeaderParameters != null && options.HeaderParameters.ContainsKey("Content-Type")) + { + var contentTypes = options.HeaderParameters["Content-Type"]; + contentType = contentTypes.FirstOrDefault(); + } + + if (contentType == "multipart/form-data") + { + request.Content = PrepareMultipartFormDataContent(options); + } + else if (contentType == "application/x-www-form-urlencoded") + { + request.Content = new FormUrlEncodedContent(options.FormParameters); + } + else + { + if (options.Data != null) + { + if (options.Data is FileParameter fp) + { + contentType = contentType ?? "application/octet-stream"; + + var streamContent = new StreamContent(fp.Content); + streamContent.Headers.ContentType = new MediaTypeHeaderValue(contentType); + request.Content = streamContent; + } + else + { + var serializer = new CustomJsonCodec(SerializerSettings, configuration); + request.Content = new StringContent(serializer.Serialize(options.Data), new UTF8Encoding(), + "application/json"); + } + } + } + + + + // TODO provide an alternative that allows cookies per request instead of per API client + if (options.Cookies != null && options.Cookies.Count > 0) + { + request.Properties["CookieContainer"] = options.Cookies; + } + + return request; + } + + partial void InterceptRequest(HttpRequestMessage req); + partial void InterceptResponse(HttpRequestMessage req, HttpResponseMessage response); + + private async Task> ToApiResponse(HttpResponseMessage response, object responseData, Uri uri) + { + T result = (T) responseData; + string rawContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + + var transformed = new ApiResponse(response.StatusCode, new Multimap(), result, rawContent) + { + ErrorText = response.ReasonPhrase, + Cookies = new List() + }; + + // process response headers, e.g. Access-Control-Allow-Methods + if (response.Headers != null) + { + foreach (var responseHeader in response.Headers) + { + transformed.Headers.Add(responseHeader.Key, ClientUtils.ParameterToString(responseHeader.Value)); + } + } + + // process response content headers, e.g. Content-Type + if (response.Content.Headers != null) + { + foreach (var responseHeader in response.Content.Headers) + { + transformed.Headers.Add(responseHeader.Key, ClientUtils.ParameterToString(responseHeader.Value)); + } + } + + if (_httpClientHandler != null && response != null) + { + try { + foreach (Cookie cookie in _httpClientHandler.CookieContainer.GetCookies(uri)) + { + transformed.Cookies.Add(cookie); + } + } + catch (PlatformNotSupportedException) {} + } + + return transformed; + } + + private ApiResponse Exec(HttpRequestMessage req, IReadableConfiguration configuration) + { + return ExecAsync(req, configuration).GetAwaiter().GetResult(); + } + + private async Task> ExecAsync(HttpRequestMessage req, + IReadableConfiguration configuration, + System.Threading.CancellationToken cancellationToken = default) + { + CancellationTokenSource timeoutTokenSource = null; + CancellationTokenSource finalTokenSource = null; + var deserializer = new CustomJsonCodec(SerializerSettings, configuration); + var finalToken = cancellationToken; + + try + { + if (configuration.Timeout > TimeSpan.Zero) + { + timeoutTokenSource = new CancellationTokenSource(configuration.Timeout); + finalTokenSource = CancellationTokenSource.CreateLinkedTokenSource(finalToken, timeoutTokenSource.Token); + finalToken = finalTokenSource.Token; + } + + if (configuration.Proxy != null) + { + if(_httpClientHandler == null) throw new InvalidOperationException("Configuration `Proxy` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); + _httpClientHandler.Proxy = configuration.Proxy; + } + + if (configuration.ClientCertificates != null) + { + if(_httpClientHandler == null) throw new InvalidOperationException("Configuration `ClientCertificates` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); + _httpClientHandler.ClientCertificates.AddRange(configuration.ClientCertificates); + } + + var cookieContainer = req.Properties.ContainsKey("CookieContainer") ? req.Properties["CookieContainer"] as List : null; + + if (cookieContainer != null) + { + if(_httpClientHandler == null) throw new InvalidOperationException("Request property `CookieContainer` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); + foreach (var cookie in cookieContainer) + { + _httpClientHandler.CookieContainer.Add(cookie); + } + } + + InterceptRequest(req); + + HttpResponseMessage response; + if (RetryConfiguration.AsyncRetryPolicy != null) + { + var policy = RetryConfiguration.AsyncRetryPolicy; + var policyResult = await policy + .ExecuteAndCaptureAsync(() => _httpClient.SendAsync(req, finalToken)) + .ConfigureAwait(false); + response = (policyResult.Outcome == OutcomeType.Successful) ? + policyResult.Result : new HttpResponseMessage() + { + ReasonPhrase = policyResult.FinalException.ToString(), + RequestMessage = req + }; + } + else + { + response = await _httpClient.SendAsync(req, finalToken).ConfigureAwait(false); + } + + if (!response.IsSuccessStatusCode) + { + return await ToApiResponse(response, default, req.RequestUri).ConfigureAwait(false); + } + + object responseData = await deserializer.Deserialize(response).ConfigureAwait(false); + + // if the response type is oneOf/anyOf, call FromJSON to deserialize the data + if (typeof(GoIos.Sdk.Generated.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + { + responseData = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + } + else if (typeof(T).Name == "Stream") // for binary response + { + responseData = (T) (object) await response.Content.ReadAsStreamAsync().ConfigureAwait(false); + } + + InterceptResponse(req, response); + + return await ToApiResponse(response, responseData, req.RequestUri).ConfigureAwait(false); + } + catch (OperationCanceledException original) + { + if (timeoutTokenSource != null && timeoutTokenSource.IsCancellationRequested) + { + throw new TaskCanceledException($"[{req.Method}] {req.RequestUri} was timeout.", + new TimeoutException(original.Message, original)); + } + throw; + } + finally + { + if (timeoutTokenSource != null) + { + timeoutTokenSource.Dispose(); + } + + if (finalTokenSource != null) + { + finalTokenSource.Dispose(); + } + } + } + + #region IAsynchronousClient + /// + /// Make a HTTP GET request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP POST request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP PUT request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP DELETE request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP HEAD request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP OPTION request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP PATCH request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(new HttpMethod("PATCH"), path, options, config), config, cancellationToken); + } + #endregion IAsynchronousClient + + #region ISynchronousClient + /// + /// Make a HTTP GET request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Get, path, options, config), config); + } + + /// + /// Make a HTTP POST request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Post, path, options, config), config); + } + + /// + /// Make a HTTP PUT request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Put, path, options, config), config); + } + + /// + /// Make a HTTP DELETE request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Delete, path, options, config), config); + } + + /// + /// Make a HTTP HEAD request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Head, path, options, config), config); + } + + /// + /// Make a HTTP OPTION request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Options, path, options, config), config); + } + + /// + /// Make a HTTP PATCH request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(new HttpMethod("PATCH"), path, options, config), config); + } + #endregion ISynchronousClient + } +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/ApiException.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/ApiException.cs new file mode 100644 index 000000000..d5c08f75a --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/ApiException.cs @@ -0,0 +1,68 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; + +namespace GoIos.Sdk.Generated.Client +{ + /// + /// API Exception + /// + public class ApiException : Exception + { + /// + /// Gets or sets the error code (HTTP status code) + /// + /// The error code (HTTP status code). + public int ErrorCode { get; set; } + + /// + /// Gets or sets the error content (body json object) + /// + /// The error content (Http response body). + public object ErrorContent { get; private set; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + public Multimap Headers { get; private set; } + + /// + /// Initializes a new instance of the class. + /// + public ApiException() { } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Error message. + public ApiException(int errorCode, string message) : base(message) + { + this.ErrorCode = errorCode; + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Error message. + /// Error content. + /// HTTP Headers. + public ApiException(int errorCode, string message, object errorContent = null, Multimap headers = null) : base(message) + { + this.ErrorCode = errorCode; + this.ErrorContent = errorContent; + this.Headers = headers; + } + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/ApiResponse.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/ApiResponse.cs new file mode 100644 index 000000000..695d2efc1 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/ApiResponse.cs @@ -0,0 +1,166 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Net; + +namespace GoIos.Sdk.Generated.Client +{ + /// + /// Provides a non-generic contract for the ApiResponse wrapper. + /// + public interface IApiResponse + { + /// + /// The data type of + /// + Type ResponseType { get; } + + /// + /// The content of this response + /// + Object Content { get; } + + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + HttpStatusCode StatusCode { get; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + Multimap Headers { get; } + + /// + /// Gets or sets any error text defined by the calling client. + /// + string ErrorText { get; set; } + + /// + /// Gets or sets any cookies passed along on the response. + /// + List Cookies { get; set; } + + /// + /// The raw content of this response + /// + string RawContent { get; } + } + + /// + /// API Response + /// + public class ApiResponse : IApiResponse + { + #region Properties + + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + public Multimap Headers { get; } + + /// + /// Gets or sets the data (parsed HTTP body) + /// + /// The data. + public T Data { get; } + + /// + /// Gets or sets any error text defined by the calling client. + /// + public string ErrorText { get; set; } + + /// + /// Gets or sets any cookies passed along on the response. + /// + public List Cookies { get; set; } + + /// + /// The content of this response + /// + public Type ResponseType + { + get { return typeof(T); } + } + + /// + /// The data type of + /// + public object Content + { + get { return Data; } + } + + /// + /// The raw content + /// + public string RawContent { get; } + + #endregion Properties + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// HTTP headers. + /// Data (parsed HTTP body) + /// Raw content. + public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data, string rawContent) + { + StatusCode = statusCode; + Headers = headers; + Data = data; + RawContent = rawContent; + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// HTTP headers. + /// Data (parsed HTTP body) + public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data) : this(statusCode, headers, data, null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Data (parsed HTTP body) + /// Raw content. + public ApiResponse(HttpStatusCode statusCode, T data, string rawContent) : this(statusCode, null, data, rawContent) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Data (parsed HTTP body) + public ApiResponse(HttpStatusCode statusCode, T data) : this(statusCode, data, null) + { + } + + #endregion Constructors + } +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/ClientUtils.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/ClientUtils.cs new file mode 100644 index 000000000..765627c25 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/ClientUtils.cs @@ -0,0 +1,253 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; + +namespace GoIos.Sdk.Generated.Client +{ + /// + /// Utility functions providing some benefit to API client consumers. + /// + public static class ClientUtils + { + /// + /// Sanitize filename by removing the path + /// + /// Filename + /// Filename + public static string SanitizeFilename(string filename) + { + Match match = Regex.Match(filename, @".*[/\\](.*)$"); + return match.Success ? match.Groups[1].Value : filename; + } + + /// + /// Convert params to key/value pairs. + /// Use collectionFormat to properly format lists and collections. + /// + /// The swagger-supported collection format, one of: csv, tsv, ssv, pipes, multi + /// Key name. + /// Value object. + /// A multimap of keys with 1..n associated values. + public static Multimap ParameterToMultiMap(string collectionFormat, string name, object value) + { + var parameters = new Multimap(); + + if (value is ICollection collection && collectionFormat == "multi") + { + foreach (var item in collection) + { + parameters.Add(name, ParameterToString(item)); + } + } + else if (value is IDictionary dictionary) + { + if(collectionFormat == "deepObject") { + foreach (DictionaryEntry entry in dictionary) + { + parameters.Add(name + "[" + entry.Key + "]", ParameterToString(entry.Value)); + } + } + else { + foreach (DictionaryEntry entry in dictionary) + { + parameters.Add(entry.Key.ToString(), ParameterToString(entry.Value)); + } + } + } + else + { + parameters.Add(name, ParameterToString(value)); + } + + return parameters; + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// + /// The parameter (header, path, query, form). + /// An optional configuration instance, providing formatting options used in processing. + /// Formatted string. + public static string ParameterToString(object obj, IReadableConfiguration configuration = null) + { + if (obj is DateTime dateTime) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTime.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); + if (obj is DateTimeOffset dateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); + if (obj is DateOnly dateOnly) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15 + return dateOnly.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); + if (obj is bool boolean) + return boolean ? "true" : "false"; + if (obj is ICollection collection) { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry, configuration)); + return string.Join(",", entries); + } + if (obj is Enum && HasEnumMemberAttrValue(obj)) + return GetEnumMemberAttrValue(obj); + + return Convert.ToString(obj, CultureInfo.InvariantCulture); + } + + /// + /// Serializes the given object when not null. Otherwise return null. + /// + /// The object to serialize. + /// Serialized string. + public static string Serialize(object obj) + { + return obj != null ? Newtonsoft.Json.JsonConvert.SerializeObject(obj) : null; + } + + /// + /// Encode string in base64 format. + /// + /// string to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return Convert.ToBase64String(global::System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + using (var ms = new MemoryStream()) + { + inputStream.CopyTo(ms); + return ms.ToArray(); + } + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public static string SelectHeaderContentType(string[] contentTypes) + { + if (contentTypes.Length == 0) + return null; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType)) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// Select the Accept header's value from the given accepts array: + /// if JSON exists in the given array, use it; + /// otherwise use all of them (joining into a string) + /// + /// The accepts array to select from. + /// The Accept header to use. + public static string SelectHeaderAccept(string[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return string.Join(",", accepts); + } + + /// + /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. + /// + public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + /// + /// Check if the given MIME is a JSON MIME. + /// JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public static bool IsJsonMime(string mime) + { + if (string.IsNullOrWhiteSpace(mime)) return false; + + return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); + } + + /// + /// Is the Enum decorated with EnumMember Attribute + /// + /// + /// true if found + private static bool HasEnumMemberAttrValue(object enumVal) + { + if (enumVal == null) + throw new ArgumentNullException(nameof(enumVal)); + var enumType = enumVal.GetType(); + var memInfo = enumType.GetMember(enumVal.ToString() ?? throw new InvalidOperationException()); + var attr = memInfo.FirstOrDefault()?.GetCustomAttributes(false).OfType().FirstOrDefault(); + if (attr != null) return true; + return false; + } + + /// + /// Get the EnumMember value + /// + /// + /// EnumMember value as string otherwise null + private static string GetEnumMemberAttrValue(object enumVal) + { + if (enumVal == null) + throw new ArgumentNullException(nameof(enumVal)); + var enumType = enumVal.GetType(); + var memInfo = enumType.GetMember(enumVal.ToString() ?? throw new InvalidOperationException()); + var attr = memInfo.FirstOrDefault()?.GetCustomAttributes(false).OfType().FirstOrDefault(); + if (attr != null) + { + return attr.Value; + } + return null; + } + } +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/Configuration.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/Configuration.cs new file mode 100644 index 000000000..f278ef844 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/Configuration.cs @@ -0,0 +1,612 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Security.Cryptography.X509Certificates; +using System.Text; +using System.Net.Http; +using System.Net.Security; + +namespace GoIos.Sdk.Generated.Client +{ + /// + /// Represents a set of configuration settings + /// + public class Configuration : IReadableConfiguration + { + #region Constants + + /// + /// Version of the package. + /// + /// Version of the package. + public const string Version = "0.1.0"; + + /// + /// Identifier for ISO 8601 DateTime Format + /// + /// See https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 for more information. + // ReSharper disable once InconsistentNaming + public const string ISO8601_DATETIME_FORMAT = "o"; + + #endregion Constants + + #region Static Members + + /// + /// Default creation of exceptions for a given method name and response object + /// + public static readonly ExceptionFactory DefaultExceptionFactory = (methodName, response) => + { + var status = (int)response.StatusCode; + if (status >= 400) + { + return new ApiException(status, + string.Format("Error calling {0}: {1}", methodName, response.RawContent), + response.RawContent, response.Headers); + } + if (status == 0) + { + return new ApiException(status, + string.Format("Error calling {0}: {1}", methodName, response.ErrorText), response.ErrorText); + } + return null; + }; + + #endregion Static Members + + #region Private Members + + /// + /// Defines the base path of the target API server. + /// Example: http://localhost:3000/v1/ + /// + private string _basePath; + + private bool _useDefaultCredentials = false; + + /// + /// Gets or sets the API key based on the authentication name. + /// This is the key and value comprising the "secret" for accessing an API. + /// + /// The API key. + private IDictionary _apiKey; + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// The prefix of the API key. + private IDictionary _apiKeyPrefix; + + private string _dateTimeFormat = ISO8601_DATETIME_FORMAT; + private string _tempFolderPath = Path.GetTempPath(); + + /// + /// Gets or sets the servers defined in the OpenAPI spec. + /// + /// The servers + private IList> _servers; + + /// + /// Gets or sets the operation servers defined in the OpenAPI spec. + /// + /// The operation servers + private IReadOnlyDictionary>> _operationServers; + + #endregion Private Members + + #region Constructors + + /// + /// Initializes a new instance of the class + /// + [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + public Configuration() + { + Proxy = null; + UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/0.1.0/csharp"); + BasePath = "http://localhost:60105"; + DefaultHeaders = new ConcurrentDictionary(); + ApiKey = new ConcurrentDictionary(); + ApiKeyPrefix = new ConcurrentDictionary(); + Servers = new List>() + { + { + new Dictionary { + {"url", "http://localhost:60105"}, + {"description", "Default go-ios REST server"}, + } + } + }; + OperationServers = new Dictionary>>() + { + }; + + // Setting Timeout has side effects (forces ApiClient creation). + Timeout = TimeSpan.FromSeconds(100); + } + + /// + /// Initializes a new instance of the class + /// + [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + public Configuration( + IDictionary defaultHeaders, + IDictionary apiKey, + IDictionary apiKeyPrefix, + string basePath = "http://localhost:60105") : this() + { + if (string.IsNullOrWhiteSpace(basePath)) + throw new ArgumentException("The provided basePath is invalid.", "basePath"); + if (defaultHeaders == null) + throw new ArgumentNullException("defaultHeaders"); + if (apiKey == null) + throw new ArgumentNullException("apiKey"); + if (apiKeyPrefix == null) + throw new ArgumentNullException("apiKeyPrefix"); + + BasePath = basePath; + + foreach (var keyValuePair in defaultHeaders) + { + DefaultHeaders.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKey) + { + ApiKey.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKeyPrefix) + { + ApiKeyPrefix.Add(keyValuePair); + } + } + + #endregion Constructors + + #region Properties + + /// + /// Gets or sets the base path for API access. + /// + public virtual string BasePath + { + get { return _basePath; } + set { _basePath = value; } + } + + /// + /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. + /// + public virtual bool UseDefaultCredentials + { + get { return _useDefaultCredentials; } + set { _useDefaultCredentials = value; } + } + + /// + /// Gets or sets the default header. + /// + [Obsolete("Use DefaultHeaders instead.")] + public virtual IDictionary DefaultHeader + { + get + { + return DefaultHeaders; + } + set + { + DefaultHeaders = value; + } + } + + /// + /// Gets or sets the default headers. + /// + public virtual IDictionary DefaultHeaders { get; set; } + + /// + /// Gets or sets the HTTP timeout of ApiClient. Defaults to 100 seconds. + /// + public virtual TimeSpan Timeout { get; set; } + + /// + /// Gets or sets the proxy + /// + /// Proxy. + public virtual WebProxy Proxy { get; set; } + + /// + /// Gets or sets the HTTP user agent. + /// + /// Http user agent. + public virtual string UserAgent { get; set; } + + /// + /// Gets or sets the username (HTTP basic authentication). + /// + /// The username. + public virtual string Username { get; set; } + + /// + /// Gets or sets the password (HTTP basic authentication). + /// + /// The password. + public virtual string Password { get; set; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + public string GetApiKeyWithPrefix(string apiKeyIdentifier) + { + string apiKeyValue; + ApiKey.TryGetValue(apiKeyIdentifier, out apiKeyValue); + string apiKeyPrefix; + if (ApiKeyPrefix.TryGetValue(apiKeyIdentifier, out apiKeyPrefix)) + { + return apiKeyPrefix + " " + apiKeyValue; + } + + return apiKeyValue; + } + + /// + /// Gets or sets certificate collection to be sent with requests. + /// + /// X509 Certificate collection. + public X509CertificateCollection ClientCertificates { get; set; } + + /// + /// Gets or sets the access token for OAuth2 authentication. + /// + /// This helper property simplifies code generation. + /// + /// The access token. + public virtual string AccessToken { get; set; } + + /// + /// Gets or sets the temporary folder path to store the files downloaded from the server. + /// + /// Folder path. + public virtual string TempFolderPath + { + get { return _tempFolderPath; } + + set + { + if (string.IsNullOrEmpty(value)) + { + _tempFolderPath = Path.GetTempPath(); + return; + } + + // create the directory if it does not exist + if (!Directory.Exists(value)) + { + Directory.CreateDirectory(value); + } + + // check if the path contains directory separator at the end + if (value[value.Length - 1] == Path.DirectorySeparatorChar) + { + _tempFolderPath = value; + } + else + { + _tempFolderPath = value + Path.DirectorySeparatorChar; + } + } + } + + /// + /// Gets or sets the date time format used when serializing in the ApiClient + /// By default, it's set to ISO 8601 - "o", for others see: + /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx + /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx + /// No validation is done to ensure that the string you're providing is valid + /// + /// The DateTimeFormat string + public virtual string DateTimeFormat + { + get { return _dateTimeFormat; } + set + { + if (string.IsNullOrEmpty(value)) + { + // Never allow a blank or null string, go back to the default + _dateTimeFormat = ISO8601_DATETIME_FORMAT; + return; + } + + // Caution, no validation when you choose date time format other than ISO 8601 + // Take a look at the above links + _dateTimeFormat = value; + } + } + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// Whatever you set here will be prepended to the value defined in AddApiKey. + /// + /// An example invocation here might be: + /// + /// ApiKeyPrefix["Authorization"] = "Bearer"; + /// + /// … where ApiKey["Authorization"] would then be used to set the value of your bearer token. + /// + /// + /// OAuth2 workflows should set tokens via AccessToken. + /// + /// + /// The prefix of the API key. + public virtual IDictionary ApiKeyPrefix + { + get { return _apiKeyPrefix; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKeyPrefix collection may not be null."); + } + _apiKeyPrefix = value; + } + } + + /// + /// Gets or sets the API key based on the authentication name. + /// + /// The API key. + public virtual IDictionary ApiKey + { + get { return _apiKey; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKey collection may not be null."); + } + _apiKey = value; + } + } + + /// + /// Gets or sets the servers. + /// + /// The servers. + public virtual IList> Servers + { + get { return _servers; } + set + { + if (value == null) + { + throw new InvalidOperationException("Servers may not be null."); + } + _servers = value; + } + } + + /// + /// Gets or sets the operation servers. + /// + /// The operation servers. + public virtual IReadOnlyDictionary>> OperationServers + { + get { return _operationServers; } + set + { + if (value == null) + { + throw new InvalidOperationException("Operation servers may not be null."); + } + _operationServers = value; + } + } + + /// + /// Returns URL based on server settings without providing values + /// for the variables + /// + /// Array index of the server settings. + /// The server URL. + public string GetServerUrl(int index) + { + return GetServerUrl(Servers, index, null); + } + + /// + /// Returns URL based on server settings. + /// + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The server URL. + public string GetServerUrl(int index, Dictionary inputVariables) + { + return GetServerUrl(Servers, index, inputVariables); + } + + /// + /// Returns URL based on operation server settings. + /// + /// Operation associated with the request path. + /// Array index of the server settings. + /// The operation server URL. + public string GetOperationServerUrl(string operation, int index) + { + return GetOperationServerUrl(operation, index, null); + } + + /// + /// Returns URL based on operation server settings. + /// + /// Operation associated with the request path. + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The operation server URL. + public string GetOperationServerUrl(string operation, int index, Dictionary inputVariables) + { + if (operation != null && OperationServers.TryGetValue(operation, out var operationServer)) + { + return GetServerUrl(operationServer, index, inputVariables); + } + + return null; + } + + /// + /// Returns URL based on server settings. + /// + /// Dictionary of server settings. + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The server URL. + private string GetServerUrl(IList> servers, int index, Dictionary inputVariables) + { + if (index < 0 || index >= servers.Count) + { + throw new InvalidOperationException($"Invalid index {index} when selecting the server. Must be less than {servers.Count}."); + } + + if (inputVariables == null) + { + inputVariables = new Dictionary(); + } + + IReadOnlyDictionary server = servers[index]; + string url = (string)server["url"]; + + if (server.ContainsKey("variables")) + { + // go through each variable and assign a value + foreach (KeyValuePair variable in (IReadOnlyDictionary)server["variables"]) + { + + IReadOnlyDictionary serverVariables = (IReadOnlyDictionary)(variable.Value); + + if (inputVariables.ContainsKey(variable.Key)) + { + if (!serverVariables.ContainsKey("enum_values") || ((List)serverVariables["enum_values"]).Contains(inputVariables[variable.Key])) + { + url = url.Replace("{" + variable.Key + "}", inputVariables[variable.Key]); + } + else + { + throw new InvalidOperationException($"The variable `{variable.Key}` in the server URL has invalid value #{inputVariables[variable.Key]}. Must be {(List)serverVariables["enum_values"]}"); + } + } + else + { + // use default value + url = url.Replace("{" + variable.Key + "}", (string)serverVariables["default_value"]); + } + } + } + + return url; + } + + /// + /// Gets and Sets the RemoteCertificateValidationCallback + /// + public RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; set; } + + #endregion Properties + + #region Methods + + /// + /// Returns a string with essential information for debugging. + /// + public static string ToDebugReport() + { + string report = "C# SDK (GoIos.Sdk.Generated) Debug Report:\n"; + report += " OS: " + System.Environment.OSVersion + "\n"; + report += " .NET Framework Version: " + System.Environment.Version + "\n"; + report += " Version of the API: 0.1.0\n"; + report += " SDK Package Version: 0.1.0\n"; + + return report; + } + + /// + /// Add Api Key Header. + /// + /// Api Key name. + /// Api Key value. + /// + public void AddApiKey(string key, string value) + { + ApiKey[key] = value; + } + + /// + /// Sets the API key prefix. + /// + /// Api Key name. + /// Api Key value. + public void AddApiKeyPrefix(string key, string value) + { + ApiKeyPrefix[key] = value; + } + + #endregion Methods + + #region Static Members + /// + /// Merge configurations. + /// + /// First configuration. + /// Second configuration. + /// Merged configuration. + public static IReadableConfiguration MergeConfigurations(IReadableConfiguration first, IReadableConfiguration second) + { + if (second == null) return first ?? GlobalConfiguration.Instance; + + Dictionary apiKey = first.ApiKey.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + Dictionary apiKeyPrefix = first.ApiKeyPrefix.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + Dictionary defaultHeaders = first.DefaultHeaders.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + + foreach (var kvp in second.ApiKey) apiKey[kvp.Key] = kvp.Value; + foreach (var kvp in second.ApiKeyPrefix) apiKeyPrefix[kvp.Key] = kvp.Value; + foreach (var kvp in second.DefaultHeaders) defaultHeaders[kvp.Key] = kvp.Value; + + var config = new Configuration + { + ApiKey = apiKey, + ApiKeyPrefix = apiKeyPrefix, + DefaultHeaders = defaultHeaders, + BasePath = second.BasePath ?? first.BasePath, + Timeout = second.Timeout, + Proxy = second.Proxy ?? first.Proxy, + UserAgent = second.UserAgent ?? first.UserAgent, + Username = second.Username ?? first.Username, + Password = second.Password ?? first.Password, + AccessToken = second.AccessToken ?? first.AccessToken, + TempFolderPath = second.TempFolderPath ?? first.TempFolderPath, + DateTimeFormat = second.DateTimeFormat ?? first.DateTimeFormat, + ClientCertificates = second.ClientCertificates ?? first.ClientCertificates, + UseDefaultCredentials = second.UseDefaultCredentials, + RemoteCertificateValidationCallback = second.RemoteCertificateValidationCallback ?? first.RemoteCertificateValidationCallback, + }; + return config; + } + #endregion Static Members + } +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/ExceptionFactory.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/ExceptionFactory.cs new file mode 100644 index 000000000..a30aaabcc --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/ExceptionFactory.cs @@ -0,0 +1,22 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; + +namespace GoIos.Sdk.Generated.Client +{ + /// + /// A delegate to ExceptionFactory method + /// + /// Method name + /// Response + /// Exceptions + public delegate Exception ExceptionFactory(string methodName, IApiResponse response); +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/FileParameter.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/FileParameter.cs new file mode 100644 index 000000000..20ae15ac1 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/FileParameter.cs @@ -0,0 +1,80 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System.IO; + +namespace GoIos.Sdk.Generated.Client +{ + + /// + /// Represents a File passed to the API as a Parameter, allows using different backends for files + /// + public class FileParameter + { + /// + /// The filename + /// + public string Name { get; set; } = "no_name_provided"; + + /// + /// The content type of the file + /// + public string ContentType { get; set; } = "application/octet-stream"; + + /// + /// The content of the file + /// + public Stream Content { get; set; } + + /// + /// Construct a FileParameter just from the contents, will extract the filename from a filestream + /// + /// The file content + public FileParameter(Stream content) + { + if (content is FileStream fs) + { + Name = fs.Name; + } + Content = content; + } + + /// + /// Construct a FileParameter from name and content + /// + /// The filename + /// The file content + public FileParameter(string filename, Stream content) + { + Name = filename; + Content = content; + } + + /// + /// Construct a FileParameter from name and content + /// + /// The filename + /// The content type of the file + /// The file content + public FileParameter(string filename, string contentType, Stream content) + { + Name = filename; + ContentType = contentType; + Content = content; + } + + /// + /// Implicit conversion of stream to file parameter. Useful for backwards compatibility. + /// + /// Stream to convert + /// FileParameter + public static implicit operator FileParameter(Stream s) => new FileParameter(s); + } +} \ No newline at end of file diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/GlobalConfiguration.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/GlobalConfiguration.cs new file mode 100644 index 000000000..e4e8e77d5 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/GlobalConfiguration.cs @@ -0,0 +1,67 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System.Collections.Generic; + +namespace GoIos.Sdk.Generated.Client +{ + /// + /// provides a compile-time extension point for globally configuring + /// API Clients. + /// + /// + /// A customized implementation via partial class may reside in another file and may + /// be excluded from automatic generation via a .openapi-generator-ignore file. + /// + public partial class GlobalConfiguration : Configuration + { + #region Private Members + + private static readonly object GlobalConfigSync = new { }; + private static IReadableConfiguration _globalConfiguration; + + #endregion Private Members + + #region Constructors + + /// + private GlobalConfiguration() + { + } + + /// + public GlobalConfiguration(IDictionary defaultHeader, IDictionary apiKey, IDictionary apiKeyPrefix, string basePath = "http://localhost:3000/api") : base(defaultHeader, apiKey, apiKeyPrefix, basePath) + { + } + + static GlobalConfiguration() + { + Instance = new GlobalConfiguration(); + } + + #endregion Constructors + + /// + /// Gets or sets the default Configuration. + /// + /// Configuration. + public static IReadableConfiguration Instance + { + get { return _globalConfiguration; } + set + { + lock (GlobalConfigSync) + { + _globalConfiguration = value; + } + } + } + } +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/IApiAccessor.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/IApiAccessor.cs new file mode 100644 index 000000000..5b6e459ff --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/IApiAccessor.cs @@ -0,0 +1,37 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; + +namespace GoIos.Sdk.Generated.Client +{ + /// + /// Represents configuration aspects required to interact with the API endpoints. + /// + public interface IApiAccessor + { + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + IReadableConfiguration Configuration { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + string GetBasePath(); + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + ExceptionFactory ExceptionFactory { get; set; } + } +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/IAsynchronousClient.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/IAsynchronousClient.cs new file mode 100644 index 000000000..9b3a5e266 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/IAsynchronousClient.cs @@ -0,0 +1,100 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Threading.Tasks; + +namespace GoIos.Sdk.Generated.Client +{ + /// + /// Contract for Asynchronous RESTful API interactions. + /// + /// This interface allows consumers to provide a custom API accessor client. + /// + public interface IAsynchronousClient + { + /// + /// Executes a non-blocking call to some using the GET http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Executes a non-blocking call to some using the POST http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Executes a non-blocking call to some using the PUT http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Executes a non-blocking call to some using the DELETE http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Executes a non-blocking call to some using the HEAD http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Executes a non-blocking call to some using the OPTIONS http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Executes a non-blocking call to some using the PATCH http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); + } +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/IReadableConfiguration.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/IReadableConfiguration.cs new file mode 100644 index 000000000..2603fa951 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/IReadableConfiguration.cs @@ -0,0 +1,141 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Security; +using System.Security.Cryptography.X509Certificates; + +namespace GoIos.Sdk.Generated.Client +{ + /// + /// Represents a readable-only configuration contract. + /// + public interface IReadableConfiguration + { + /// + /// Gets the access token. + /// + /// Access token. + string AccessToken { get; } + + /// + /// Gets the API key. + /// + /// API key. + IDictionary ApiKey { get; } + + /// + /// Gets the API key prefix. + /// + /// API key prefix. + IDictionary ApiKeyPrefix { get; } + + /// + /// Gets the base path. + /// + /// Base path. + string BasePath { get; } + + /// + /// Gets the date time format. + /// + /// Date time format. + string DateTimeFormat { get; } + + /// + /// Gets the default header. + /// + /// Default header. + [Obsolete("Use DefaultHeaders instead.")] + IDictionary DefaultHeader { get; } + + /// + /// Gets the default headers. + /// + /// Default headers. + IDictionary DefaultHeaders { get; } + + /// + /// Gets the temp folder path. + /// + /// Temp folder path. + string TempFolderPath { get; } + + /// + /// Gets the HTTP connection timeout. + /// + /// HTTP connection timeout. + TimeSpan Timeout { get; } + + /// + /// Gets the proxy. + /// + /// Proxy. + WebProxy Proxy { get; } + + /// + /// Gets the user agent. + /// + /// User agent. + string UserAgent { get; } + + /// + /// Gets the username. + /// + /// Username. + string Username { get; } + + /// + /// Gets the password. + /// + /// Password. + string Password { get; } + + /// + /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. + /// + bool UseDefaultCredentials { get; } + + /// + /// Get the servers associated with the operation. + /// + /// Operation servers. + IReadOnlyDictionary>> OperationServers { get; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + string GetApiKeyWithPrefix(string apiKeyIdentifier); + + /// + /// Gets the Operation server url at the provided index. + /// + /// Operation server name. + /// Index of the operation server settings. + /// + string GetOperationServerUrl(string operation, int index); + + /// + /// Gets certificate collection to be sent with requests. + /// + /// X509 Certificate collection. + X509CertificateCollection ClientCertificates { get; } + + /// + /// Callback function for handling the validation of remote certificates. Useful for certificate pinning and + /// overriding certificate errors in the scope of a request. + /// + RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; } + } +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/ISynchronousClient.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/ISynchronousClient.cs new file mode 100644 index 000000000..2e92d44d5 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/ISynchronousClient.cs @@ -0,0 +1,93 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.IO; + +namespace GoIos.Sdk.Generated.Client +{ + /// + /// Contract for Synchronous RESTful API interactions. + /// + /// This interface allows consumers to provide a custom API accessor client. + /// + public interface ISynchronousClient + { + /// + /// Executes a blocking call to some using the GET http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the POST http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the PUT http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the DELETE http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the HEAD http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the OPTIONS http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the PATCH http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null); + } +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/Multimap.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/Multimap.cs new file mode 100644 index 000000000..56707ae46 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/Multimap.cs @@ -0,0 +1,295 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace GoIos.Sdk.Generated.Client +{ + /// + /// A dictionary in which one key has many associated values. + /// + /// The type of the key + /// The type of the value associated with the key. + public class Multimap : IDictionary> + { + #region Private Fields + + private readonly Dictionary> _dictionary; + + #endregion Private Fields + + #region Constructors + + /// + /// Empty Constructor. + /// + public Multimap() + { + _dictionary = new Dictionary>(); + } + + /// + /// Constructor with comparer. + /// + /// + public Multimap(IEqualityComparer comparer) + { + _dictionary = new Dictionary>(comparer); + } + + #endregion Constructors + + #region Enumerators + + /// + /// To get the enumerator. + /// + /// Enumerator + public IEnumerator>> GetEnumerator() + { + return _dictionary.GetEnumerator(); + } + + /// + /// To get the enumerator. + /// + /// Enumerator + IEnumerator IEnumerable.GetEnumerator() + { + return _dictionary.GetEnumerator(); + } + + #endregion Enumerators + + #region Public Members + /// + /// Add values to Multimap + /// + /// Key value pair + public void Add(KeyValuePair> item) + { + if (!TryAdd(item.Key, item.Value)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + + /// + /// Add Multimap to Multimap + /// + /// Multimap + public void Add(Multimap multimap) + { + foreach (var item in multimap) + { + if (!TryAdd(item.Key, item.Value)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + } + + /// + /// Clear Multimap + /// + public void Clear() + { + _dictionary.Clear(); + } + + /// + /// Determines whether Multimap contains the specified item. + /// + /// Key value pair + /// Method needs to be implemented + /// true if the Multimap contains the item; otherwise, false. + public bool Contains(KeyValuePair> item) + { + throw new NotImplementedException(); + } + + /// + /// Copy items of the Multimap to an array, + /// starting at a particular array index. + /// + /// The array that is the destination of the items copied + /// from Multimap. The array must have zero-based indexing. + /// The zero-based index in array at which copying begins. + /// Method needs to be implemented + public void CopyTo(KeyValuePair>[] array, int arrayIndex) + { + throw new NotImplementedException(); + } + + /// + /// Removes the specified item from the Multimap. + /// + /// Key value pair + /// true if the item is successfully removed; otherwise, false. + /// Method needs to be implemented + public bool Remove(KeyValuePair> item) + { + throw new NotImplementedException(); + } + + /// + /// Gets the number of items contained in the Multimap. + /// + public int Count => _dictionary.Count; + + /// + /// Gets a value indicating whether the Multimap is read-only. + /// + public bool IsReadOnly => false; + + /// + /// Adds an item with the provided key and value to the Multimap. + /// + /// The object to use as the key of the item to add. + /// The object to use as the value of the item to add. + /// Thrown when couldn't add the value to Multimap. + public void Add(TKey key, IList value) + { + if (value != null && value.Count > 0) + { + if (_dictionary.TryGetValue(key, out var list)) + { + foreach (var k in value) list.Add(k); + } + else + { + list = new List(value); + if (!TryAdd(key, list)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + } + } + + /// + /// Determines whether the Multimap contains an item with the specified key. + /// + /// The key to locate in the Multimap. + /// true if the Multimap contains an item with + /// the key; otherwise, false. + public bool ContainsKey(TKey key) + { + return _dictionary.ContainsKey(key); + } + + /// + /// Removes item with the specified key from the Multimap. + /// + /// The key to locate in the Multimap. + /// true if the item is successfully removed; otherwise, false. + public bool Remove(TKey key) + { + return TryRemove(key, out var _); + } + + /// + /// Gets the value associated with the specified key. + /// + /// The key whose value to get. + /// When this method returns, the value associated with the specified key, if the + /// key is found; otherwise, the default value for the type of the value parameter. + /// This parameter is passed uninitialized. + /// true if the object that implements Multimap contains + /// an item with the specified key; otherwise, false. + public bool TryGetValue(TKey key, out IList value) + { + return _dictionary.TryGetValue(key, out value); + } + + /// + /// Gets or sets the item with the specified key. + /// + /// The key of the item to get or set. + /// The value of the specified key. + public IList this[TKey key] + { + get => _dictionary[key]; + set => _dictionary[key] = value; + } + + /// + /// Gets a System.Collections.Generic.ICollection containing the keys of the Multimap. + /// + public ICollection Keys => _dictionary.Keys; + + /// + /// Gets a System.Collections.Generic.ICollection containing the values of the Multimap. + /// + public ICollection> Values => _dictionary.Values; + + /// + /// Copy the items of the Multimap to an System.Array, + /// starting at a particular System.Array index. + /// + /// The one-dimensional System.Array that is the destination of the items copied + /// from Multimap. The System.Array must have zero-based indexing. + /// The zero-based index in array at which copying begins. + public void CopyTo(Array array, int index) + { + ((ICollection)_dictionary).CopyTo(array, index); + } + + /// + /// Adds an item with the provided key and value to the Multimap. + /// + /// The object to use as the key of the item to add. + /// The object to use as the value of the item to add. + /// Thrown when couldn't add value to Multimap. + public void Add(TKey key, TValue value) + { + if (value != null) + { + if (_dictionary.TryGetValue(key, out var list)) + { + list.Add(value); + } + else + { + list = new List { value }; + if (!TryAdd(key, list)) + throw new InvalidOperationException("Could not add value to Multimap."); + } + } + } + + #endregion Public Members + + #region Private Members + + /** + * Helper method to encapsulate generator differences between dictionary types. + */ + private bool TryRemove(TKey key, out IList value) + { + _dictionary.TryGetValue(key, out value); + return _dictionary.Remove(key); + } + + /** + * Helper method to encapsulate generator differences between dictionary types. + */ + private bool TryAdd(TKey key, IList value) + { + try + { + _dictionary.Add(key, value); + } + catch (ArgumentException) + { + return false; + } + + return true; + } + #endregion Private Members + } +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/OpenAPIDateConverter.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/OpenAPIDateConverter.cs new file mode 100644 index 000000000..700b6e37d --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/OpenAPIDateConverter.cs @@ -0,0 +1,29 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using Newtonsoft.Json.Converters; + +namespace GoIos.Sdk.Generated.Client +{ + /// + /// Formatter for 'date' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class OpenAPIDateConverter : IsoDateTimeConverter + { + /// + /// Initializes a new instance of the class. + /// + public OpenAPIDateConverter() + { + // full-date = date-fullyear "-" date-month "-" date-mday + DateTimeFormat = "yyyy-MM-dd"; + } + } +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/RequestOptions.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/RequestOptions.cs new file mode 100644 index 000000000..a1b935e19 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/RequestOptions.cs @@ -0,0 +1,74 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; + +namespace GoIos.Sdk.Generated.Client +{ + /// + /// A container for generalized request inputs. This type allows consumers to extend the request functionality + /// by abstracting away from the default (built-in) request framework (e.g. RestSharp). + /// + public class RequestOptions + { + /// + /// Parameters to be bound to path parts of the Request's URL + /// + public Dictionary PathParameters { get; set; } + + /// + /// Query parameters to be applied to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap QueryParameters { get; set; } + + /// + /// Header parameters to be applied to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap HeaderParameters { get; set; } + + /// + /// Form parameters to be sent along with the request. + /// + public Dictionary FormParameters { get; set; } + + /// + /// File parameters to be sent along with the request. + /// + public Multimap FileParameters { get; set; } + + /// + /// Cookies to be sent along with the request. + /// + public List Cookies { get; set; } + + /// + /// Any data associated with a request body. + /// + public Object Data { get; set; } + + /// + /// Constructs a new instance of + /// + public RequestOptions() + { + PathParameters = new Dictionary(); + QueryParameters = new Multimap(); + HeaderParameters = new Multimap(); + FormParameters = new Dictionary(); + FileParameters = new Multimap(); + Cookies = new List(); + } + } +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/RetryConfiguration.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/RetryConfiguration.cs new file mode 100644 index 000000000..4c6daab69 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/RetryConfiguration.cs @@ -0,0 +1,31 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Polly; +using System.Net.Http; + +namespace GoIos.Sdk.Generated.Client +{ + /// + /// Configuration class to set the polly retry policies to be applied to the requests. + /// + public static class RetryConfiguration + { + /// + /// Retry policy + /// + public static ISyncPolicy RetryPolicy { get; set; } + + /// + /// Async retry policy + /// + public static IAsyncPolicy AsyncRetryPolicy { get; set; } + } +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/WebRequestPathBuilder.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/WebRequestPathBuilder.cs new file mode 100644 index 000000000..9ad6ce947 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Client/WebRequestPathBuilder.cs @@ -0,0 +1,53 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; + +namespace GoIos.Sdk.Generated.Client +{ + /// + /// A URI builder + /// + class WebRequestPathBuilder + { + private string _baseUrl; + private string _path; + private string _query = "?"; + public WebRequestPathBuilder(string baseUrl, string path) + { + _baseUrl = baseUrl; + _path = path; + } + + public void AddPathParameters(Dictionary parameters) + { + foreach (var parameter in parameters) + { + _path = _path.Replace("{" + parameter.Key + "}", Uri.EscapeDataString(parameter.Value)); + } + } + + public void AddQueryParameters(Multimap parameters) + { + foreach (var parameter in parameters) + { + foreach (var value in parameter.Value) + { + _query = _query + parameter.Key + "=" + Uri.EscapeDataString(value) + "&"; + } + } + } + + public string GetFullUri() + { + return _baseUrl + _path + _query.Substring(0, _query.Length - 1); + } + } +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/GoIos.Sdk.Generated.csproj b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/GoIos.Sdk.Generated.csproj new file mode 100644 index 000000000..ed997f3d8 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/GoIos.Sdk.Generated.csproj @@ -0,0 +1,34 @@ + + + + false + net8.0 + GoIos.Sdk.Generated + GoIos.Sdk.Generated + Library + OpenAPI + OpenAPI + OpenAPI Library + A library generated from a OpenAPI doc + No Copyright + GoIos.Sdk.Generated + 0.1.0 + bin\$(Configuration)\$(TargetFramework)\GoIos.Sdk.Generated.xml + https://github.com/GIT_USER_ID/GIT_REPO_ID.git + git + Minor update + annotations + false + + + + + + + + + + + + + diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/AXEnabledRequest.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/AXEnabledRequest.cs new file mode 100644 index 000000000..0701c59a0 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/AXEnabledRequest.cs @@ -0,0 +1,78 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// Body for the accessibility toggle PUTs (`/voiceover`, `/zoom`). The desired state may also be supplied as an `enabled` query param; a parseable body wins. + /// + [DataContract(Name = "AXEnabledRequest")] + public partial class AXEnabledRequest + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected AXEnabledRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// enabled (required). + public AXEnabledRequest(bool enabled = default) + { + this.Enabled = enabled; + } + + /// + /// Gets or Sets Enabled + /// + [DataMember(Name = "enabled", IsRequired = true, EmitDefaultValue = true)] + public bool Enabled { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class AXEnabledRequest {\n"); + sb.Append(" Enabled: ").Append(Enabled).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/AbstractOpenAPISchema.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/AbstractOpenAPISchema.cs new file mode 100644 index 000000000..d8c125935 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/AbstractOpenAPISchema.cs @@ -0,0 +1,76 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// Abstract base class for oneOf, anyOf schemas in the OpenAPI specification + /// + public abstract partial class AbstractOpenAPISchema + { + /// + /// Custom JSON serializer + /// + static public readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + MissingMemberHandling = MissingMemberHandling.Error, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Custom JSON serializer for objects with additional properties + /// + static public readonly JsonSerializerSettings AdditionalPropertiesSerializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + MissingMemberHandling = MissingMemberHandling.Ignore, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Gets or Sets the actual instance + /// + public abstract Object ActualInstance { get; set; } + + /// + /// Gets or Sets IsNullable to indicate whether the instance is nullable + /// + public bool IsNullable { get; protected set; } + + /// + /// Gets or Sets the schema type, which can be either `oneOf` or `anyOf` + /// + public string SchemaType { get; protected set; } + + /// + /// Converts the instance into JSON string. + /// + public abstract string ToJson(); + } +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/AgentShutdown.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/AgentShutdown.cs new file mode 100644 index 000000000..c4dc3b46f --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/AgentShutdown.cs @@ -0,0 +1,84 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `POST /tunnel-agent/shutdown` — acknowledgement. + /// + [DataContract(Name = "AgentShutdown")] + public partial class AgentShutdown + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected AgentShutdown() { } + /// + /// Initializes a new instance of the class. + /// + /// Always `agent shutdown requested`. (required). + public AgentShutdown(string status = default) + { + // to ensure "status" is required (not null) + if (status == null) + { + throw new ArgumentNullException("status is a required property for AgentShutdown and cannot be null"); + } + this.Status = status; + } + + /// + /// Always `agent shutdown requested`. + /// + /// Always `agent shutdown requested`. + [DataMember(Name = "status", IsRequired = true, EmitDefaultValue = true)] + public string Status { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class AgentShutdown {\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/AppInfo.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/AppInfo.cs new file mode 100644 index 000000000..2000aa57b --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/AppInfo.cs @@ -0,0 +1,118 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// Installed application metadata. This is an open map: keys come straight from the app's Info.plist. Common keys are surfaced for discoverability but any additional keys may be present. + /// + [DataContract(Name = "AppInfo")] + public partial class AppInfo + { + /// + /// Initializes a new instance of the class. + /// + /// cFBundleIdentifier. + /// cFBundleExecutable. + /// cFBundleName. + /// cFBundleShortVersionString. + /// path. + /// uIFileSharingEnabled. + public AppInfo(string cFBundleIdentifier = default, string cFBundleExecutable = default, string cFBundleName = default, string cFBundleShortVersionString = default, string path = default, bool uIFileSharingEnabled = default) + { + this.CFBundleIdentifier = cFBundleIdentifier; + this.CFBundleExecutable = cFBundleExecutable; + this.CFBundleName = cFBundleName; + this.CFBundleShortVersionString = cFBundleShortVersionString; + this.Path = path; + this.UIFileSharingEnabled = uIFileSharingEnabled; + } + + /// + /// Gets or Sets CFBundleIdentifier + /// + [DataMember(Name = "CFBundleIdentifier", EmitDefaultValue = false)] + public string CFBundleIdentifier { get; set; } + + /// + /// Gets or Sets CFBundleExecutable + /// + [DataMember(Name = "CFBundleExecutable", EmitDefaultValue = false)] + public string CFBundleExecutable { get; set; } + + /// + /// Gets or Sets CFBundleName + /// + [DataMember(Name = "CFBundleName", EmitDefaultValue = false)] + public string CFBundleName { get; set; } + + /// + /// Gets or Sets CFBundleShortVersionString + /// + [DataMember(Name = "CFBundleShortVersionString", EmitDefaultValue = false)] + public string CFBundleShortVersionString { get; set; } + + /// + /// Gets or Sets Path + /// + [DataMember(Name = "Path", EmitDefaultValue = false)] + public string Path { get; set; } + + /// + /// Gets or Sets UIFileSharingEnabled + /// + [DataMember(Name = "UIFileSharingEnabled", EmitDefaultValue = true)] + public bool UIFileSharingEnabled { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class AppInfo {\n"); + sb.Append(" CFBundleIdentifier: ").Append(CFBundleIdentifier).Append("\n"); + sb.Append(" CFBundleExecutable: ").Append(CFBundleExecutable).Append("\n"); + sb.Append(" CFBundleName: ").Append(CFBundleName).Append("\n"); + sb.Append(" CFBundleShortVersionString: ").Append(CFBundleShortVersionString).Append("\n"); + sb.Append(" Path: ").Append(Path).Append("\n"); + sb.Append(" UIFileSharingEnabled: ").Append(UIFileSharingEnabled).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/AppStateNotification.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/AppStateNotification.cs new file mode 100644 index 000000000..d5f51e5f7 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/AppStateNotification.cs @@ -0,0 +1,109 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// An app foreground/background/lifecycle state change. + /// + [DataContract(Name = "AppStateNotification")] + public partial class AppStateNotification + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected AppStateNotification() { } + /// + /// Initializes a new instance of the class. + /// + /// Bundle id of the app whose state changed. (required). + /// New application state. Typical values: `foreground`, `background`, `suspended`, `terminated`, `unknown`. (required). + /// Unix epoch milliseconds when the change was observed.. + public AppStateNotification(string bundleId = default, string state = default, long timestamp = default) + { + // to ensure "bundleId" is required (not null) + if (bundleId == null) + { + throw new ArgumentNullException("bundleId is a required property for AppStateNotification and cannot be null"); + } + this.BundleId = bundleId; + // to ensure "state" is required (not null) + if (state == null) + { + throw new ArgumentNullException("state is a required property for AppStateNotification and cannot be null"); + } + this.State = state; + this.Timestamp = timestamp; + } + + /// + /// Bundle id of the app whose state changed. + /// + /// Bundle id of the app whose state changed. + [DataMember(Name = "bundleId", IsRequired = true, EmitDefaultValue = true)] + public string BundleId { get; set; } + + /// + /// New application state. Typical values: `foreground`, `background`, `suspended`, `terminated`, `unknown`. + /// + /// New application state. Typical values: `foreground`, `background`, `suspended`, `terminated`, `unknown`. + [DataMember(Name = "state", IsRequired = true, EmitDefaultValue = true)] + public string State { get; set; } + + /// + /// Unix epoch milliseconds when the change was observed. + /// + /// Unix epoch milliseconds when the change was observed. + [DataMember(Name = "timestamp", EmitDefaultValue = false)] + public long Timestamp { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class AppStateNotification {\n"); + sb.Append(" BundleId: ").Append(BundleId).Append("\n"); + sb.Append(" State: ").Append(State).Append("\n"); + sb.Append(" Timestamp: ").Append(Timestamp).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/AssistiveTouchState.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/AssistiveTouchState.cs new file mode 100644 index 000000000..6af3af75c --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/AssistiveTouchState.cs @@ -0,0 +1,78 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `GET /device/{udid}/assistivetouch` — AssistiveTouch state. + /// + [DataContract(Name = "AssistiveTouchState")] + public partial class AssistiveTouchState + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected AssistiveTouchState() { } + /// + /// Initializes a new instance of the class. + /// + /// assistiveTouchEnabled (required). + public AssistiveTouchState(bool assistiveTouchEnabled = default) + { + this.AssistiveTouchEnabled = assistiveTouchEnabled; + } + + /// + /// Gets or Sets AssistiveTouchEnabled + /// + [DataMember(Name = "AssistiveTouchEnabled", IsRequired = true, EmitDefaultValue = true)] + public bool AssistiveTouchEnabled { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class AssistiveTouchState {\n"); + sb.Append(" AssistiveTouchEnabled: ").Append(AssistiveTouchEnabled).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/AttachDetachEvent.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/AttachDetachEvent.cs new file mode 100644 index 000000000..f91c5b016 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/AttachDetachEvent.cs @@ -0,0 +1,114 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// A device was attached to or detached from the host. + /// + [DataContract(Name = "AttachDetachEvent")] + public partial class AttachDetachEvent + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected AttachDetachEvent() { } + /// + /// Initializes a new instance of the class. + /// + /// Event kind. `attached` when a device connects, `detached` when it disconnects, `paired` when a pairing record appears. (required). + /// usbmuxd device id.. + /// The device udid (serial number), when known.. + /// Full device properties, present on `attached`.. + public AttachDetachEvent(string varEvent = default, int deviceID = default, string udid = default, DeviceProperties properties = default) + { + // to ensure "varEvent" is required (not null) + if (varEvent == null) + { + throw new ArgumentNullException("varEvent is a required property for AttachDetachEvent and cannot be null"); + } + this.Event = varEvent; + this.DeviceID = deviceID; + this.Udid = udid; + this.Properties = properties; + } + + /// + /// Event kind. `attached` when a device connects, `detached` when it disconnects, `paired` when a pairing record appears. + /// + /// Event kind. `attached` when a device connects, `detached` when it disconnects, `paired` when a pairing record appears. + [DataMember(Name = "event", IsRequired = true, EmitDefaultValue = true)] + public string Event { get; set; } + + /// + /// usbmuxd device id. + /// + /// usbmuxd device id. + [DataMember(Name = "deviceID", EmitDefaultValue = false)] + public int DeviceID { get; set; } + + /// + /// The device udid (serial number), when known. + /// + /// The device udid (serial number), when known. + [DataMember(Name = "udid", EmitDefaultValue = false)] + public string Udid { get; set; } + + /// + /// Full device properties, present on `attached`. + /// + /// Full device properties, present on `attached`. + [DataMember(Name = "properties", EmitDefaultValue = false)] + public DeviceProperties Properties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class AttachDetachEvent {\n"); + sb.Append(" Event: ").Append(Event).Append("\n"); + sb.Append(" DeviceID: ").Append(DeviceID).Append("\n"); + sb.Append(" Udid: ").Append(Udid).Append("\n"); + sb.Append(" Properties: ").Append(Properties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/BatteryInfo.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/BatteryInfo.cs new file mode 100644 index 000000000..003261093 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/BatteryInfo.cs @@ -0,0 +1,109 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `GET /device/{udid}/battery` — battery diagnostics (`ios.BatteryInfo`). Open map; commonly-present keys are surfaced for discoverability. + /// + [DataContract(Name = "BatteryInfo")] + public partial class BatteryInfo + { + /// + /// Initializes a new instance of the class. + /// + /// currentCapacity. + /// externalConnected. + /// fullyCharged. + /// isCharging. + /// temperature. + public BatteryInfo(int currentCapacity = default, bool externalConnected = default, bool fullyCharged = default, bool isCharging = default, int temperature = default) + { + this.CurrentCapacity = currentCapacity; + this.ExternalConnected = externalConnected; + this.FullyCharged = fullyCharged; + this.IsCharging = isCharging; + this.Temperature = temperature; + } + + /// + /// Gets or Sets CurrentCapacity + /// + [DataMember(Name = "CurrentCapacity", EmitDefaultValue = false)] + public int CurrentCapacity { get; set; } + + /// + /// Gets or Sets ExternalConnected + /// + [DataMember(Name = "ExternalConnected", EmitDefaultValue = true)] + public bool ExternalConnected { get; set; } + + /// + /// Gets or Sets FullyCharged + /// + [DataMember(Name = "FullyCharged", EmitDefaultValue = true)] + public bool FullyCharged { get; set; } + + /// + /// Gets or Sets IsCharging + /// + [DataMember(Name = "IsCharging", EmitDefaultValue = true)] + public bool IsCharging { get; set; } + + /// + /// Gets or Sets Temperature + /// + [DataMember(Name = "Temperature", EmitDefaultValue = false)] + public int Temperature { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class BatteryInfo {\n"); + sb.Append(" CurrentCapacity: ").Append(CurrentCapacity).Append("\n"); + sb.Append(" ExternalConnected: ").Append(ExternalConnected).Append("\n"); + sb.Append(" FullyCharged: ").Append(FullyCharged).Append("\n"); + sb.Append(" IsCharging: ").Append(IsCharging).Append("\n"); + sb.Append(" Temperature: ").Append(Temperature).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/BatteryRegistry.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/BatteryRegistry.cs new file mode 100644 index 000000000..a4ac75fd1 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/BatteryRegistry.cs @@ -0,0 +1,118 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `GET /device/{udid}/battery/registry` — battery IORegistry stats (`diagnostics.IORegistry`). Open map; common keys surfaced. + /// + [DataContract(Name = "BatteryRegistry")] + public partial class BatteryRegistry + { + /// + /// Initializes a new instance of the class. + /// + /// temperature. + /// voltage. + /// currentCapacity. + /// instantAmperage. + /// isCharging. + /// fullyCharged. + public BatteryRegistry(int temperature = default, int voltage = default, int currentCapacity = default, long instantAmperage = default, bool isCharging = default, bool fullyCharged = default) + { + this.Temperature = temperature; + this.Voltage = voltage; + this.CurrentCapacity = currentCapacity; + this.InstantAmperage = instantAmperage; + this.IsCharging = isCharging; + this.FullyCharged = fullyCharged; + } + + /// + /// Gets or Sets Temperature + /// + [DataMember(Name = "Temperature", EmitDefaultValue = false)] + public int Temperature { get; set; } + + /// + /// Gets or Sets Voltage + /// + [DataMember(Name = "Voltage", EmitDefaultValue = false)] + public int Voltage { get; set; } + + /// + /// Gets or Sets CurrentCapacity + /// + [DataMember(Name = "CurrentCapacity", EmitDefaultValue = false)] + public int CurrentCapacity { get; set; } + + /// + /// Gets or Sets InstantAmperage + /// + [DataMember(Name = "InstantAmperage", EmitDefaultValue = false)] + public long InstantAmperage { get; set; } + + /// + /// Gets or Sets IsCharging + /// + [DataMember(Name = "IsCharging", EmitDefaultValue = true)] + public bool IsCharging { get; set; } + + /// + /// Gets or Sets FullyCharged + /// + [DataMember(Name = "FullyCharged", EmitDefaultValue = true)] + public bool FullyCharged { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class BatteryRegistry {\n"); + sb.Append(" Temperature: ").Append(Temperature).Append("\n"); + sb.Append(" Voltage: ").Append(Voltage).Append("\n"); + sb.Append(" CurrentCapacity: ").Append(CurrentCapacity).Append("\n"); + sb.Append(" InstantAmperage: ").Append(InstantAmperage).Append("\n"); + sb.Append(" IsCharging: ").Append(IsCharging).Append("\n"); + sb.Append(" FullyCharged: ").Append(FullyCharged).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/CpuUsageSample.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/CpuUsageSample.cs new file mode 100644 index 000000000..1e741b884 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/CpuUsageSample.cs @@ -0,0 +1,94 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// A single sysmontap CPU-usage sample. Open map; sampler keys vary by OS. + /// + [DataContract(Name = "CpuUsageSample")] + public partial class CpuUsageSample + { + /// + /// Initializes a new instance of the class. + /// + /// Total CPU load across all cores (0–100).. + /// System (kernel) CPU load.. + /// User CPU load.. + public CpuUsageSample(double cPUTotalLoad = default, double systemLoad = default, double userLoad = default) + { + this.CPUTotalLoad = cPUTotalLoad; + this.SystemLoad = systemLoad; + this.UserLoad = userLoad; + } + + /// + /// Total CPU load across all cores (0–100). + /// + /// Total CPU load across all cores (0–100). + [DataMember(Name = "CPU_TotalLoad", EmitDefaultValue = false)] + public double CPUTotalLoad { get; set; } + + /// + /// System (kernel) CPU load. + /// + /// System (kernel) CPU load. + [DataMember(Name = "SystemLoad", EmitDefaultValue = false)] + public double SystemLoad { get; set; } + + /// + /// User CPU load. + /// + /// User CPU load. + [DataMember(Name = "UserLoad", EmitDefaultValue = false)] + public double UserLoad { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class CpuUsageSample {\n"); + sb.Append(" CPUTotalLoad: ").Append(CPUTotalLoad).Append("\n"); + sb.Append(" SystemLoad: ").Append(SystemLoad).Append("\n"); + sb.Append(" UserLoad: ").Append(UserLoad).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/CrashListing.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/CrashListing.cs new file mode 100644 index 000000000..d47c9fb16 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/CrashListing.cs @@ -0,0 +1,92 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `GET /device/{udid}/crashes` — crash report names. + /// + [DataContract(Name = "CrashListing")] + public partial class CrashListing + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected CrashListing() { } + /// + /// Initializes a new instance of the class. + /// + /// files (required). + /// count (required). + public CrashListing(List files = default, int count = default) + { + // to ensure "files" is required (not null) + if (files == null) + { + throw new ArgumentNullException("files is a required property for CrashListing and cannot be null"); + } + this.Files = files; + this.Count = count; + } + + /// + /// Gets or Sets Files + /// + [DataMember(Name = "files", IsRequired = true, EmitDefaultValue = true)] + public List Files { get; set; } + + /// + /// Gets or Sets Count + /// + [DataMember(Name = "count", IsRequired = true, EmitDefaultValue = true)] + public int Count { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class CrashListing {\n"); + sb.Append(" Files: ").Append(Files).Append("\n"); + sb.Append(" Count: ").Append(Count).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/DevModeRequest.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/DevModeRequest.cs new file mode 100644 index 000000000..08480bdf7 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/DevModeRequest.cs @@ -0,0 +1,94 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `POST /device/{udid}/devmode` request. + /// + [DataContract(Name = "DevModeRequest")] + public partial class DevModeRequest + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected DevModeRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// `enable` to turn developer mode on, `reveal` to expose the settings menu. (required). + /// When enabling, also arm developer mode to persist across the next reboot.. + public DevModeRequest(string action = default, bool enablePostRestart = default) + { + // to ensure "action" is required (not null) + if (action == null) + { + throw new ArgumentNullException("action is a required property for DevModeRequest and cannot be null"); + } + this.Action = action; + this.EnablePostRestart = enablePostRestart; + } + + /// + /// `enable` to turn developer mode on, `reveal` to expose the settings menu. + /// + /// `enable` to turn developer mode on, `reveal` to expose the settings menu. + [DataMember(Name = "action", IsRequired = true, EmitDefaultValue = true)] + public string Action { get; set; } + + /// + /// When enabling, also arm developer mode to persist across the next reboot. + /// + /// When enabling, also arm developer mode to persist across the next reboot. + [DataMember(Name = "enablePostRestart", EmitDefaultValue = true)] + public bool EnablePostRestart { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class DevModeRequest {\n"); + sb.Append(" Action: ").Append(Action).Append("\n"); + sb.Append(" EnablePostRestart: ").Append(EnablePostRestart).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/DevModeState.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/DevModeState.cs new file mode 100644 index 000000000..27bc67a21 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/DevModeState.cs @@ -0,0 +1,78 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `GET /device/{udid}/devmode` — developer mode state. + /// + [DataContract(Name = "DevModeState")] + public partial class DevModeState + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected DevModeState() { } + /// + /// Initializes a new instance of the class. + /// + /// developerModeEnabled (required). + public DevModeState(bool developerModeEnabled = default) + { + this.DeveloperModeEnabled = developerModeEnabled; + } + + /// + /// Gets or Sets DeveloperModeEnabled + /// + [DataMember(Name = "DeveloperModeEnabled", IsRequired = true, EmitDefaultValue = true)] + public bool DeveloperModeEnabled { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class DevModeState {\n"); + sb.Append(" DeveloperModeEnabled: ").Append(DeveloperModeEnabled).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/DeviceDate.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/DeviceDate.cs new file mode 100644 index 000000000..41eda6fc2 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/DeviceDate.cs @@ -0,0 +1,94 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `GET /device/{udid}/date`. + /// + [DataContract(Name = "DeviceDate")] + public partial class DeviceDate + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected DeviceDate() { } + /// + /// Initializes a new instance of the class. + /// + /// Human-readable RFC850 date on the device. (required). + /// Device clock as Unix epoch seconds. (required). + public DeviceDate(string formatedDate = default, double timeIntervalSince1970 = default) + { + // to ensure "formatedDate" is required (not null) + if (formatedDate == null) + { + throw new ArgumentNullException("formatedDate is a required property for DeviceDate and cannot be null"); + } + this.FormatedDate = formatedDate; + this.TimeIntervalSince1970 = timeIntervalSince1970; + } + + /// + /// Human-readable RFC850 date on the device. + /// + /// Human-readable RFC850 date on the device. + [DataMember(Name = "formatedDate", IsRequired = true, EmitDefaultValue = true)] + public string FormatedDate { get; set; } + + /// + /// Device clock as Unix epoch seconds. + /// + /// Device clock as Unix epoch seconds. + [DataMember(Name = "TimeIntervalSince1970", IsRequired = true, EmitDefaultValue = true)] + public double TimeIntervalSince1970 { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class DeviceDate {\n"); + sb.Append(" FormatedDate: ").Append(FormatedDate).Append("\n"); + sb.Append(" TimeIntervalSince1970: ").Append(TimeIntervalSince1970).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/DeviceEntry.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/DeviceEntry.cs new file mode 100644 index 000000000..c0b55b0e5 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/DeviceEntry.cs @@ -0,0 +1,139 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// A single device as returned by `GET /list`. + /// + [DataContract(Name = "DeviceEntry")] + public partial class DeviceEntry + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected DeviceEntry() { } + /// + /// Initializes a new instance of the class. + /// + /// deviceID (required). + /// messageType. + /// properties (required). + /// Network address for a device reached over the network / tunnel.. + /// True if reachable via the userspace TUN tunnel.. + /// userspaceTUNHost. + /// userspaceTUNPort. + public DeviceEntry(int deviceID = default, string messageType = default, DeviceProperties properties = default, string address = default, bool userspaceTUN = default, string userspaceTUNHost = default, int userspaceTUNPort = default) + { + this.DeviceID = deviceID; + // to ensure "properties" is required (not null) + if (properties == null) + { + throw new ArgumentNullException("properties is a required property for DeviceEntry and cannot be null"); + } + this.Properties = properties; + this.MessageType = messageType; + this.Address = address; + this.UserspaceTUN = userspaceTUN; + this.UserspaceTUNHost = userspaceTUNHost; + this.UserspaceTUNPort = userspaceTUNPort; + } + + /// + /// Gets or Sets DeviceID + /// + [DataMember(Name = "deviceID", IsRequired = true, EmitDefaultValue = true)] + public int DeviceID { get; set; } + + /// + /// Gets or Sets MessageType + /// + [DataMember(Name = "messageType", EmitDefaultValue = false)] + public string MessageType { get; set; } + + /// + /// Gets or Sets Properties + /// + [DataMember(Name = "properties", IsRequired = true, EmitDefaultValue = true)] + public DeviceProperties Properties { get; set; } + + /// + /// Network address for a device reached over the network / tunnel. + /// + /// Network address for a device reached over the network / tunnel. + [DataMember(Name = "address", EmitDefaultValue = false)] + public string Address { get; set; } + + /// + /// True if reachable via the userspace TUN tunnel. + /// + /// True if reachable via the userspace TUN tunnel. + [DataMember(Name = "userspaceTUN", EmitDefaultValue = true)] + public bool UserspaceTUN { get; set; } + + /// + /// Gets or Sets UserspaceTUNHost + /// + [DataMember(Name = "userspaceTUNHost", EmitDefaultValue = false)] + public string UserspaceTUNHost { get; set; } + + /// + /// Gets or Sets UserspaceTUNPort + /// + [DataMember(Name = "userspaceTUNPort", EmitDefaultValue = false)] + public int UserspaceTUNPort { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class DeviceEntry {\n"); + sb.Append(" DeviceID: ").Append(DeviceID).Append("\n"); + sb.Append(" MessageType: ").Append(MessageType).Append("\n"); + sb.Append(" Properties: ").Append(Properties).Append("\n"); + sb.Append(" Address: ").Append(Address).Append("\n"); + sb.Append(" UserspaceTUN: ").Append(UserspaceTUN).Append("\n"); + sb.Append(" UserspaceTUNHost: ").Append(UserspaceTUNHost).Append("\n"); + sb.Append(" UserspaceTUNPort: ").Append(UserspaceTUNPort).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/DeviceList.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/DeviceList.cs new file mode 100644 index 000000000..6f8dff503 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/DeviceList.cs @@ -0,0 +1,83 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// Response of `GET /list`. + /// + [DataContract(Name = "DeviceList")] + public partial class DeviceList + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected DeviceList() { } + /// + /// Initializes a new instance of the class. + /// + /// varDeviceList (required). + public DeviceList(List varDeviceList = default) + { + // to ensure "varDeviceList" is required (not null) + if (varDeviceList == null) + { + throw new ArgumentNullException("varDeviceList is a required property for DeviceList and cannot be null"); + } + this.VarDeviceList = varDeviceList; + } + + /// + /// Gets or Sets VarDeviceList + /// + [DataMember(Name = "deviceList", IsRequired = true, EmitDefaultValue = true)] + public List VarDeviceList { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class DeviceList {\n"); + sb.Append(" VarDeviceList: ").Append(VarDeviceList).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/DeviceName.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/DeviceName.cs new file mode 100644 index 000000000..86684dc68 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/DeviceName.cs @@ -0,0 +1,83 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `GET /device/{udid}/devicename`. + /// + [DataContract(Name = "DeviceName")] + public partial class DeviceName + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected DeviceName() { } + /// + /// Initializes a new instance of the class. + /// + /// devicename (required). + public DeviceName(string devicename = default) + { + // to ensure "devicename" is required (not null) + if (devicename == null) + { + throw new ArgumentNullException("devicename is a required property for DeviceName and cannot be null"); + } + this.Devicename = devicename; + } + + /// + /// Gets or Sets Devicename + /// + [DataMember(Name = "devicename", IsRequired = true, EmitDefaultValue = true)] + public string Devicename { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class DeviceName {\n"); + sb.Append(" Devicename: ").Append(Devicename).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/DeviceProperties.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/DeviceProperties.cs new file mode 100644 index 000000000..35f83f3a3 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/DeviceProperties.cs @@ -0,0 +1,129 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// Low-level device properties reported by usbmuxd / lockdown. + /// + [DataContract(Name = "DeviceProperties")] + public partial class DeviceProperties + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected DeviceProperties() { } + /// + /// Initializes a new instance of the class. + /// + /// connectionSpeed. + /// connectionType. + /// deviceID. + /// locationID. + /// productID. + /// The device udid (serial number). This is what device-scoped routes key on. (required). + public DeviceProperties(int connectionSpeed = default, string connectionType = default, int deviceID = default, int locationID = default, int productID = default, string serialNumber = default) + { + // to ensure "serialNumber" is required (not null) + if (serialNumber == null) + { + throw new ArgumentNullException("serialNumber is a required property for DeviceProperties and cannot be null"); + } + this.SerialNumber = serialNumber; + this.ConnectionSpeed = connectionSpeed; + this.ConnectionType = connectionType; + this.DeviceID = deviceID; + this.LocationID = locationID; + this.ProductID = productID; + } + + /// + /// Gets or Sets ConnectionSpeed + /// + [DataMember(Name = "connectionSpeed", EmitDefaultValue = false)] + public int ConnectionSpeed { get; set; } + + /// + /// Gets or Sets ConnectionType + /// + [DataMember(Name = "connectionType", EmitDefaultValue = false)] + public string ConnectionType { get; set; } + + /// + /// Gets or Sets DeviceID + /// + [DataMember(Name = "deviceID", EmitDefaultValue = false)] + public int DeviceID { get; set; } + + /// + /// Gets or Sets LocationID + /// + [DataMember(Name = "locationID", EmitDefaultValue = false)] + public int LocationID { get; set; } + + /// + /// Gets or Sets ProductID + /// + [DataMember(Name = "productID", EmitDefaultValue = false)] + public int ProductID { get; set; } + + /// + /// The device udid (serial number). This is what device-scoped routes key on. + /// + /// The device udid (serial number). This is what device-scoped routes key on. + [DataMember(Name = "serialNumber", IsRequired = true, EmitDefaultValue = true)] + public string SerialNumber { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class DeviceProperties {\n"); + sb.Append(" ConnectionSpeed: ").Append(ConnectionSpeed).Append("\n"); + sb.Append(" ConnectionType: ").Append(ConnectionType).Append("\n"); + sb.Append(" DeviceID: ").Append(DeviceID).Append("\n"); + sb.Append(" LocationID: ").Append(LocationID).Append("\n"); + sb.Append(" ProductID: ").Append(ProductID).Append("\n"); + sb.Append(" SerialNumber: ").Append(SerialNumber).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/DevicesGetJob404Response.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/DevicesGetJob404Response.cs new file mode 100644 index 000000000..738516ee8 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/DevicesGetJob404Response.cs @@ -0,0 +1,185 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; +using System.Reflection; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// DevicesGetJob404Response + /// + [JsonConverter(typeof(DevicesGetJob404ResponseJsonConverter))] + [DataContract(Name = "Devices_getJob_404_response")] + public partial class DevicesGetJob404Response : AbstractOpenAPISchema + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of GenericResponse. + public DevicesGetJob404Response(GenericResponse actualInstance) + { + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(GenericResponse)) + { + _actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: GenericResponse"); + } + } + } + + /// + /// Get the actual instance of `GenericResponse`. If the actual instance is not `GenericResponse`, + /// the InvalidClassException will be thrown + /// + /// An instance of GenericResponse + public GenericResponse GetGenericResponse() + { + return (GenericResponse)ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class DevicesGetJob404Response {\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(ActualInstance, DevicesGetJob404Response.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of DevicesGetJob404Response + /// + /// JSON string + /// An instance of DevicesGetJob404Response + public static DevicesGetJob404Response FromJson(string jsonString) + { + DevicesGetJob404Response newDevicesGetJob404Response = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newDevicesGetJob404Response; + } + + try + { + newDevicesGetJob404Response = new DevicesGetJob404Response(JsonConvert.DeserializeObject(jsonString, DevicesGetJob404Response.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newDevicesGetJob404Response; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into GenericResponse: {1}", jsonString, exception.ToString())); + } + + // no match found, throw an exception + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + + } + + /// + /// Custom JSON converter for DevicesGetJob404Response + /// + public class DevicesGetJob404ResponseJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(DevicesGetJob404Response).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + switch(reader.TokenType) + { + case JsonToken.StartObject: + return DevicesGetJob404Response.FromJson(JObject.Load(reader).ToString(Formatting.None)); + case JsonToken.StartArray: + return DevicesGetJob404Response.FromJson(JArray.Load(reader).ToString(Formatting.None)); + default: + return null; + } + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/DevicesGetWdaSession404Response.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/DevicesGetWdaSession404Response.cs new file mode 100644 index 000000000..a236de42e --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/DevicesGetWdaSession404Response.cs @@ -0,0 +1,185 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; +using System.Reflection; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// DevicesGetWdaSession404Response + /// + [JsonConverter(typeof(DevicesGetWdaSession404ResponseJsonConverter))] + [DataContract(Name = "Devices_getWdaSession_404_response")] + public partial class DevicesGetWdaSession404Response : AbstractOpenAPISchema + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of GenericResponse. + public DevicesGetWdaSession404Response(GenericResponse actualInstance) + { + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(GenericResponse)) + { + _actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: GenericResponse"); + } + } + } + + /// + /// Get the actual instance of `GenericResponse`. If the actual instance is not `GenericResponse`, + /// the InvalidClassException will be thrown + /// + /// An instance of GenericResponse + public GenericResponse GetGenericResponse() + { + return (GenericResponse)ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class DevicesGetWdaSession404Response {\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(ActualInstance, DevicesGetWdaSession404Response.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of DevicesGetWdaSession404Response + /// + /// JSON string + /// An instance of DevicesGetWdaSession404Response + public static DevicesGetWdaSession404Response FromJson(string jsonString) + { + DevicesGetWdaSession404Response newDevicesGetWdaSession404Response = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newDevicesGetWdaSession404Response; + } + + try + { + newDevicesGetWdaSession404Response = new DevicesGetWdaSession404Response(JsonConvert.DeserializeObject(jsonString, DevicesGetWdaSession404Response.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newDevicesGetWdaSession404Response; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into GenericResponse: {1}", jsonString, exception.ToString())); + } + + // no match found, throw an exception + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + + } + + /// + /// Custom JSON converter for DevicesGetWdaSession404Response + /// + public class DevicesGetWdaSession404ResponseJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(DevicesGetWdaSession404Response).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + switch(reader.TokenType) + { + case JsonToken.StartObject: + return DevicesGetWdaSession404Response.FromJson(JObject.Load(reader).ToString(Formatting.None)); + case JsonToken.StartArray: + return DevicesGetWdaSession404Response.FromJson(JArray.Load(reader).ToString(Formatting.None)); + default: + return null; + } + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/DiskSpaceInfo.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/DiskSpaceInfo.cs new file mode 100644 index 000000000..b4b98ae5b --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/DiskSpaceInfo.cs @@ -0,0 +1,104 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `GET /device/{udid}/diskspace` — AFC filesystem info (`afc.DeviceInfo`). Total/free/used bytes and block size. Open map; common keys surfaced. + /// + [DataContract(Name = "DiskSpaceInfo")] + public partial class DiskSpaceInfo + { + /// + /// Initializes a new instance of the class. + /// + /// Total filesystem capacity in bytes.. + /// Free filesystem space in bytes.. + /// Filesystem block size in bytes.. + /// AFC model identifier reported by the device.. + public DiskSpaceInfo(long fSTotalBytes = default, long fSFreeBytes = default, long fSBlockSize = default, string model = default) + { + this.FSTotalBytes = fSTotalBytes; + this.FSFreeBytes = fSFreeBytes; + this.FSBlockSize = fSBlockSize; + this.Model = model; + } + + /// + /// Total filesystem capacity in bytes. + /// + /// Total filesystem capacity in bytes. + [DataMember(Name = "FSTotalBytes", EmitDefaultValue = false)] + public long FSTotalBytes { get; set; } + + /// + /// Free filesystem space in bytes. + /// + /// Free filesystem space in bytes. + [DataMember(Name = "FSFreeBytes", EmitDefaultValue = false)] + public long FSFreeBytes { get; set; } + + /// + /// Filesystem block size in bytes. + /// + /// Filesystem block size in bytes. + [DataMember(Name = "FSBlockSize", EmitDefaultValue = false)] + public long FSBlockSize { get; set; } + + /// + /// AFC model identifier reported by the device. + /// + /// AFC model identifier reported by the device. + [DataMember(Name = "Model", EmitDefaultValue = false)] + public string Model { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class DiskSpaceInfo {\n"); + sb.Append(" FSTotalBytes: ").Append(FSTotalBytes).Append("\n"); + sb.Append(" FSFreeBytes: ").Append(FSFreeBytes).Append("\n"); + sb.Append(" FSBlockSize: ").Append(FSBlockSize).Append("\n"); + sb.Append(" Model: ").Append(Model).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/EnabledRequest.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/EnabledRequest.cs new file mode 100644 index 000000000..433e41a95 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/EnabledRequest.cs @@ -0,0 +1,78 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// Request body for the `enabled`-toggle settings endpoints. + /// + [DataContract(Name = "EnabledRequest")] + public partial class EnabledRequest + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected EnabledRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// enabled (required). + public EnabledRequest(bool enabled = default) + { + this.Enabled = enabled; + } + + /// + /// Gets or Sets Enabled + /// + [DataMember(Name = "enabled", IsRequired = true, EmitDefaultValue = true)] + public bool Enabled { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class EnabledRequest {\n"); + sb.Append(" Enabled: ").Append(Enabled).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/FileDomain.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/FileDomain.cs new file mode 100644 index 000000000..2c3787ae9 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/FileDomain.cs @@ -0,0 +1,187 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; +using System.Reflection; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// Domain of the on-device file service. + /// + [JsonConverter(typeof(FileDomainJsonConverter))] + [DataContract(Name = "FileDomain")] + public partial class FileDomain : AbstractOpenAPISchema + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of string. + public FileDomain(string actualInstance) + { + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(string)) + { + _actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: string"); + } + } + } + + /// + /// Get the actual instance of `string`. If the actual instance is not `string`, + /// the InvalidClassException will be thrown + /// + /// An instance of string + public string GetString() + { + return (string)ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class FileDomain {\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(ActualInstance, FileDomain.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of FileDomain + /// + /// JSON string + /// An instance of FileDomain + public static FileDomain FromJson(string jsonString) + { + FileDomain newFileDomain = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newFileDomain; + } + + try + { + newFileDomain = new FileDomain(JsonConvert.DeserializeObject(jsonString, FileDomain.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newFileDomain; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into string: {1}", jsonString, exception.ToString())); + } + + // no match found, throw an exception + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + + } + + /// + /// Custom JSON converter for FileDomain + /// + public class FileDomainJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(FileDomain).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + switch(reader.TokenType) + { + case JsonToken.String: + return new FileDomain(Convert.ToString(reader.Value)); + case JsonToken.StartObject: + return FileDomain.FromJson(JObject.Load(reader).ToString(Formatting.None)); + case JsonToken.StartArray: + return FileDomain.FromJson(JArray.Load(reader).ToString(Formatting.None)); + default: + return null; + } + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/FileEntry.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/FileEntry.cs new file mode 100644 index 000000000..02d1a61df --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/FileEntry.cs @@ -0,0 +1,100 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// A single entry in a device directory listing. + /// + [DataContract(Name = "FileEntry")] + public partial class FileEntry + { + /// + /// Initializes a new instance of the class. + /// + /// name. + /// path. + /// isDir. + /// size. + public FileEntry(string name = default, string path = default, bool isDir = default, long size = default) + { + this.Name = name; + this.Path = path; + this.IsDir = isDir; + this.Size = size; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Gets or Sets Path + /// + [DataMember(Name = "path", EmitDefaultValue = false)] + public string Path { get; set; } + + /// + /// Gets or Sets IsDir + /// + [DataMember(Name = "isDir", EmitDefaultValue = true)] + public bool IsDir { get; set; } + + /// + /// Gets or Sets Size + /// + [DataMember(Name = "size", EmitDefaultValue = false)] + public long Size { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class FileEntry {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Path: ").Append(Path).Append("\n"); + sb.Append(" IsDir: ").Append(IsDir).Append("\n"); + sb.Append(" Size: ").Append(Size).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/FileListing.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/FileListing.cs new file mode 100644 index 000000000..d5b5efa99 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/FileListing.cs @@ -0,0 +1,106 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `GET /device/{udid}/files` — directory listing. + /// + [DataContract(Name = "FileListing")] + public partial class FileListing + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FileListing() { } + /// + /// Initializes a new instance of the class. + /// + /// path (required). + /// files (required). + /// count (required). + public FileListing(string path = default, List files = default, int count = default) + { + // to ensure "path" is required (not null) + if (path == null) + { + throw new ArgumentNullException("path is a required property for FileListing and cannot be null"); + } + this.Path = path; + // to ensure "files" is required (not null) + if (files == null) + { + throw new ArgumentNullException("files is a required property for FileListing and cannot be null"); + } + this.Files = files; + this.Count = count; + } + + /// + /// Gets or Sets Path + /// + [DataMember(Name = "path", IsRequired = true, EmitDefaultValue = true)] + public string Path { get; set; } + + /// + /// Gets or Sets Files + /// + [DataMember(Name = "files", IsRequired = true, EmitDefaultValue = true)] + public List Files { get; set; } + + /// + /// Gets or Sets Count + /// + [DataMember(Name = "count", IsRequired = true, EmitDefaultValue = true)] + public int Count { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class FileListing {\n"); + sb.Append(" Path: ").Append(Path).Append("\n"); + sb.Append(" Files: ").Append(Files).Append("\n"); + sb.Append(" Count: ").Append(Count).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/FilePushResult.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/FilePushResult.cs new file mode 100644 index 000000000..e5aad6e4a --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/FilePushResult.cs @@ -0,0 +1,92 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `POST /device/{udid}/files/push` — acknowledgement. + /// + [DataContract(Name = "FilePushResult")] + public partial class FilePushResult + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FilePushResult() { } + /// + /// Initializes a new instance of the class. + /// + /// remote (required). + /// size (required). + public FilePushResult(string remote = default, long size = default) + { + // to ensure "remote" is required (not null) + if (remote == null) + { + throw new ArgumentNullException("remote is a required property for FilePushResult and cannot be null"); + } + this.Remote = remote; + this.Size = size; + } + + /// + /// Gets or Sets Remote + /// + [DataMember(Name = "remote", IsRequired = true, EmitDefaultValue = true)] + public string Remote { get; set; } + + /// + /// Gets or Sets Size + /// + [DataMember(Name = "size", IsRequired = true, EmitDefaultValue = true)] + public long Size { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class FilePushResult {\n"); + sb.Append(" Remote: ").Append(Remote).Append("\n"); + sb.Append(" Size: ").Append(Size).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/ForwardRequest.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/ForwardRequest.cs new file mode 100644 index 000000000..9a0f601d2 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/ForwardRequest.cs @@ -0,0 +1,89 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `POST /device/{udid}/jobs/forward` request. + /// + [DataContract(Name = "ForwardRequest")] + public partial class ForwardRequest + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ForwardRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// Local (host) TCP port to listen on. (required). + /// Device TCP port to forward to. (required). + public ForwardRequest(int hostPort = default, int targetPort = default) + { + this.HostPort = hostPort; + this.TargetPort = targetPort; + } + + /// + /// Local (host) TCP port to listen on. + /// + /// Local (host) TCP port to listen on. + [DataMember(Name = "hostPort", IsRequired = true, EmitDefaultValue = true)] + public int HostPort { get; set; } + + /// + /// Device TCP port to forward to. + /// + /// Device TCP port to forward to. + [DataMember(Name = "targetPort", IsRequired = true, EmitDefaultValue = true)] + public int TargetPort { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ForwardRequest {\n"); + sb.Append(" HostPort: ").Append(HostPort).Append("\n"); + sb.Append(" TargetPort: ").Append(TargetPort).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/FsyncListing.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/FsyncListing.cs new file mode 100644 index 000000000..bbc9e1d02 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/FsyncListing.cs @@ -0,0 +1,109 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `GET /device/{udid}/fsync/ls` — a directory listing over AFC. + /// + [DataContract(Name = "FsyncListing")] + public partial class FsyncListing + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FsyncListing() { } + /// + /// Initializes a new instance of the class. + /// + /// The listed (cleaned) device path. (required). + /// File/directory names in the listed directory. (required). + /// Number of entries. (required). + public FsyncListing(string path = default, List files = default, int count = default) + { + // to ensure "path" is required (not null) + if (path == null) + { + throw new ArgumentNullException("path is a required property for FsyncListing and cannot be null"); + } + this.Path = path; + // to ensure "files" is required (not null) + if (files == null) + { + throw new ArgumentNullException("files is a required property for FsyncListing and cannot be null"); + } + this.Files = files; + this.Count = count; + } + + /// + /// The listed (cleaned) device path. + /// + /// The listed (cleaned) device path. + [DataMember(Name = "path", IsRequired = true, EmitDefaultValue = true)] + public string Path { get; set; } + + /// + /// File/directory names in the listed directory. + /// + /// File/directory names in the listed directory. + [DataMember(Name = "files", IsRequired = true, EmitDefaultValue = true)] + public List Files { get; set; } + + /// + /// Number of entries. + /// + /// Number of entries. + [DataMember(Name = "count", IsRequired = true, EmitDefaultValue = true)] + public int Count { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class FsyncListing {\n"); + sb.Append(" Path: ").Append(Path).Append("\n"); + sb.Append(" Files: ").Append(Files).Append("\n"); + sb.Append(" Count: ").Append(Count).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/FsyncMessage.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/FsyncMessage.cs new file mode 100644 index 000000000..392cf99e8 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/FsyncMessage.cs @@ -0,0 +1,99 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `POST /device/{udid}/fsync/mkdir` and `DELETE /device/{udid}/fsync/rm` — simple message + path acknowledgement. + /// + [DataContract(Name = "FsyncMessage")] + public partial class FsyncMessage + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FsyncMessage() { } + /// + /// Initializes a new instance of the class. + /// + /// Human-readable result message (e.g. `created`, `removed`). (required). + /// The (cleaned) device path acted on. (required). + public FsyncMessage(string message = default, string path = default) + { + // to ensure "message" is required (not null) + if (message == null) + { + throw new ArgumentNullException("message is a required property for FsyncMessage and cannot be null"); + } + this.Message = message; + // to ensure "path" is required (not null) + if (path == null) + { + throw new ArgumentNullException("path is a required property for FsyncMessage and cannot be null"); + } + this.Path = path; + } + + /// + /// Human-readable result message (e.g. `created`, `removed`). + /// + /// Human-readable result message (e.g. `created`, `removed`). + [DataMember(Name = "message", IsRequired = true, EmitDefaultValue = true)] + public string Message { get; set; } + + /// + /// The (cleaned) device path acted on. + /// + /// The (cleaned) device path acted on. + [DataMember(Name = "path", IsRequired = true, EmitDefaultValue = true)] + public string Path { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class FsyncMessage {\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append(" Path: ").Append(Path).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/FsyncPushResult.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/FsyncPushResult.cs new file mode 100644 index 000000000..d8d5eb685 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/FsyncPushResult.cs @@ -0,0 +1,94 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `POST /device/{udid}/fsync/push` — result of an upload over AFC. + /// + [DataContract(Name = "FsyncPushResult")] + public partial class FsyncPushResult + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FsyncPushResult() { } + /// + /// Initializes a new instance of the class. + /// + /// Destination device path written. (required). + /// Number of bytes written. (required). + public FsyncPushResult(string path = default, long size = default) + { + // to ensure "path" is required (not null) + if (path == null) + { + throw new ArgumentNullException("path is a required property for FsyncPushResult and cannot be null"); + } + this.Path = path; + this.Size = size; + } + + /// + /// Destination device path written. + /// + /// Destination device path written. + [DataMember(Name = "path", IsRequired = true, EmitDefaultValue = true)] + public string Path { get; set; } + + /// + /// Number of bytes written. + /// + /// Number of bytes written. + [DataMember(Name = "size", IsRequired = true, EmitDefaultValue = true)] + public long Size { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class FsyncPushResult {\n"); + sb.Append(" Path: ").Append(Path).Append("\n"); + sb.Append(" Size: ").Append(Size).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/FsyncTreeEntry.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/FsyncTreeEntry.cs new file mode 100644 index 000000000..162e36755 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/FsyncTreeEntry.cs @@ -0,0 +1,119 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// One entry returned by the recursive `GET /device/{udid}/fsync/tree` walk. + /// + [DataContract(Name = "FsyncTreeEntry")] + public partial class FsyncTreeEntry + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FsyncTreeEntry() { } + /// + /// Initializes a new instance of the class. + /// + /// Full device-side path of this entry. (required). + /// Base name of the entry. (required). + /// Whether the entry is a directory. (required). + /// Size in bytes. (required). + public FsyncTreeEntry(string path = default, string name = default, bool isDir = default, long size = default) + { + // to ensure "path" is required (not null) + if (path == null) + { + throw new ArgumentNullException("path is a required property for FsyncTreeEntry and cannot be null"); + } + this.Path = path; + // to ensure "name" is required (not null) + if (name == null) + { + throw new ArgumentNullException("name is a required property for FsyncTreeEntry and cannot be null"); + } + this.Name = name; + this.IsDir = isDir; + this.Size = size; + } + + /// + /// Full device-side path of this entry. + /// + /// Full device-side path of this entry. + [DataMember(Name = "path", IsRequired = true, EmitDefaultValue = true)] + public string Path { get; set; } + + /// + /// Base name of the entry. + /// + /// Base name of the entry. + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] + public string Name { get; set; } + + /// + /// Whether the entry is a directory. + /// + /// Whether the entry is a directory. + [DataMember(Name = "isDir", IsRequired = true, EmitDefaultValue = true)] + public bool IsDir { get; set; } + + /// + /// Size in bytes. + /// + /// Size in bytes. + [DataMember(Name = "size", IsRequired = true, EmitDefaultValue = true)] + public long Size { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class FsyncTreeEntry {\n"); + sb.Append(" Path: ").Append(Path).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" IsDir: ").Append(IsDir).Append("\n"); + sb.Append(" Size: ").Append(Size).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/FsyncTreeListing.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/FsyncTreeListing.cs new file mode 100644 index 000000000..4d29c64b4 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/FsyncTreeListing.cs @@ -0,0 +1,109 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `GET /device/{udid}/fsync/tree` — a recursive directory walk over AFC. + /// + [DataContract(Name = "FsyncTreeListing")] + public partial class FsyncTreeListing + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FsyncTreeListing() { } + /// + /// Initializes a new instance of the class. + /// + /// The root (cleaned) device path. (required). + /// Flattened list of entries in the subtree. (required). + /// Number of entries. (required). + public FsyncTreeListing(string path = default, List entries = default, int count = default) + { + // to ensure "path" is required (not null) + if (path == null) + { + throw new ArgumentNullException("path is a required property for FsyncTreeListing and cannot be null"); + } + this.Path = path; + // to ensure "entries" is required (not null) + if (entries == null) + { + throw new ArgumentNullException("entries is a required property for FsyncTreeListing and cannot be null"); + } + this.Entries = entries; + this.Count = count; + } + + /// + /// The root (cleaned) device path. + /// + /// The root (cleaned) device path. + [DataMember(Name = "path", IsRequired = true, EmitDefaultValue = true)] + public string Path { get; set; } + + /// + /// Flattened list of entries in the subtree. + /// + /// Flattened list of entries in the subtree. + [DataMember(Name = "entries", IsRequired = true, EmitDefaultValue = true)] + public List Entries { get; set; } + + /// + /// Number of entries. + /// + /// Number of entries. + [DataMember(Name = "count", IsRequired = true, EmitDefaultValue = true)] + public int Count { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class FsyncTreeListing {\n"); + sb.Append(" Path: ").Append(Path).Append("\n"); + sb.Append(" Entries: ").Append(Entries).Append("\n"); + sb.Append(" Count: ").Append(Count).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/GenericResponse.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/GenericResponse.cs new file mode 100644 index 000000000..7a865b0cb --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/GenericResponse.cs @@ -0,0 +1,84 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// The dominant response envelope used across the API. Success responses set `message`; error responses set `error`. Streaming/middleware paths that emit `gin.H{\"error\"|\"message\"}` are compatible with this shape. + /// + [DataContract(Name = "GenericResponse")] + public partial class GenericResponse + { + /// + /// Initializes a new instance of the class. + /// + /// Human-readable success or status message.. + /// Human-readable error message. Present on failures.. + public GenericResponse(string message = default, string error = default) + { + this.Message = message; + this.Error = error; + } + + /// + /// Human-readable success or status message. + /// + /// Human-readable success or status message. + [DataMember(Name = "message", EmitDefaultValue = false)] + public string Message { get; set; } + + /// + /// Human-readable error message. Present on failures. + /// + /// Human-readable error message. Present on failures. + [DataMember(Name = "error", EmitDefaultValue = false)] + public string Error { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class GenericResponse {\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append(" Error: ").Append(Error).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/Job.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/Job.cs new file mode 100644 index 000000000..c651a6a61 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/Job.cs @@ -0,0 +1,167 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// A long-running operation started via the REST API (test run, WDA runner, port forward). Mirrors the server's `jobView`. + /// + [DataContract(Name = "Job")] + public partial class Job + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Job() { } + /// + /// Initializes a new instance of the class. + /// + /// Opaque job id, e.g. `runtest-3`. (required). + /// Job kind: `runtest`, `runwda` or `forward`. (required). + /// The device udid the job runs on. (required). + /// status (required). + /// When the job started (ISO-8601). (required). + /// When the job reached a terminal state (absent while running).. + /// Error message when `status` is `failed`.. + /// result. + public Job(string id = default, string kind = default, string udid = default, JobStatus status = default, DateTimeOffset startedAt = default, DateTimeOffset finishedAt = default, string error = default, Object result = default) + { + // to ensure "id" is required (not null) + if (id == null) + { + throw new ArgumentNullException("id is a required property for Job and cannot be null"); + } + this.Id = id; + // to ensure "kind" is required (not null) + if (kind == null) + { + throw new ArgumentNullException("kind is a required property for Job and cannot be null"); + } + this.Kind = kind; + // to ensure "udid" is required (not null) + if (udid == null) + { + throw new ArgumentNullException("udid is a required property for Job and cannot be null"); + } + this.Udid = udid; + // to ensure "status" is required (not null) + if (status == null) + { + throw new ArgumentNullException("status is a required property for Job and cannot be null"); + } + this.Status = status; + this.StartedAt = startedAt; + this.FinishedAt = finishedAt; + this.Error = error; + this.Result = result; + } + + /// + /// Opaque job id, e.g. `runtest-3`. + /// + /// Opaque job id, e.g. `runtest-3`. + [DataMember(Name = "id", IsRequired = true, EmitDefaultValue = true)] + public string Id { get; set; } + + /// + /// Job kind: `runtest`, `runwda` or `forward`. + /// + /// Job kind: `runtest`, `runwda` or `forward`. + [DataMember(Name = "kind", IsRequired = true, EmitDefaultValue = true)] + public string Kind { get; set; } + + /// + /// The device udid the job runs on. + /// + /// The device udid the job runs on. + [DataMember(Name = "udid", IsRequired = true, EmitDefaultValue = true)] + public string Udid { get; set; } + + /// + /// Gets or Sets Status + /// + [DataMember(Name = "status", IsRequired = true, EmitDefaultValue = true)] + public JobStatus Status { get; set; } + + /// + /// When the job started (ISO-8601). + /// + /// When the job started (ISO-8601). + [DataMember(Name = "startedAt", IsRequired = true, EmitDefaultValue = true)] + public DateTimeOffset StartedAt { get; set; } + + /// + /// When the job reached a terminal state (absent while running). + /// + /// When the job reached a terminal state (absent while running). + [DataMember(Name = "finishedAt", EmitDefaultValue = false)] + public DateTimeOffset FinishedAt { get; set; } + + /// + /// Error message when `status` is `failed`. + /// + /// Error message when `status` is `failed`. + [DataMember(Name = "error", EmitDefaultValue = false)] + public string Error { get; set; } + + /// + /// Gets or Sets Result + /// + [DataMember(Name = "result", EmitDefaultValue = true)] + public Object Result { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Job {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Kind: ").Append(Kind).Append("\n"); + sb.Append(" Udid: ").Append(Udid).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" StartedAt: ").Append(StartedAt).Append("\n"); + sb.Append(" FinishedAt: ").Append(FinishedAt).Append("\n"); + sb.Append(" Error: ").Append(Error).Append("\n"); + sb.Append(" Result: ").Append(Result).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/JobLogEvents.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/JobLogEvents.cs new file mode 100644 index 000000000..4564a057f --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/JobLogEvents.cs @@ -0,0 +1,223 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; +using System.Reflection; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// JobLogEvents + /// + [JsonConverter(typeof(JobLogEventsJsonConverter))] + [DataContract(Name = "JobLogEvents")] + public partial class JobLogEvents : AbstractOpenAPISchema + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of JobLogLine. + public JobLogEvents(JobLogLine actualInstance) + { + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Object. + public JobLogEvents(Object actualInstance) + { + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(JobLogLine)) + { + _actualInstance = value; + } + else if (value.GetType() == typeof(Object)) + { + _actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: JobLogLine, Object"); + } + } + } + + /// + /// Get the actual instance of `JobLogLine`. If the actual instance is not `JobLogLine`, + /// the InvalidClassException will be thrown + /// + /// An instance of JobLogLine + public JobLogLine GetJobLogLine() + { + return (JobLogLine)ActualInstance; + } + + /// + /// Get the actual instance of `Object`. If the actual instance is not `Object`, + /// the InvalidClassException will be thrown + /// + /// An instance of Object + public Object GetObject() + { + return (Object)ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class JobLogEvents {\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(ActualInstance, JobLogEvents.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of JobLogEvents + /// + /// JSON string + /// An instance of JobLogEvents + public static JobLogEvents FromJson(string jsonString) + { + JobLogEvents newJobLogEvents = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newJobLogEvents; + } + + try + { + newJobLogEvents = new JobLogEvents(JsonConvert.DeserializeObject(jsonString, JobLogEvents.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newJobLogEvents; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into JobLogLine: {1}", jsonString, exception.ToString())); + } + + try + { + newJobLogEvents = new JobLogEvents(JsonConvert.DeserializeObject(jsonString, JobLogEvents.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newJobLogEvents; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Object: {1}", jsonString, exception.ToString())); + } + + // no match found, throw an exception + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + + } + + /// + /// Custom JSON converter for JobLogEvents + /// + public class JobLogEventsJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(JobLogEvents).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + switch(reader.TokenType) + { + case JsonToken.StartObject: + return JobLogEvents.FromJson(JObject.Load(reader).ToString(Formatting.None)); + case JsonToken.StartArray: + return JobLogEvents.FromJson(JArray.Load(reader).ToString(Formatting.None)); + default: + return null; + } + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/JobLogLine.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/JobLogLine.cs new file mode 100644 index 000000000..ff3f19583 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/JobLogLine.cs @@ -0,0 +1,84 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// A single line of a job's log output. + /// + [DataContract(Name = "JobLogLine")] + public partial class JobLogLine + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected JobLogLine() { } + /// + /// Initializes a new instance of the class. + /// + /// The raw log line (already newline-terminated in the buffer). (required). + public JobLogLine(string line = default) + { + // to ensure "line" is required (not null) + if (line == null) + { + throw new ArgumentNullException("line is a required property for JobLogLine and cannot be null"); + } + this.Line = line; + } + + /// + /// The raw log line (already newline-terminated in the buffer). + /// + /// The raw log line (already newline-terminated in the buffer). + [DataMember(Name = "line", IsRequired = true, EmitDefaultValue = true)] + public string Line { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class JobLogLine {\n"); + sb.Append(" Line: ").Append(Line).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/JobStatus.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/JobStatus.cs new file mode 100644 index 000000000..6806f9010 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/JobStatus.cs @@ -0,0 +1,187 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; +using System.Reflection; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// Job lifecycle state. + /// + [JsonConverter(typeof(JobStatusJsonConverter))] + [DataContract(Name = "JobStatus")] + public partial class JobStatus : AbstractOpenAPISchema + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of string. + public JobStatus(string actualInstance) + { + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(string)) + { + _actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: string"); + } + } + } + + /// + /// Get the actual instance of `string`. If the actual instance is not `string`, + /// the InvalidClassException will be thrown + /// + /// An instance of string + public string GetString() + { + return (string)ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class JobStatus {\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(ActualInstance, JobStatus.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of JobStatus + /// + /// JSON string + /// An instance of JobStatus + public static JobStatus FromJson(string jsonString) + { + JobStatus newJobStatus = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newJobStatus; + } + + try + { + newJobStatus = new JobStatus(JsonConvert.DeserializeObject(jsonString, JobStatus.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newJobStatus; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into string: {1}", jsonString, exception.ToString())); + } + + // no match found, throw an exception + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + + } + + /// + /// Custom JSON converter for JobStatus + /// + public class JobStatusJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(JobStatus).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + switch(reader.TokenType) + { + case JsonToken.String: + return new JobStatus(Convert.ToString(reader.Value)); + case JsonToken.StartObject: + return JobStatus.FromJson(JObject.Load(reader).ToString(Formatting.None)); + case JsonToken.StartArray: + return JobStatus.FromJson(JArray.Load(reader).ToString(Formatting.None)); + default: + return null; + } + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/LanguageConfiguration.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/LanguageConfiguration.cs new file mode 100644 index 000000000..34ce1a0a5 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/LanguageConfiguration.cs @@ -0,0 +1,102 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// Language/locale configuration (`ios.LanguageConfiguration`), returned by `GET/PUT /device/{udid}/lang`. + /// + [DataContract(Name = "LanguageConfiguration")] + public partial class LanguageConfiguration + { + /// + /// Initializes a new instance of the class. + /// + /// language. + /// locale. + /// Supported locales advertised by the device.. + /// Supported UI languages advertised by the device.. + public LanguageConfiguration(string language = default, string locale = default, List supportedLocales = default, List supportedLanguages = default) + { + this.Language = language; + this.Locale = locale; + this.SupportedLocales = supportedLocales; + this.SupportedLanguages = supportedLanguages; + } + + /// + /// Gets or Sets Language + /// + [DataMember(Name = "Language", EmitDefaultValue = false)] + public string Language { get; set; } + + /// + /// Gets or Sets Locale + /// + [DataMember(Name = "Locale", EmitDefaultValue = false)] + public string Locale { get; set; } + + /// + /// Supported locales advertised by the device. + /// + /// Supported locales advertised by the device. + [DataMember(Name = "SupportedLocales", EmitDefaultValue = false)] + public List SupportedLocales { get; set; } + + /// + /// Supported UI languages advertised by the device. + /// + /// Supported UI languages advertised by the device. + [DataMember(Name = "SupportedLanguages", EmitDefaultValue = false)] + public List SupportedLanguages { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class LanguageConfiguration {\n"); + sb.Append(" Language: ").Append(Language).Append("\n"); + sb.Append(" Locale: ").Append(Locale).Append("\n"); + sb.Append(" SupportedLocales: ").Append(SupportedLocales).Append("\n"); + sb.Append(" SupportedLanguages: ").Append(SupportedLanguages).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/ListenEvents.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/ListenEvents.cs new file mode 100644 index 000000000..cc201aea2 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/ListenEvents.cs @@ -0,0 +1,223 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; +using System.Reflection; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// ListenEvents + /// + [JsonConverter(typeof(ListenEventsJsonConverter))] + [DataContract(Name = "ListenEvents")] + public partial class ListenEvents : AbstractOpenAPISchema + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of AttachDetachEvent. + public ListenEvents(AttachDetachEvent actualInstance) + { + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Object. + public ListenEvents(Object actualInstance) + { + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(AttachDetachEvent)) + { + _actualInstance = value; + } + else if (value.GetType() == typeof(Object)) + { + _actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: AttachDetachEvent, Object"); + } + } + } + + /// + /// Get the actual instance of `AttachDetachEvent`. If the actual instance is not `AttachDetachEvent`, + /// the InvalidClassException will be thrown + /// + /// An instance of AttachDetachEvent + public AttachDetachEvent GetAttachDetachEvent() + { + return (AttachDetachEvent)ActualInstance; + } + + /// + /// Get the actual instance of `Object`. If the actual instance is not `Object`, + /// the InvalidClassException will be thrown + /// + /// An instance of Object + public Object GetObject() + { + return (Object)ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ListenEvents {\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(ActualInstance, ListenEvents.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of ListenEvents + /// + /// JSON string + /// An instance of ListenEvents + public static ListenEvents FromJson(string jsonString) + { + ListenEvents newListenEvents = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newListenEvents; + } + + try + { + newListenEvents = new ListenEvents(JsonConvert.DeserializeObject(jsonString, ListenEvents.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newListenEvents; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into AttachDetachEvent: {1}", jsonString, exception.ToString())); + } + + try + { + newListenEvents = new ListenEvents(JsonConvert.DeserializeObject(jsonString, ListenEvents.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newListenEvents; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Object: {1}", jsonString, exception.ToString())); + } + + // no match found, throw an exception + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + + } + + /// + /// Custom JSON converter for ListenEvents + /// + public class ListenEventsJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(ListenEvents).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + switch(reader.TokenType) + { + case JsonToken.StartObject: + return ListenEvents.FromJson(JObject.Load(reader).ToString(Formatting.None)); + case JsonToken.StartArray: + return ListenEvents.FromJson(JArray.Load(reader).ToString(Formatting.None)); + default: + return null; + } + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/MemLimitRequest.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/MemLimitRequest.cs new file mode 100644 index 000000000..10e56253e --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/MemLimitRequest.cs @@ -0,0 +1,84 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `POST /device/{udid}/memlimitoff` request. + /// + [DataContract(Name = "MemLimitRequest")] + public partial class MemLimitRequest + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected MemLimitRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// Process name whose memory limit should be waived. (required). + public MemLimitRequest(string process = default) + { + // to ensure "process" is required (not null) + if (process == null) + { + throw new ArgumentNullException("process is a required property for MemLimitRequest and cannot be null"); + } + this.Process = process; + } + + /// + /// Process name whose memory limit should be waived. + /// + /// Process name whose memory limit should be waived. + [DataMember(Name = "process", IsRequired = true, EmitDefaultValue = true)] + public string Process { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class MemLimitRequest {\n"); + sb.Append(" Process: ").Append(Process).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/MemLimitResult.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/MemLimitResult.cs new file mode 100644 index 000000000..6dc155b3f --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/MemLimitResult.cs @@ -0,0 +1,101 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `POST /device/{udid}/memlimitoff` response. + /// + [DataContract(Name = "MemLimitResult")] + public partial class MemLimitResult + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected MemLimitResult() { } + /// + /// Initializes a new instance of the class. + /// + /// process (required). + /// pid (required). + /// disabled (required). + public MemLimitResult(string process = default, int pid = default, bool disabled = default) + { + // to ensure "process" is required (not null) + if (process == null) + { + throw new ArgumentNullException("process is a required property for MemLimitResult and cannot be null"); + } + this.Process = process; + this.Pid = pid; + this.Disabled = disabled; + } + + /// + /// Gets or Sets Process + /// + [DataMember(Name = "process", IsRequired = true, EmitDefaultValue = true)] + public string Process { get; set; } + + /// + /// Gets or Sets Pid + /// + [DataMember(Name = "pid", IsRequired = true, EmitDefaultValue = true)] + public int Pid { get; set; } + + /// + /// Gets or Sets Disabled + /// + [DataMember(Name = "disabled", IsRequired = true, EmitDefaultValue = true)] + public bool Disabled { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class MemLimitResult {\n"); + sb.Append(" Process: ").Append(Process).Append("\n"); + sb.Append(" Pid: ").Append(Pid).Append("\n"); + sb.Append(" Disabled: ").Append(Disabled).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/MountedImages.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/MountedImages.cs new file mode 100644 index 000000000..32710a146 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/MountedImages.cs @@ -0,0 +1,93 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `GET /device/{udid}/image/list` — mounted DDI signatures. + /// + [DataContract(Name = "MountedImages")] + public partial class MountedImages + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected MountedImages() { } + /// + /// Initializes a new instance of the class. + /// + /// Hex-encoded image signatures. (required). + /// count (required). + public MountedImages(List signatures = default, int count = default) + { + // to ensure "signatures" is required (not null) + if (signatures == null) + { + throw new ArgumentNullException("signatures is a required property for MountedImages and cannot be null"); + } + this.Signatures = signatures; + this.Count = count; + } + + /// + /// Hex-encoded image signatures. + /// + /// Hex-encoded image signatures. + [DataMember(Name = "signatures", IsRequired = true, EmitDefaultValue = true)] + public List Signatures { get; set; } + + /// + /// Gets or Sets Count + /// + [DataMember(Name = "count", IsRequired = true, EmitDefaultValue = true)] + public int Count { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class MountedImages {\n"); + sb.Append(" Signatures: ").Append(Signatures).Append("\n"); + sb.Append(" Count: ").Append(Count).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/NetworkInfo.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/NetworkInfo.cs new file mode 100644 index 000000000..712592e63 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/NetworkInfo.cs @@ -0,0 +1,94 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `GET /device/{udid}/ip` — device network info discovered over pcapd (`pcap.NetworkInfo`). + /// + [DataContract(Name = "NetworkInfo")] + public partial class NetworkInfo + { + /// + /// Initializes a new instance of the class. + /// + /// Hardware (MAC) address.. + /// IPv4 address, when discovered.. + /// IPv6 address, when discovered.. + public NetworkInfo(string macAddress = default, string iPv4 = default, string iPv6 = default) + { + this.MacAddress = macAddress; + this.IPv4 = iPv4; + this.IPv6 = iPv6; + } + + /// + /// Hardware (MAC) address. + /// + /// Hardware (MAC) address. + [DataMember(Name = "MacAddress", EmitDefaultValue = false)] + public string MacAddress { get; set; } + + /// + /// IPv4 address, when discovered. + /// + /// IPv4 address, when discovered. + [DataMember(Name = "IPv4", EmitDefaultValue = false)] + public string IPv4 { get; set; } + + /// + /// IPv6 address, when discovered. + /// + /// IPv6 address, when discovered. + [DataMember(Name = "IPv6", EmitDefaultValue = false)] + public string IPv6 { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NetworkInfo {\n"); + sb.Append(" MacAddress: ").Append(MacAddress).Append("\n"); + sb.Append(" IPv4: ").Append(IPv4).Append("\n"); + sb.Append(" IPv6: ").Append(IPv6).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/NotificationEvents.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/NotificationEvents.cs new file mode 100644 index 000000000..f11a399a7 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/NotificationEvents.cs @@ -0,0 +1,223 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; +using System.Reflection; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// NotificationEvents + /// + [JsonConverter(typeof(NotificationEventsJsonConverter))] + [DataContract(Name = "NotificationEvents")] + public partial class NotificationEvents : AbstractOpenAPISchema + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of AppStateNotification. + public NotificationEvents(AppStateNotification actualInstance) + { + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Object. + public NotificationEvents(Object actualInstance) + { + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(AppStateNotification)) + { + _actualInstance = value; + } + else if (value.GetType() == typeof(Object)) + { + _actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: AppStateNotification, Object"); + } + } + } + + /// + /// Get the actual instance of `AppStateNotification`. If the actual instance is not `AppStateNotification`, + /// the InvalidClassException will be thrown + /// + /// An instance of AppStateNotification + public AppStateNotification GetAppStateNotification() + { + return (AppStateNotification)ActualInstance; + } + + /// + /// Get the actual instance of `Object`. If the actual instance is not `Object`, + /// the InvalidClassException will be thrown + /// + /// An instance of Object + public Object GetObject() + { + return (Object)ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class NotificationEvents {\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(ActualInstance, NotificationEvents.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of NotificationEvents + /// + /// JSON string + /// An instance of NotificationEvents + public static NotificationEvents FromJson(string jsonString) + { + NotificationEvents newNotificationEvents = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newNotificationEvents; + } + + try + { + newNotificationEvents = new NotificationEvents(JsonConvert.DeserializeObject(jsonString, NotificationEvents.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newNotificationEvents; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into AppStateNotification: {1}", jsonString, exception.ToString())); + } + + try + { + newNotificationEvents = new NotificationEvents(JsonConvert.DeserializeObject(jsonString, NotificationEvents.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newNotificationEvents; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Object: {1}", jsonString, exception.ToString())); + } + + // no match found, throw an exception + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + + } + + /// + /// Custom JSON converter for NotificationEvents + /// + public class NotificationEventsJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(NotificationEvents).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + switch(reader.TokenType) + { + case JsonToken.StartObject: + return NotificationEvents.FromJson(JObject.Load(reader).ToString(Formatting.None)); + case JsonToken.StartArray: + return NotificationEvents.FromJson(JArray.Load(reader).ToString(Formatting.None)); + default: + return null; + } + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/OsTraceEntry.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/OsTraceEntry.cs new file mode 100644 index 000000000..e25e9bc43 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/OsTraceEntry.cs @@ -0,0 +1,144 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// A structured os_log trace entry. + /// + [DataContract(Name = "OsTraceEntry")] + public partial class OsTraceEntry + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected OsTraceEntry() { } + /// + /// Initializes a new instance of the class. + /// + /// Process id that emitted the entry.. + /// Emitting process/executable name.. + /// Log level, e.g. `default`, `info`, `debug`, `error`, `fault`.. + /// Subsystem string (e.g. `com.apple.network`).. + /// Category within the subsystem.. + /// The formatted log message. (required). + /// Unix epoch milliseconds when the entry was emitted, if known.. + public OsTraceEntry(int pid = default, string processName = default, string level = default, string subsystem = default, string category = default, string message = default, long timestamp = default) + { + // to ensure "message" is required (not null) + if (message == null) + { + throw new ArgumentNullException("message is a required property for OsTraceEntry and cannot be null"); + } + this.Message = message; + this.Pid = pid; + this.ProcessName = processName; + this.Level = level; + this.Subsystem = subsystem; + this.Category = category; + this.Timestamp = timestamp; + } + + /// + /// Process id that emitted the entry. + /// + /// Process id that emitted the entry. + [DataMember(Name = "pid", EmitDefaultValue = false)] + public int Pid { get; set; } + + /// + /// Emitting process/executable name. + /// + /// Emitting process/executable name. + [DataMember(Name = "processName", EmitDefaultValue = false)] + public string ProcessName { get; set; } + + /// + /// Log level, e.g. `default`, `info`, `debug`, `error`, `fault`. + /// + /// Log level, e.g. `default`, `info`, `debug`, `error`, `fault`. + [DataMember(Name = "level", EmitDefaultValue = false)] + public string Level { get; set; } + + /// + /// Subsystem string (e.g. `com.apple.network`). + /// + /// Subsystem string (e.g. `com.apple.network`). + [DataMember(Name = "subsystem", EmitDefaultValue = false)] + public string Subsystem { get; set; } + + /// + /// Category within the subsystem. + /// + /// Category within the subsystem. + [DataMember(Name = "category", EmitDefaultValue = false)] + public string Category { get; set; } + + /// + /// The formatted log message. + /// + /// The formatted log message. + [DataMember(Name = "message", IsRequired = true, EmitDefaultValue = true)] + public string Message { get; set; } + + /// + /// Unix epoch milliseconds when the entry was emitted, if known. + /// + /// Unix epoch milliseconds when the entry was emitted, if known. + [DataMember(Name = "timestamp", EmitDefaultValue = false)] + public long Timestamp { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class OsTraceEntry {\n"); + sb.Append(" Pid: ").Append(Pid).Append("\n"); + sb.Append(" ProcessName: ").Append(ProcessName).Append("\n"); + sb.Append(" Level: ").Append(Level).Append("\n"); + sb.Append(" Subsystem: ").Append(Subsystem).Append("\n"); + sb.Append(" Category: ").Append(Category).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append(" Timestamp: ").Append(Timestamp).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/OsTraceEvents.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/OsTraceEvents.cs new file mode 100644 index 000000000..8bd54589e --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/OsTraceEvents.cs @@ -0,0 +1,223 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; +using System.Reflection; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// OsTraceEvents + /// + [JsonConverter(typeof(OsTraceEventsJsonConverter))] + [DataContract(Name = "OsTraceEvents")] + public partial class OsTraceEvents : AbstractOpenAPISchema + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of OsTraceEntry. + public OsTraceEvents(OsTraceEntry actualInstance) + { + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Object. + public OsTraceEvents(Object actualInstance) + { + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(Object)) + { + _actualInstance = value; + } + else if (value.GetType() == typeof(OsTraceEntry)) + { + _actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: Object, OsTraceEntry"); + } + } + } + + /// + /// Get the actual instance of `OsTraceEntry`. If the actual instance is not `OsTraceEntry`, + /// the InvalidClassException will be thrown + /// + /// An instance of OsTraceEntry + public OsTraceEntry GetOsTraceEntry() + { + return (OsTraceEntry)ActualInstance; + } + + /// + /// Get the actual instance of `Object`. If the actual instance is not `Object`, + /// the InvalidClassException will be thrown + /// + /// An instance of Object + public Object GetObject() + { + return (Object)ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OsTraceEvents {\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(ActualInstance, OsTraceEvents.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of OsTraceEvents + /// + /// JSON string + /// An instance of OsTraceEvents + public static OsTraceEvents FromJson(string jsonString) + { + OsTraceEvents newOsTraceEvents = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newOsTraceEvents; + } + + try + { + newOsTraceEvents = new OsTraceEvents(JsonConvert.DeserializeObject(jsonString, OsTraceEvents.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newOsTraceEvents; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Object: {1}", jsonString, exception.ToString())); + } + + try + { + newOsTraceEvents = new OsTraceEvents(JsonConvert.DeserializeObject(jsonString, OsTraceEvents.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newOsTraceEvents; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into OsTraceEntry: {1}", jsonString, exception.ToString())); + } + + // no match found, throw an exception + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + + } + + /// + /// Custom JSON converter for OsTraceEvents + /// + public class OsTraceEventsJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(OsTraceEvents).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + switch(reader.TokenType) + { + case JsonToken.StartObject: + return OsTraceEvents.FromJson(JObject.Load(reader).ToString(Formatting.None)); + case JsonToken.StartArray: + return OsTraceEvents.FromJson(JArray.Load(reader).ToString(Formatting.None)); + default: + return null; + } + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/PasteboardContent.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/PasteboardContent.cs new file mode 100644 index 000000000..fedeef488 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/PasteboardContent.cs @@ -0,0 +1,94 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `GET /device/{udid}/pasteboard` — clipboard contents. + /// + [DataContract(Name = "PasteboardContent")] + public partial class PasteboardContent + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected PasteboardContent() { } + /// + /// Initializes a new instance of the class. + /// + /// Whether any text was present on the pasteboard. (required). + /// The clipboard text (empty when `present` is false). (required). + public PasteboardContent(bool present = default, string text = default) + { + this.Present = present; + // to ensure "text" is required (not null) + if (text == null) + { + throw new ArgumentNullException("text is a required property for PasteboardContent and cannot be null"); + } + this.Text = text; + } + + /// + /// Whether any text was present on the pasteboard. + /// + /// Whether any text was present on the pasteboard. + [DataMember(Name = "present", IsRequired = true, EmitDefaultValue = true)] + public bool Present { get; set; } + + /// + /// The clipboard text (empty when `present` is false). + /// + /// The clipboard text (empty when `present` is false). + [DataMember(Name = "text", IsRequired = true, EmitDefaultValue = true)] + public string Text { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class PasteboardContent {\n"); + sb.Append(" Present: ").Append(Present).Append("\n"); + sb.Append(" Text: ").Append(Text).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/PrepareResult.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/PrepareResult.cs new file mode 100644 index 000000000..43dc74980 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/PrepareResult.cs @@ -0,0 +1,94 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `POST /device/{udid}/prepare` — device preparation acknowledgement. + /// + [DataContract(Name = "PrepareResult")] + public partial class PrepareResult + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected PrepareResult() { } + /// + /// Initializes a new instance of the class. + /// + /// Always `prepared`. (required). + /// Whether the device was supervised (a supervision cert was supplied). (required). + public PrepareResult(string status = default, bool supervised = default) + { + // to ensure "status" is required (not null) + if (status == null) + { + throw new ArgumentNullException("status is a required property for PrepareResult and cannot be null"); + } + this.Status = status; + this.Supervised = supervised; + } + + /// + /// Always `prepared`. + /// + /// Always `prepared`. + [DataMember(Name = "status", IsRequired = true, EmitDefaultValue = true)] + public string Status { get; set; } + + /// + /// Whether the device was supervised (a supervision cert was supplied). + /// + /// Whether the device was supervised (a supervision cert was supplied). + [DataMember(Name = "supervised", IsRequired = true, EmitDefaultValue = true)] + public bool Supervised { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class PrepareResult {\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" Supervised: ").Append(Supervised).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/PrepareSkipOptions.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/PrepareSkipOptions.cs new file mode 100644 index 000000000..003b75c52 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/PrepareSkipOptions.cs @@ -0,0 +1,94 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `GET /prepare/skip-options` — the static list of setup-pane skip options usable when preparing a device. Host-scoped (device-free). + /// + [DataContract(Name = "PrepareSkipOptions")] + public partial class PrepareSkipOptions + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected PrepareSkipOptions() { } + /// + /// Initializes a new instance of the class. + /// + /// All available skip-option identifiers. (required). + /// Number of options. (required). + public PrepareSkipOptions(List options = default, int count = default) + { + // to ensure "options" is required (not null) + if (options == null) + { + throw new ArgumentNullException("options is a required property for PrepareSkipOptions and cannot be null"); + } + this.Options = options; + this.Count = count; + } + + /// + /// All available skip-option identifiers. + /// + /// All available skip-option identifiers. + [DataMember(Name = "options", IsRequired = true, EmitDefaultValue = true)] + public List Options { get; set; } + + /// + /// Number of options. + /// + /// Number of options. + [DataMember(Name = "count", IsRequired = true, EmitDefaultValue = true)] + public int Count { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class PrepareSkipOptions {\n"); + sb.Append(" Options: ").Append(Options).Append("\n"); + sb.Append(" Count: ").Append(Count).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/ProcessInfo.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/ProcessInfo.cs new file mode 100644 index 000000000..38bdd4c8d --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/ProcessInfo.cs @@ -0,0 +1,120 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// A running process entry (`instruments.ProcessInfo`) from `GET /device/{udid}/processes`. + /// + [DataContract(Name = "ProcessInfo")] + public partial class ProcessInfo + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ProcessInfo() { } + /// + /// Initializes a new instance of the class. + /// + /// pid (required). + /// name (required). + /// realAppName. + /// isApplication. + /// Process start time, ISO-8601.. + public ProcessInfo(int pid = default, string name = default, string realAppName = default, bool isApplication = default, DateTimeOffset startDate = default) + { + this.Pid = pid; + // to ensure "name" is required (not null) + if (name == null) + { + throw new ArgumentNullException("name is a required property for ProcessInfo and cannot be null"); + } + this.Name = name; + this.RealAppName = realAppName; + this.IsApplication = isApplication; + this.StartDate = startDate; + } + + /// + /// Gets or Sets Pid + /// + [DataMember(Name = "pid", IsRequired = true, EmitDefaultValue = true)] + public int Pid { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] + public string Name { get; set; } + + /// + /// Gets or Sets RealAppName + /// + [DataMember(Name = "realAppName", EmitDefaultValue = false)] + public string RealAppName { get; set; } + + /// + /// Gets or Sets IsApplication + /// + [DataMember(Name = "isApplication", EmitDefaultValue = true)] + public bool IsApplication { get; set; } + + /// + /// Process start time, ISO-8601. + /// + /// Process start time, ISO-8601. + [DataMember(Name = "startDate", EmitDefaultValue = false)] + public DateTimeOffset StartDate { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ProcessInfo {\n"); + sb.Append(" Pid: ").Append(Pid).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" RealAppName: ").Append(RealAppName).Append("\n"); + sb.Append(" IsApplication: ").Append(IsApplication).Append("\n"); + sb.Append(" StartDate: ").Append(StartDate).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/Profile.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/Profile.cs new file mode 100644 index 000000000..cb08c8136 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/Profile.cs @@ -0,0 +1,106 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// A single condition profile within a `ProfileType`. + /// + [DataContract(Name = "Profile")] + public partial class Profile + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Profile() { } + /// + /// Initializes a new instance of the class. + /// + /// description. + /// identifier (required). + /// name (required). + public Profile(string description = default, string identifier = default, string name = default) + { + // to ensure "identifier" is required (not null) + if (identifier == null) + { + throw new ArgumentNullException("identifier is a required property for Profile and cannot be null"); + } + this.Identifier = identifier; + // to ensure "name" is required (not null) + if (name == null) + { + throw new ArgumentNullException("name is a required property for Profile and cannot be null"); + } + this.Name = name; + this.Description = description; + } + + /// + /// Gets or Sets Description + /// + [DataMember(Name = "description", EmitDefaultValue = false)] + public string Description { get; set; } + + /// + /// Gets or Sets Identifier + /// + [DataMember(Name = "identifier", IsRequired = true, EmitDefaultValue = true)] + public string Identifier { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Profile {\n"); + sb.Append(" Description: ").Append(Description).Append("\n"); + sb.Append(" Identifier: ").Append(Identifier).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/ProfileType.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/ProfileType.cs new file mode 100644 index 000000000..e698ee738 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/ProfileType.cs @@ -0,0 +1,156 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// A condition inducer profile type (e.g. thermal, network) with its variants. + /// + [DataContract(Name = "ProfileType")] + public partial class ProfileType + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ProfileType() { } + /// + /// Initializes a new instance of the class. + /// + /// activeProfile. + /// identifier (required). + /// profilesSorted. + /// isActive. + /// name (required). + /// isDestructive. + /// isInternal. + /// profiles (required). + public ProfileType(string activeProfile = default, string identifier = default, bool profilesSorted = default, bool isActive = default, string name = default, bool isDestructive = default, bool isInternal = default, List profiles = default) + { + // to ensure "identifier" is required (not null) + if (identifier == null) + { + throw new ArgumentNullException("identifier is a required property for ProfileType and cannot be null"); + } + this.Identifier = identifier; + // to ensure "name" is required (not null) + if (name == null) + { + throw new ArgumentNullException("name is a required property for ProfileType and cannot be null"); + } + this.Name = name; + // to ensure "profiles" is required (not null) + if (profiles == null) + { + throw new ArgumentNullException("profiles is a required property for ProfileType and cannot be null"); + } + this.Profiles = profiles; + this.ActiveProfile = activeProfile; + this.ProfilesSorted = profilesSorted; + this.IsActive = isActive; + this.IsDestructive = isDestructive; + this.IsInternal = isInternal; + } + + /// + /// Gets or Sets ActiveProfile + /// + [DataMember(Name = "activeProfile", EmitDefaultValue = false)] + public string ActiveProfile { get; set; } + + /// + /// Gets or Sets Identifier + /// + [DataMember(Name = "identifier", IsRequired = true, EmitDefaultValue = true)] + public string Identifier { get; set; } + + /// + /// Gets or Sets ProfilesSorted + /// + [DataMember(Name = "profilesSorted", EmitDefaultValue = true)] + public bool ProfilesSorted { get; set; } + + /// + /// Gets or Sets IsActive + /// + [DataMember(Name = "isActive", EmitDefaultValue = true)] + public bool IsActive { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] + public string Name { get; set; } + + /// + /// Gets or Sets IsDestructive + /// + [DataMember(Name = "isDestructive", EmitDefaultValue = true)] + public bool IsDestructive { get; set; } + + /// + /// Gets or Sets IsInternal + /// + [DataMember(Name = "isInternal", EmitDefaultValue = true)] + public bool IsInternal { get; set; } + + /// + /// Gets or Sets Profiles + /// + [DataMember(Name = "profiles", IsRequired = true, EmitDefaultValue = true)] + public List Profiles { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ProfileType {\n"); + sb.Append(" ActiveProfile: ").Append(ActiveProfile).Append("\n"); + sb.Append(" Identifier: ").Append(Identifier).Append("\n"); + sb.Append(" ProfilesSorted: ").Append(ProfilesSorted).Append("\n"); + sb.Append(" IsActive: ").Append(IsActive).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" IsDestructive: ").Append(IsDestructive).Append("\n"); + sb.Append(" IsInternal: ").Append(IsInternal).Append("\n"); + sb.Append(" Profiles: ").Append(Profiles).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/ProvisioningResult.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/ProvisioningResult.cs new file mode 100644 index 000000000..917a2e7de --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/ProvisioningResult.cs @@ -0,0 +1,134 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `POST /sign/provision` — provisioning assets envelope. The mobileprovision (and optionally the P12) are base64-encoded so one JSON response can carry both binary artifacts. Host-scoped (device-free). + /// + [DataContract(Name = "ProvisioningResult")] + public partial class ProvisioningResult + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ProvisioningResult() { } + /// + /// Initializes a new instance of the class. + /// + /// The app bundle identifier registered with App Store Connect. (required). + /// The signing certificate resource id. (required). + /// The `.mobileprovision`, base64-encoded. (required). + /// The generated `.p12`, base64-encoded (absent when reusing a certificate).. + /// The password protecting `p12Base64`, echoed back (client-supplied).. + public ProvisioningResult(string bundleId = default, string certificateId = default, string mobileprovisionBase64 = default, string p12Base64 = default, string p12Password = default) + { + // to ensure "bundleId" is required (not null) + if (bundleId == null) + { + throw new ArgumentNullException("bundleId is a required property for ProvisioningResult and cannot be null"); + } + this.BundleId = bundleId; + // to ensure "certificateId" is required (not null) + if (certificateId == null) + { + throw new ArgumentNullException("certificateId is a required property for ProvisioningResult and cannot be null"); + } + this.CertificateId = certificateId; + // to ensure "mobileprovisionBase64" is required (not null) + if (mobileprovisionBase64 == null) + { + throw new ArgumentNullException("mobileprovisionBase64 is a required property for ProvisioningResult and cannot be null"); + } + this.MobileprovisionBase64 = mobileprovisionBase64; + this.P12Base64 = p12Base64; + this.P12Password = p12Password; + } + + /// + /// The app bundle identifier registered with App Store Connect. + /// + /// The app bundle identifier registered with App Store Connect. + [DataMember(Name = "bundleId", IsRequired = true, EmitDefaultValue = true)] + public string BundleId { get; set; } + + /// + /// The signing certificate resource id. + /// + /// The signing certificate resource id. + [DataMember(Name = "certificateId", IsRequired = true, EmitDefaultValue = true)] + public string CertificateId { get; set; } + + /// + /// The `.mobileprovision`, base64-encoded. + /// + /// The `.mobileprovision`, base64-encoded. + [DataMember(Name = "mobileprovisionBase64", IsRequired = true, EmitDefaultValue = true)] + public string MobileprovisionBase64 { get; set; } + + /// + /// The generated `.p12`, base64-encoded (absent when reusing a certificate). + /// + /// The generated `.p12`, base64-encoded (absent when reusing a certificate). + [DataMember(Name = "p12Base64", EmitDefaultValue = false)] + public string P12Base64 { get; set; } + + /// + /// The password protecting `p12Base64`, echoed back (client-supplied). + /// + /// The password protecting `p12Base64`, echoed back (client-supplied). + [DataMember(Name = "p12Password", EmitDefaultValue = false)] + public string P12Password { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ProvisioningResult {\n"); + sb.Append(" BundleId: ").Append(BundleId).Append("\n"); + sb.Append(" CertificateId: ").Append(CertificateId).Append("\n"); + sb.Append(" MobileprovisionBase64: ").Append(MobileprovisionBase64).Append("\n"); + sb.Append(" P12Base64: ").Append(P12Base64).Append("\n"); + sb.Append(" P12Password: ").Append(P12Password).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/RsdServiceEntry.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/RsdServiceEntry.cs new file mode 100644 index 000000000..82be11988 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/RsdServiceEntry.cs @@ -0,0 +1,84 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// A single RSD (Remote Service Discovery) service entry. + /// + [DataContract(Name = "RsdServiceEntry")] + public partial class RsdServiceEntry + { + /// + /// Initializes a new instance of the class. + /// + /// TCP port the service is reachable on over the tunnel.. + /// Wire protocol (e.g. `tcp`).. + public RsdServiceEntry(int port = default, string protocolType = default) + { + this.Port = port; + this.ProtocolType = protocolType; + } + + /// + /// TCP port the service is reachable on over the tunnel. + /// + /// TCP port the service is reachable on over the tunnel. + [DataMember(Name = "Port", EmitDefaultValue = false)] + public int Port { get; set; } + + /// + /// Wire protocol (e.g. `tcp`). + /// + /// Wire protocol (e.g. `tcp`). + [DataMember(Name = "ProtocolType", EmitDefaultValue = false)] + public string ProtocolType { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class RsdServiceEntry {\n"); + sb.Append(" Port: ").Append(Port).Append("\n"); + sb.Append(" ProtocolType: ").Append(ProtocolType).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/RunTestRequest.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/RunTestRequest.cs new file mode 100644 index 000000000..35c01cc4a --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/RunTestRequest.cs @@ -0,0 +1,144 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `POST /device/{udid}/jobs/runtest` (and `runwda`) request. + /// + [DataContract(Name = "RunTestRequest")] + public partial class RunTestRequest + { + /// + /// Initializes a new instance of the class. + /// + /// Bundle id of the app under test.. + /// Bundle id of the test runner. Defaults to `bundleId` if omitted.. + /// Name of the `.xctestconfiguration`.. + /// Extra environment variables for the test runner.. + /// Extra process arguments for the test runner.. + /// Only run these tests (`Class/method` identifiers).. + /// Skip these tests.. + /// Run as a plain XCTest (vs XCUITest).. + public RunTestRequest(string bundleId = default, string testRunnerBundleId = default, string xctestConfig = default, Object env = default, List args = default, List testsToRun = default, List testsToSkip = default, bool xctest = default) + { + this.BundleId = bundleId; + this.TestRunnerBundleId = testRunnerBundleId; + this.XctestConfig = xctestConfig; + this.Env = env; + this.Args = args; + this.TestsToRun = testsToRun; + this.TestsToSkip = testsToSkip; + this.Xctest = xctest; + } + + /// + /// Bundle id of the app under test. + /// + /// Bundle id of the app under test. + [DataMember(Name = "bundleId", EmitDefaultValue = false)] + public string BundleId { get; set; } + + /// + /// Bundle id of the test runner. Defaults to `bundleId` if omitted. + /// + /// Bundle id of the test runner. Defaults to `bundleId` if omitted. + [DataMember(Name = "testRunnerBundleId", EmitDefaultValue = false)] + public string TestRunnerBundleId { get; set; } + + /// + /// Name of the `.xctestconfiguration`. + /// + /// Name of the `.xctestconfiguration`. + [DataMember(Name = "xctestConfig", EmitDefaultValue = false)] + public string XctestConfig { get; set; } + + /// + /// Extra environment variables for the test runner. + /// + /// Extra environment variables for the test runner. + [DataMember(Name = "env", EmitDefaultValue = false)] + public Object Env { get; set; } + + /// + /// Extra process arguments for the test runner. + /// + /// Extra process arguments for the test runner. + [DataMember(Name = "args", EmitDefaultValue = false)] + public List Args { get; set; } + + /// + /// Only run these tests (`Class/method` identifiers). + /// + /// Only run these tests (`Class/method` identifiers). + [DataMember(Name = "testsToRun", EmitDefaultValue = false)] + public List TestsToRun { get; set; } + + /// + /// Skip these tests. + /// + /// Skip these tests. + [DataMember(Name = "testsToSkip", EmitDefaultValue = false)] + public List TestsToSkip { get; set; } + + /// + /// Run as a plain XCTest (vs XCUITest). + /// + /// Run as a plain XCTest (vs XCUITest). + [DataMember(Name = "xctest", EmitDefaultValue = true)] + public bool Xctest { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class RunTestRequest {\n"); + sb.Append(" BundleId: ").Append(BundleId).Append("\n"); + sb.Append(" TestRunnerBundleId: ").Append(TestRunnerBundleId).Append("\n"); + sb.Append(" XctestConfig: ").Append(XctestConfig).Append("\n"); + sb.Append(" Env: ").Append(Env).Append("\n"); + sb.Append(" Args: ").Append(Args).Append("\n"); + sb.Append(" TestsToRun: ").Append(TestsToRun).Append("\n"); + sb.Append(" TestsToSkip: ").Append(TestsToSkip).Append("\n"); + sb.Append(" Xctest: ").Append(Xctest).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/SetLanguageRequest.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/SetLanguageRequest.cs new file mode 100644 index 000000000..b8ac7a1c9 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/SetLanguageRequest.cs @@ -0,0 +1,82 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `PUT /device/{udid}/lang` request. + /// + [DataContract(Name = "SetLanguageRequest")] + public partial class SetLanguageRequest + { + /// + /// Initializes a new instance of the class. + /// + /// language. + /// locale. + public SetLanguageRequest(string language = default, string locale = default) + { + this.Language = language; + this.Locale = locale; + } + + /// + /// Gets or Sets Language + /// + [DataMember(Name = "language", EmitDefaultValue = false)] + public string Language { get; set; } + + /// + /// Gets or Sets Locale + /// + [DataMember(Name = "locale", EmitDefaultValue = false)] + public string Locale { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class SetLanguageRequest {\n"); + sb.Append(" Language: ").Append(Language).Append("\n"); + sb.Append(" Locale: ").Append(Locale).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/StatusOk.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/StatusOk.cs new file mode 100644 index 000000000..49f97284b --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/StatusOk.cs @@ -0,0 +1,83 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// Simple `{ \"status\": \"ok\" }` acknowledgement used by MDM clear operations. + /// + [DataContract(Name = "StatusOk")] + public partial class StatusOk + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected StatusOk() { } + /// + /// Initializes a new instance of the class. + /// + /// status (required). + public StatusOk(string status = default) + { + // to ensure "status" is required (not null) + if (status == null) + { + throw new ArgumentNullException("status is a required property for StatusOk and cannot be null"); + } + this.Status = status; + } + + /// + /// Gets or Sets Status + /// + [DataMember(Name = "status", IsRequired = true, EmitDefaultValue = true)] + public string Status { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class StatusOk {\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/SupervisionCert.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/SupervisionCert.cs new file mode 100644 index 000000000..d1f1f6575 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/SupervisionCert.cs @@ -0,0 +1,129 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `POST /prepare/create-cert` — a generated self-signed supervision identity, returned as DER (base64) and PEM for both the certificate and private key. Host-scoped (device-free). + /// + [DataContract(Name = "SupervisionCert")] + public partial class SupervisionCert + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected SupervisionCert() { } + /// + /// Initializes a new instance of the class. + /// + /// Certificate in DER form, base64-encoded. (required). + /// Certificate in PEM form. (required). + /// Private key in DER form, base64-encoded. (required). + /// Private key in PEM form. (required). + public SupervisionCert(string certDerBase64 = default, string certPem = default, string privateKeyDerBase64 = default, string privateKeyPem = default) + { + // to ensure "certDerBase64" is required (not null) + if (certDerBase64 == null) + { + throw new ArgumentNullException("certDerBase64 is a required property for SupervisionCert and cannot be null"); + } + this.CertDerBase64 = certDerBase64; + // to ensure "certPem" is required (not null) + if (certPem == null) + { + throw new ArgumentNullException("certPem is a required property for SupervisionCert and cannot be null"); + } + this.CertPem = certPem; + // to ensure "privateKeyDerBase64" is required (not null) + if (privateKeyDerBase64 == null) + { + throw new ArgumentNullException("privateKeyDerBase64 is a required property for SupervisionCert and cannot be null"); + } + this.PrivateKeyDerBase64 = privateKeyDerBase64; + // to ensure "privateKeyPem" is required (not null) + if (privateKeyPem == null) + { + throw new ArgumentNullException("privateKeyPem is a required property for SupervisionCert and cannot be null"); + } + this.PrivateKeyPem = privateKeyPem; + } + + /// + /// Certificate in DER form, base64-encoded. + /// + /// Certificate in DER form, base64-encoded. + [DataMember(Name = "certDerBase64", IsRequired = true, EmitDefaultValue = true)] + public string CertDerBase64 { get; set; } + + /// + /// Certificate in PEM form. + /// + /// Certificate in PEM form. + [DataMember(Name = "certPem", IsRequired = true, EmitDefaultValue = true)] + public string CertPem { get; set; } + + /// + /// Private key in DER form, base64-encoded. + /// + /// Private key in DER form, base64-encoded. + [DataMember(Name = "privateKeyDerBase64", IsRequired = true, EmitDefaultValue = true)] + public string PrivateKeyDerBase64 { get; set; } + + /// + /// Private key in PEM form. + /// + /// Private key in PEM form. + [DataMember(Name = "privateKeyPem", IsRequired = true, EmitDefaultValue = true)] + public string PrivateKeyPem { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class SupervisionCert {\n"); + sb.Append(" CertDerBase64: ").Append(CertDerBase64).Append("\n"); + sb.Append(" CertPem: ").Append(CertPem).Append("\n"); + sb.Append(" PrivateKeyDerBase64: ").Append(PrivateKeyDerBase64).Append("\n"); + sb.Append(" PrivateKeyPem: ").Append(PrivateKeyPem).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/SyslogEvents.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/SyslogEvents.cs new file mode 100644 index 000000000..4d6dea53f --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/SyslogEvents.cs @@ -0,0 +1,223 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; +using System.Reflection; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// SyslogEvents + /// + [JsonConverter(typeof(SyslogEventsJsonConverter))] + [DataContract(Name = "SyslogEvents")] + public partial class SyslogEvents : AbstractOpenAPISchema + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of SyslogMessage. + public SyslogEvents(SyslogMessage actualInstance) + { + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Object. + public SyslogEvents(Object actualInstance) + { + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(Object)) + { + _actualInstance = value; + } + else if (value.GetType() == typeof(SyslogMessage)) + { + _actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: Object, SyslogMessage"); + } + } + } + + /// + /// Get the actual instance of `SyslogMessage`. If the actual instance is not `SyslogMessage`, + /// the InvalidClassException will be thrown + /// + /// An instance of SyslogMessage + public SyslogMessage GetSyslogMessage() + { + return (SyslogMessage)ActualInstance; + } + + /// + /// Get the actual instance of `Object`. If the actual instance is not `Object`, + /// the InvalidClassException will be thrown + /// + /// An instance of Object + public Object GetObject() + { + return (Object)ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class SyslogEvents {\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(ActualInstance, SyslogEvents.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of SyslogEvents + /// + /// JSON string + /// An instance of SyslogEvents + public static SyslogEvents FromJson(string jsonString) + { + SyslogEvents newSyslogEvents = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newSyslogEvents; + } + + try + { + newSyslogEvents = new SyslogEvents(JsonConvert.DeserializeObject(jsonString, SyslogEvents.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newSyslogEvents; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Object: {1}", jsonString, exception.ToString())); + } + + try + { + newSyslogEvents = new SyslogEvents(JsonConvert.DeserializeObject(jsonString, SyslogEvents.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newSyslogEvents; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into SyslogMessage: {1}", jsonString, exception.ToString())); + } + + // no match found, throw an exception + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + + } + + /// + /// Custom JSON converter for SyslogEvents + /// + public class SyslogEventsJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(SyslogEvents).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + switch(reader.TokenType) + { + case JsonToken.StartObject: + return SyslogEvents.FromJson(JObject.Load(reader).ToString(Formatting.None)); + case JsonToken.StartArray: + return SyslogEvents.FromJson(JArray.Load(reader).ToString(Formatting.None)); + default: + return null; + } + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/SyslogMessage.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/SyslogMessage.cs new file mode 100644 index 000000000..afbe4e70d --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/SyslogMessage.cs @@ -0,0 +1,94 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// A single syslog line from the device. + /// + [DataContract(Name = "SyslogMessage")] + public partial class SyslogMessage + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected SyslogMessage() { } + /// + /// Initializes a new instance of the class. + /// + /// The raw log message text. (required). + /// Unix epoch milliseconds when the line was emitted, if known.. + public SyslogMessage(string message = default, long timestamp = default) + { + // to ensure "message" is required (not null) + if (message == null) + { + throw new ArgumentNullException("message is a required property for SyslogMessage and cannot be null"); + } + this.Message = message; + this.Timestamp = timestamp; + } + + /// + /// The raw log message text. + /// + /// The raw log message text. + [DataMember(Name = "message", IsRequired = true, EmitDefaultValue = true)] + public string Message { get; set; } + + /// + /// Unix epoch milliseconds when the line was emitted, if known. + /// + /// Unix epoch milliseconds when the line was emitted, if known. + [DataMember(Name = "timestamp", EmitDefaultValue = false)] + public long Timestamp { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class SyslogMessage {\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append(" Timestamp: ").Append(Timestamp).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/SysmontapEvents.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/SysmontapEvents.cs new file mode 100644 index 000000000..05ebab6b4 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/SysmontapEvents.cs @@ -0,0 +1,223 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; +using System.Reflection; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// SysmontapEvents + /// + [JsonConverter(typeof(SysmontapEventsJsonConverter))] + [DataContract(Name = "SysmontapEvents")] + public partial class SysmontapEvents : AbstractOpenAPISchema + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of CpuUsageSample. + public SysmontapEvents(CpuUsageSample actualInstance) + { + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Object. + public SysmontapEvents(Object actualInstance) + { + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(CpuUsageSample)) + { + _actualInstance = value; + } + else if (value.GetType() == typeof(Object)) + { + _actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: CpuUsageSample, Object"); + } + } + } + + /// + /// Get the actual instance of `CpuUsageSample`. If the actual instance is not `CpuUsageSample`, + /// the InvalidClassException will be thrown + /// + /// An instance of CpuUsageSample + public CpuUsageSample GetCpuUsageSample() + { + return (CpuUsageSample)ActualInstance; + } + + /// + /// Get the actual instance of `Object`. If the actual instance is not `Object`, + /// the InvalidClassException will be thrown + /// + /// An instance of Object + public Object GetObject() + { + return (Object)ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class SysmontapEvents {\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(ActualInstance, SysmontapEvents.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of SysmontapEvents + /// + /// JSON string + /// An instance of SysmontapEvents + public static SysmontapEvents FromJson(string jsonString) + { + SysmontapEvents newSysmontapEvents = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newSysmontapEvents; + } + + try + { + newSysmontapEvents = new SysmontapEvents(JsonConvert.DeserializeObject(jsonString, SysmontapEvents.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newSysmontapEvents; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into CpuUsageSample: {1}", jsonString, exception.ToString())); + } + + try + { + newSysmontapEvents = new SysmontapEvents(JsonConvert.DeserializeObject(jsonString, SysmontapEvents.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newSysmontapEvents; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Object: {1}", jsonString, exception.ToString())); + } + + // no match found, throw an exception + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + + } + + /// + /// Custom JSON converter for SysmontapEvents + /// + public class SysmontapEventsJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(SysmontapEvents).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + switch(reader.TokenType) + { + case JsonToken.StartObject: + return SysmontapEvents.FromJson(JObject.Load(reader).ToString(Formatting.None)); + case JsonToken.StartArray: + return SysmontapEvents.FromJson(JArray.Load(reader).ToString(Formatting.None)); + default: + return null; + } + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/TimeFormatRequest.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/TimeFormatRequest.cs new file mode 100644 index 000000000..05da147b2 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/TimeFormatRequest.cs @@ -0,0 +1,78 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `PUT /device/{udid}/timeformat` request. + /// + [DataContract(Name = "TimeFormatRequest")] + public partial class TimeFormatRequest + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected TimeFormatRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// uses24Hour (required). + public TimeFormatRequest(bool uses24Hour = default) + { + this.Uses24Hour = uses24Hour; + } + + /// + /// Gets or Sets Uses24Hour + /// + [DataMember(Name = "uses24Hour", IsRequired = true, EmitDefaultValue = true)] + public bool Uses24Hour { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TimeFormatRequest {\n"); + sb.Append(" Uses24Hour: ").Append(Uses24Hour).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/TimeFormatState.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/TimeFormatState.cs new file mode 100644 index 000000000..dd5a54b26 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/TimeFormatState.cs @@ -0,0 +1,78 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `GET /device/{udid}/timeformat` — 24-hour clock state. + /// + [DataContract(Name = "TimeFormatState")] + public partial class TimeFormatState + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected TimeFormatState() { } + /// + /// Initializes a new instance of the class. + /// + /// uses24HourClock (required). + public TimeFormatState(bool uses24HourClock = default) + { + this.Uses24HourClock = uses24HourClock; + } + + /// + /// Gets or Sets Uses24HourClock + /// + [DataMember(Name = "Uses24HourClock", IsRequired = true, EmitDefaultValue = true)] + public bool Uses24HourClock { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TimeFormatState {\n"); + sb.Append(" Uses24HourClock: ").Append(Uses24HourClock).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/Tunnel.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/Tunnel.cs new file mode 100644 index 000000000..0b9717234 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/Tunnel.cs @@ -0,0 +1,129 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// A running device tunnel as reported by the tunnel agent (`GET /tunnels`, `POST /tunnels/{udid}/refresh`). Mirrors `tunnel.Tunnel`. + /// + [DataContract(Name = "Tunnel")] + public partial class Tunnel + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Tunnel() { } + /// + /// Initializes a new instance of the class. + /// + /// The device udid this tunnel serves. (required). + /// Tunnel address (IPv6) reachable for RemoteXPC/RSD. (required). + /// RemoteServiceDiscovery port on the tunnel. (required). + /// Whether this tunnel is a userspace TUN.. + /// Userspace TUN port, when `UserspaceTUN` is true.. + public Tunnel(string udid = default, string address = default, int rsdPort = default, bool userspaceTUN = default, int userspaceTUNPort = default) + { + // to ensure "udid" is required (not null) + if (udid == null) + { + throw new ArgumentNullException("udid is a required property for Tunnel and cannot be null"); + } + this.Udid = udid; + // to ensure "address" is required (not null) + if (address == null) + { + throw new ArgumentNullException("address is a required property for Tunnel and cannot be null"); + } + this.Address = address; + this.RsdPort = rsdPort; + this.UserspaceTUN = userspaceTUN; + this.UserspaceTUNPort = userspaceTUNPort; + } + + /// + /// The device udid this tunnel serves. + /// + /// The device udid this tunnel serves. + [DataMember(Name = "Udid", IsRequired = true, EmitDefaultValue = true)] + public string Udid { get; set; } + + /// + /// Tunnel address (IPv6) reachable for RemoteXPC/RSD. + /// + /// Tunnel address (IPv6) reachable for RemoteXPC/RSD. + [DataMember(Name = "Address", IsRequired = true, EmitDefaultValue = true)] + public string Address { get; set; } + + /// + /// RemoteServiceDiscovery port on the tunnel. + /// + /// RemoteServiceDiscovery port on the tunnel. + [DataMember(Name = "RsdPort", IsRequired = true, EmitDefaultValue = true)] + public int RsdPort { get; set; } + + /// + /// Whether this tunnel is a userspace TUN. + /// + /// Whether this tunnel is a userspace TUN. + [DataMember(Name = "UserspaceTUN", EmitDefaultValue = true)] + public bool UserspaceTUN { get; set; } + + /// + /// Userspace TUN port, when `UserspaceTUN` is true. + /// + /// Userspace TUN port, when `UserspaceTUN` is true. + [DataMember(Name = "UserspaceTUNPort", EmitDefaultValue = false)] + public int UserspaceTUNPort { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Tunnel {\n"); + sb.Append(" Udid: ").Append(Udid).Append("\n"); + sb.Append(" Address: ").Append(Address).Append("\n"); + sb.Append(" RsdPort: ").Append(RsdPort).Append("\n"); + sb.Append(" UserspaceTUN: ").Append(UserspaceTUN).Append("\n"); + sb.Append(" UserspaceTUNPort: ").Append(UserspaceTUNPort).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/TunnelStopped.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/TunnelStopped.cs new file mode 100644 index 000000000..cabc50e7b --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/TunnelStopped.cs @@ -0,0 +1,98 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `DELETE /tunnels/{udid}` — acknowledgement that the tunnel was stopped. + /// + [DataContract(Name = "TunnelStopped")] + public partial class TunnelStopped + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected TunnelStopped() { } + /// + /// Initializes a new instance of the class. + /// + /// udid (required). + /// Always `stopped`. (required). + public TunnelStopped(string udid = default, string status = default) + { + // to ensure "udid" is required (not null) + if (udid == null) + { + throw new ArgumentNullException("udid is a required property for TunnelStopped and cannot be null"); + } + this.Udid = udid; + // to ensure "status" is required (not null) + if (status == null) + { + throw new ArgumentNullException("status is a required property for TunnelStopped and cannot be null"); + } + this.Status = status; + } + + /// + /// Gets or Sets Udid + /// + [DataMember(Name = "udid", IsRequired = true, EmitDefaultValue = true)] + public string Udid { get; set; } + + /// + /// Always `stopped`. + /// + /// Always `stopped`. + [DataMember(Name = "status", IsRequired = true, EmitDefaultValue = true)] + public string Status { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TunnelStopped {\n"); + sb.Append(" Udid: ").Append(Udid).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/UIAPIRequest.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/UIAPIRequest.cs new file mode 100644 index 000000000..dfc81a5a4 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/UIAPIRequest.cs @@ -0,0 +1,113 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `POST /device/{udid}/ui/api` request — raw passthrough to the backend (`uidriver.APIRequest`). For WDA supply `method`/`path`/`body`; for DeviceKit supply `rpcMethod`/`rpcParams`. + /// + [DataContract(Name = "UIAPIRequest")] + public partial class UIAPIRequest + { + /// + /// Initializes a new instance of the class. + /// + /// HTTP method for a WDA passthrough (defaults to GET).. + /// HTTP path for a WDA passthrough (required for the wda backend).. + /// Raw HTTP request body for a WDA passthrough (base64 bytes on the wire).. + /// JSON-RPC method name for a DeviceKit passthrough.. + /// rpcParams. + public UIAPIRequest(string method = default, string path = default, string body = default, string rpcMethod = default, Object rpcParams = default) + { + this.Method = method; + this.Path = path; + this.Body = body; + this.RpcMethod = rpcMethod; + this.RpcParams = rpcParams; + } + + /// + /// HTTP method for a WDA passthrough (defaults to GET). + /// + /// HTTP method for a WDA passthrough (defaults to GET). + [DataMember(Name = "method", EmitDefaultValue = false)] + public string Method { get; set; } + + /// + /// HTTP path for a WDA passthrough (required for the wda backend). + /// + /// HTTP path for a WDA passthrough (required for the wda backend). + [DataMember(Name = "path", EmitDefaultValue = false)] + public string Path { get; set; } + + /// + /// Raw HTTP request body for a WDA passthrough (base64 bytes on the wire). + /// + /// Raw HTTP request body for a WDA passthrough (base64 bytes on the wire). + [DataMember(Name = "body", EmitDefaultValue = false)] + public string Body { get; set; } + + /// + /// JSON-RPC method name for a DeviceKit passthrough. + /// + /// JSON-RPC method name for a DeviceKit passthrough. + [DataMember(Name = "rpcMethod", EmitDefaultValue = false)] + public string RpcMethod { get; set; } + + /// + /// Gets or Sets RpcParams + /// + [DataMember(Name = "rpcParams", EmitDefaultValue = true)] + public Object RpcParams { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class UIAPIRequest {\n"); + sb.Append(" Method: ").Append(Method).Append("\n"); + sb.Append(" Path: ").Append(Path).Append("\n"); + sb.Append(" Body: ").Append(Body).Append("\n"); + sb.Append(" RpcMethod: ").Append(RpcMethod).Append("\n"); + sb.Append(" RpcParams: ").Append(RpcParams).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/UIAppRequest.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/UIAppRequest.cs new file mode 100644 index 000000000..4936c0ef1 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/UIAppRequest.cs @@ -0,0 +1,83 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `POST /device/{udid}/ui/app/{launch,terminate}` request. + /// + [DataContract(Name = "UIAppRequest")] + public partial class UIAppRequest + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected UIAppRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// bundleId (required). + public UIAppRequest(string bundleId = default) + { + // to ensure "bundleId" is required (not null) + if (bundleId == null) + { + throw new ArgumentNullException("bundleId is a required property for UIAppRequest and cannot be null"); + } + this.BundleId = bundleId; + } + + /// + /// Gets or Sets BundleId + /// + [DataMember(Name = "bundleId", IsRequired = true, EmitDefaultValue = true)] + public string BundleId { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class UIAppRequest {\n"); + sb.Append(" BundleId: ").Append(BundleId).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/UIButtonRequest.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/UIButtonRequest.cs new file mode 100644 index 000000000..28d37a7fe --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/UIButtonRequest.cs @@ -0,0 +1,84 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `POST /device/{udid}/ui/button` request — hardware button by name. + /// + [DataContract(Name = "UIButtonRequest")] + public partial class UIButtonRequest + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected UIButtonRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// Button name (e.g. `home`, `volumeup`). WDA supports only `home`. (required). + public UIButtonRequest(string name = default) + { + // to ensure "name" is required (not null) + if (name == null) + { + throw new ArgumentNullException("name is a required property for UIButtonRequest and cannot be null"); + } + this.Name = name; + } + + /// + /// Button name (e.g. `home`, `volumeup`). WDA supports only `home`. + /// + /// Button name (e.g. `home`, `volumeup`). WDA supports only `home`. + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class UIButtonRequest {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/UILongPressRequest.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/UILongPressRequest.cs new file mode 100644 index 000000000..66e5d55b9 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/UILongPressRequest.cs @@ -0,0 +1,97 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `POST /device/{udid}/ui/longpress` request — press and hold at (x,y). + /// + [DataContract(Name = "UILongPressRequest")] + public partial class UILongPressRequest + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected UILongPressRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// x (required). + /// y (required). + /// Hold duration in seconds.. + public UILongPressRequest(int x = default, int y = default, double duration = default) + { + this.X = x; + this.Y = y; + this.Duration = duration; + } + + /// + /// Gets or Sets X + /// + [DataMember(Name = "x", IsRequired = true, EmitDefaultValue = true)] + public int X { get; set; } + + /// + /// Gets or Sets Y + /// + [DataMember(Name = "y", IsRequired = true, EmitDefaultValue = true)] + public int Y { get; set; } + + /// + /// Hold duration in seconds. + /// + /// Hold duration in seconds. + [DataMember(Name = "duration", EmitDefaultValue = false)] + public double Duration { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class UILongPressRequest {\n"); + sb.Append(" X: ").Append(X).Append("\n"); + sb.Append(" Y: ").Append(Y).Append("\n"); + sb.Append(" Duration: ").Append(Duration).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/UIOrientationRequest.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/UIOrientationRequest.cs new file mode 100644 index 000000000..deddb400d --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/UIOrientationRequest.cs @@ -0,0 +1,84 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `PUT /device/{udid}/ui/orientation` request. + /// + [DataContract(Name = "UIOrientationRequest")] + public partial class UIOrientationRequest + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected UIOrientationRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// Target orientation (e.g. `PORTRAIT`, `LANDSCAPE`). (required). + public UIOrientationRequest(string orientation = default) + { + // to ensure "orientation" is required (not null) + if (orientation == null) + { + throw new ArgumentNullException("orientation is a required property for UIOrientationRequest and cannot be null"); + } + this.Orientation = orientation; + } + + /// + /// Target orientation (e.g. `PORTRAIT`, `LANDSCAPE`). + /// + /// Target orientation (e.g. `PORTRAIT`, `LANDSCAPE`). + [DataMember(Name = "orientation", IsRequired = true, EmitDefaultValue = true)] + public string Orientation { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class UIOrientationRequest {\n"); + sb.Append(" Orientation: ").Append(Orientation).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/UISwipeRequest.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/UISwipeRequest.cs new file mode 100644 index 000000000..6d6691e04 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/UISwipeRequest.cs @@ -0,0 +1,115 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `POST /device/{udid}/ui/swipe` request — drag from (x1,y1) to (x2,y2). + /// + [DataContract(Name = "UISwipeRequest")] + public partial class UISwipeRequest + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected UISwipeRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// x1 (required). + /// y1 (required). + /// x2 (required). + /// y2 (required). + /// Gesture duration in seconds.. + public UISwipeRequest(int x1 = default, int y1 = default, int x2 = default, int y2 = default, double duration = default) + { + this.X1 = x1; + this.Y1 = y1; + this.X2 = x2; + this.Y2 = y2; + this.Duration = duration; + } + + /// + /// Gets or Sets X1 + /// + [DataMember(Name = "x1", IsRequired = true, EmitDefaultValue = true)] + public int X1 { get; set; } + + /// + /// Gets or Sets Y1 + /// + [DataMember(Name = "y1", IsRequired = true, EmitDefaultValue = true)] + public int Y1 { get; set; } + + /// + /// Gets or Sets X2 + /// + [DataMember(Name = "x2", IsRequired = true, EmitDefaultValue = true)] + public int X2 { get; set; } + + /// + /// Gets or Sets Y2 + /// + [DataMember(Name = "y2", IsRequired = true, EmitDefaultValue = true)] + public int Y2 { get; set; } + + /// + /// Gesture duration in seconds. + /// + /// Gesture duration in seconds. + [DataMember(Name = "duration", EmitDefaultValue = false)] + public double Duration { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class UISwipeRequest {\n"); + sb.Append(" X1: ").Append(X1).Append("\n"); + sb.Append(" Y1: ").Append(Y1).Append("\n"); + sb.Append(" X2: ").Append(X2).Append("\n"); + sb.Append(" Y2: ").Append(Y2).Append("\n"); + sb.Append(" Duration: ").Append(Duration).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/UITapRequest.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/UITapRequest.cs new file mode 100644 index 000000000..0b7d227cf --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/UITapRequest.cs @@ -0,0 +1,87 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `POST /device/{udid}/ui/tap` request — absolute coordinates. + /// + [DataContract(Name = "UITapRequest")] + public partial class UITapRequest + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected UITapRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// x (required). + /// y (required). + public UITapRequest(int x = default, int y = default) + { + this.X = x; + this.Y = y; + } + + /// + /// Gets or Sets X + /// + [DataMember(Name = "x", IsRequired = true, EmitDefaultValue = true)] + public int X { get; set; } + + /// + /// Gets or Sets Y + /// + [DataMember(Name = "y", IsRequired = true, EmitDefaultValue = true)] + public int Y { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class UITapRequest {\n"); + sb.Append(" X: ").Append(X).Append("\n"); + sb.Append(" Y: ").Append(Y).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/UITypeRequest.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/UITypeRequest.cs new file mode 100644 index 000000000..8aecfaa32 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/UITypeRequest.cs @@ -0,0 +1,83 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `POST /device/{udid}/ui/type` request — keyboard input. + /// + [DataContract(Name = "UITypeRequest")] + public partial class UITypeRequest + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected UITypeRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// text (required). + public UITypeRequest(string text = default) + { + // to ensure "text" is required (not null) + if (text == null) + { + throw new ArgumentNullException("text is a required property for UITypeRequest and cannot be null"); + } + this.Text = text; + } + + /// + /// Gets or Sets Text + /// + [DataMember(Name = "text", IsRequired = true, EmitDefaultValue = true)] + public string Text { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class UITypeRequest {\n"); + sb.Append(" Text: ").Append(Text).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/UnlockToken.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/UnlockToken.cs new file mode 100644 index 000000000..8ff8c6ae6 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/UnlockToken.cs @@ -0,0 +1,84 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `POST /device/{udid}/mdm/fetch-unlock-token` — base64 escrow unlock token. + /// + [DataContract(Name = "UnlockToken")] + public partial class UnlockToken + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected UnlockToken() { } + /// + /// Initializes a new instance of the class. + /// + /// Base64-encoded escrow unlock token. (required). + public UnlockToken(string token = default) + { + // to ensure "token" is required (not null) + if (token == null) + { + throw new ArgumentNullException("token is a required property for UnlockToken and cannot be null"); + } + this.Token = token; + } + + /// + /// Base64-encoded escrow unlock token. + /// + /// Base64-encoded escrow unlock token. + [DataMember(Name = "token", IsRequired = true, EmitDefaultValue = true)] + public string Token { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class UnlockToken {\n"); + sb.Append(" Token: ").Append(Token).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/VoiceOverState.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/VoiceOverState.cs new file mode 100644 index 000000000..692c54020 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/VoiceOverState.cs @@ -0,0 +1,78 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `GET|PUT /device/{udid}/voiceover` — VoiceOver enabled state. + /// + [DataContract(Name = "VoiceOverState")] + public partial class VoiceOverState + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected VoiceOverState() { } + /// + /// Initializes a new instance of the class. + /// + /// voiceOverEnabled (required). + public VoiceOverState(bool voiceOverEnabled = default) + { + this.VoiceOverEnabled = voiceOverEnabled; + } + + /// + /// Gets or Sets VoiceOverEnabled + /// + [DataMember(Name = "VoiceOverEnabled", IsRequired = true, EmitDefaultValue = true)] + public bool VoiceOverEnabled { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class VoiceOverState {\n"); + sb.Append(" VoiceOverEnabled: ").Append(VoiceOverEnabled).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/WdaConfig.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/WdaConfig.cs new file mode 100644 index 000000000..fe205559a --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/WdaConfig.cs @@ -0,0 +1,134 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// Configuration for launching a WebDriverAgent (XCUITest) runner session. + /// + [DataContract(Name = "WdaConfig")] + public partial class WdaConfig + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected WdaConfig() { } + /// + /// Initializes a new instance of the class. + /// + /// Bundle id of the WDA runner host app (e.g. `com.facebook.WebDriverAgentRunner.xctrunner`). (required). + /// Bundle id of the XCTest test bundle. (required). + /// Path/name of the `.xctestconfiguration` to use. (required). + /// Extra process arguments passed to the runner.. + /// Extra environment variables passed to the runner.. + public WdaConfig(string bundleId = default, string testBundleId = default, string xcTestConfig = default, List args = default, Object env = default) + { + // to ensure "bundleId" is required (not null) + if (bundleId == null) + { + throw new ArgumentNullException("bundleId is a required property for WdaConfig and cannot be null"); + } + this.BundleId = bundleId; + // to ensure "testBundleId" is required (not null) + if (testBundleId == null) + { + throw new ArgumentNullException("testBundleId is a required property for WdaConfig and cannot be null"); + } + this.TestBundleId = testBundleId; + // to ensure "xcTestConfig" is required (not null) + if (xcTestConfig == null) + { + throw new ArgumentNullException("xcTestConfig is a required property for WdaConfig and cannot be null"); + } + this.XcTestConfig = xcTestConfig; + this.Args = args; + this.Env = env; + } + + /// + /// Bundle id of the WDA runner host app (e.g. `com.facebook.WebDriverAgentRunner.xctrunner`). + /// + /// Bundle id of the WDA runner host app (e.g. `com.facebook.WebDriverAgentRunner.xctrunner`). + [DataMember(Name = "bundleId", IsRequired = true, EmitDefaultValue = true)] + public string BundleId { get; set; } + + /// + /// Bundle id of the XCTest test bundle. + /// + /// Bundle id of the XCTest test bundle. + [DataMember(Name = "testBundleId", IsRequired = true, EmitDefaultValue = true)] + public string TestBundleId { get; set; } + + /// + /// Path/name of the `.xctestconfiguration` to use. + /// + /// Path/name of the `.xctestconfiguration` to use. + [DataMember(Name = "xcTestConfig", IsRequired = true, EmitDefaultValue = true)] + public string XcTestConfig { get; set; } + + /// + /// Extra process arguments passed to the runner. + /// + /// Extra process arguments passed to the runner. + [DataMember(Name = "args", EmitDefaultValue = false)] + public List Args { get; set; } + + /// + /// Extra environment variables passed to the runner. + /// + /// Extra environment variables passed to the runner. + [DataMember(Name = "env", EmitDefaultValue = false)] + public Object Env { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class WdaConfig {\n"); + sb.Append(" BundleId: ").Append(BundleId).Append("\n"); + sb.Append(" TestBundleId: ").Append(TestBundleId).Append("\n"); + sb.Append(" XcTestConfig: ").Append(XcTestConfig).Append("\n"); + sb.Append(" Args: ").Append(Args).Append("\n"); + sb.Append(" Env: ").Append(Env).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/WdaSession.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/WdaSession.cs new file mode 100644 index 000000000..4e809bfcf --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/WdaSession.cs @@ -0,0 +1,114 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// A running WebDriverAgent session. + /// + [DataContract(Name = "WdaSession")] + public partial class WdaSession + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected WdaSession() { } + /// + /// Initializes a new instance of the class. + /// + /// The configuration the session was started with. (required). + /// Opaque session identifier. (required). + /// The device udid the session runs on. (required). + public WdaSession(WdaConfig config = default, string sessionId = default, string udid = default) + { + // to ensure "config" is required (not null) + if (config == null) + { + throw new ArgumentNullException("config is a required property for WdaSession and cannot be null"); + } + this.Config = config; + // to ensure "sessionId" is required (not null) + if (sessionId == null) + { + throw new ArgumentNullException("sessionId is a required property for WdaSession and cannot be null"); + } + this.SessionId = sessionId; + // to ensure "udid" is required (not null) + if (udid == null) + { + throw new ArgumentNullException("udid is a required property for WdaSession and cannot be null"); + } + this.Udid = udid; + } + + /// + /// The configuration the session was started with. + /// + /// The configuration the session was started with. + [DataMember(Name = "config", IsRequired = true, EmitDefaultValue = true)] + public WdaConfig Config { get; set; } + + /// + /// Opaque session identifier. + /// + /// Opaque session identifier. + [DataMember(Name = "sessionId", IsRequired = true, EmitDefaultValue = true)] + public string SessionId { get; set; } + + /// + /// The device udid the session runs on. + /// + /// The device udid the session runs on. + [DataMember(Name = "udid", IsRequired = true, EmitDefaultValue = true)] + public string Udid { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class WdaSession {\n"); + sb.Append(" Config: ").Append(Config).Append("\n"); + sb.Append(" SessionId: ").Append(SessionId).Append("\n"); + sb.Append(" Udid: ").Append(Udid).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/WebInspectorEvalRequest.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/WebInspectorEvalRequest.cs new file mode 100644 index 000000000..d1fad8d31 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/WebInspectorEvalRequest.cs @@ -0,0 +1,104 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `POST /device/{udid}/webinspector/eval` request body. + /// + [DataContract(Name = "WebInspectorEvalRequest")] + public partial class WebInspectorEvalRequest + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected WebInspectorEvalRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// Inspectable page key. When empty the first matching web/javascript page (optionally scoped by `bundleId`) is used.. + /// Optional bundle id to scope page selection.. + /// JavaScript source to evaluate. Required. (required). + public WebInspectorEvalRequest(string page = default, string bundleId = default, string script = default) + { + // to ensure "script" is required (not null) + if (script == null) + { + throw new ArgumentNullException("script is a required property for WebInspectorEvalRequest and cannot be null"); + } + this.Script = script; + this.Page = page; + this.BundleId = bundleId; + } + + /// + /// Inspectable page key. When empty the first matching web/javascript page (optionally scoped by `bundleId`) is used. + /// + /// Inspectable page key. When empty the first matching web/javascript page (optionally scoped by `bundleId`) is used. + [DataMember(Name = "page", EmitDefaultValue = false)] + public string Page { get; set; } + + /// + /// Optional bundle id to scope page selection. + /// + /// Optional bundle id to scope page selection. + [DataMember(Name = "bundleId", EmitDefaultValue = false)] + public string BundleId { get; set; } + + /// + /// JavaScript source to evaluate. Required. + /// + /// JavaScript source to evaluate. Required. + [DataMember(Name = "script", IsRequired = true, EmitDefaultValue = true)] + public string Script { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class WebInspectorEvalRequest {\n"); + sb.Append(" Page: ").Append(Page).Append("\n"); + sb.Append(" BundleId: ").Append(BundleId).Append("\n"); + sb.Append(" Script: ").Append(Script).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/WebInspectorEvalResult.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/WebInspectorEvalResult.cs new file mode 100644 index 000000000..55473b031 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/WebInspectorEvalResult.cs @@ -0,0 +1,98 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `POST /device/{udid}/webinspector/eval` — evaluation result. + /// + [DataContract(Name = "WebInspectorEvalResult")] + public partial class WebInspectorEvalResult + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected WebInspectorEvalResult() { } + /// + /// Initializes a new instance of the class. + /// + /// The page key the script ran in. (required). + /// result (required). + public WebInspectorEvalResult(string page = default, Object result = default) + { + // to ensure "page" is required (not null) + if (page == null) + { + throw new ArgumentNullException("page is a required property for WebInspectorEvalResult and cannot be null"); + } + this.Page = page; + // to ensure "result" is required (not null) + if (result == null) + { + throw new ArgumentNullException("result is a required property for WebInspectorEvalResult and cannot be null"); + } + this.Result = result; + } + + /// + /// The page key the script ran in. + /// + /// The page key the script ran in. + [DataMember(Name = "page", IsRequired = true, EmitDefaultValue = true)] + public string Page { get; set; } + + /// + /// Gets or Sets Result + /// + [DataMember(Name = "result", IsRequired = true, EmitDefaultValue = true)] + public Object Result { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class WebInspectorEvalResult {\n"); + sb.Append(" Page: ").Append(Page).Append("\n"); + sb.Append(" Result: ").Append(Result).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/WebInspectorLaunchRequest.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/WebInspectorLaunchRequest.cs new file mode 100644 index 000000000..dc7482d02 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/WebInspectorLaunchRequest.cs @@ -0,0 +1,84 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `POST /device/{udid}/webinspector/launch` request body. + /// + [DataContract(Name = "WebInspectorLaunchRequest")] + public partial class WebInspectorLaunchRequest + { + /// + /// Initializes a new instance of the class. + /// + /// URL to open. May alternatively be supplied as the `url` query param.. + /// Bundle id to open the URL in. Defaults to Safari.. + public WebInspectorLaunchRequest(string url = default, string bundleId = default) + { + this.Url = url; + this.BundleId = bundleId; + } + + /// + /// URL to open. May alternatively be supplied as the `url` query param. + /// + /// URL to open. May alternatively be supplied as the `url` query param. + [DataMember(Name = "url", EmitDefaultValue = false)] + public string Url { get; set; } + + /// + /// Bundle id to open the URL in. Defaults to Safari. + /// + /// Bundle id to open the URL in. Defaults to Safari. + [DataMember(Name = "bundleId", EmitDefaultValue = false)] + public string BundleId { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class WebInspectorLaunchRequest {\n"); + sb.Append(" Url: ").Append(Url).Append("\n"); + sb.Append(" BundleId: ").Append(BundleId).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/WebInspectorLaunchResult.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/WebInspectorLaunchResult.cs new file mode 100644 index 000000000..0ff02a900 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/WebInspectorLaunchResult.cs @@ -0,0 +1,114 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `POST /device/{udid}/webinspector/launch` — result of opening a URL. + /// + [DataContract(Name = "WebInspectorLaunchResult")] + public partial class WebInspectorLaunchResult + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected WebInspectorLaunchResult() { } + /// + /// Initializes a new instance of the class. + /// + /// Bundle id the page was opened in. (required). + /// The resolved current URL after navigation. (required). + /// The page title after navigation. (required). + public WebInspectorLaunchResult(string bundleId = default, string url = default, string title = default) + { + // to ensure "bundleId" is required (not null) + if (bundleId == null) + { + throw new ArgumentNullException("bundleId is a required property for WebInspectorLaunchResult and cannot be null"); + } + this.BundleId = bundleId; + // to ensure "url" is required (not null) + if (url == null) + { + throw new ArgumentNullException("url is a required property for WebInspectorLaunchResult and cannot be null"); + } + this.Url = url; + // to ensure "title" is required (not null) + if (title == null) + { + throw new ArgumentNullException("title is a required property for WebInspectorLaunchResult and cannot be null"); + } + this.Title = title; + } + + /// + /// Bundle id the page was opened in. + /// + /// Bundle id the page was opened in. + [DataMember(Name = "bundleId", IsRequired = true, EmitDefaultValue = true)] + public string BundleId { get; set; } + + /// + /// The resolved current URL after navigation. + /// + /// The resolved current URL after navigation. + [DataMember(Name = "url", IsRequired = true, EmitDefaultValue = true)] + public string Url { get; set; } + + /// + /// The page title after navigation. + /// + /// The page title after navigation. + [DataMember(Name = "title", IsRequired = true, EmitDefaultValue = true)] + public string Title { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class WebInspectorLaunchResult {\n"); + sb.Append(" BundleId: ").Append(BundleId).Append("\n"); + sb.Append(" Url: ").Append(Url).Append("\n"); + sb.Append(" Title: ").Append(Title).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/WifiRequest.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/WifiRequest.cs new file mode 100644 index 000000000..8679dab06 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/WifiRequest.cs @@ -0,0 +1,102 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `PUT /device/{udid}/wifi` request. + /// + [DataContract(Name = "WifiRequest")] + public partial class WifiRequest + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected WifiRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// ssid (required). + /// password. + /// Encryption type, e.g. `WPA2`, `WPA`, `WEP`, `None`.. + public WifiRequest(string ssid = default, string password = default, string encType = default) + { + // to ensure "ssid" is required (not null) + if (ssid == null) + { + throw new ArgumentNullException("ssid is a required property for WifiRequest and cannot be null"); + } + this.Ssid = ssid; + this.Password = password; + this.EncType = encType; + } + + /// + /// Gets or Sets Ssid + /// + [DataMember(Name = "ssid", IsRequired = true, EmitDefaultValue = true)] + public string Ssid { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name = "password", EmitDefaultValue = false)] + public string Password { get; set; } + + /// + /// Encryption type, e.g. `WPA2`, `WPA`, `WEP`, `None`. + /// + /// Encryption type, e.g. `WPA2`, `WPA`, `WEP`, `None`. + [DataMember(Name = "encType", EmitDefaultValue = false)] + public string EncType { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class WifiRequest {\n"); + sb.Append(" Ssid: ").Append(Ssid).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" EncType: ").Append(EncType).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/ZoomTouchState.cs b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/ZoomTouchState.cs new file mode 100644 index 000000000..f1d2d1174 --- /dev/null +++ b/sdks/packages/csharp/src/Generated/src/GoIos.Sdk.Generated/Model/ZoomTouchState.cs @@ -0,0 +1,78 @@ +/* + * go-ios REST API + * + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `- -disable-auth`. When the server is started with `- -disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = GoIos.Sdk.Generated.Client.FileParameter; +using OpenAPIDateConverter = GoIos.Sdk.Generated.Client.OpenAPIDateConverter; + +namespace GoIos.Sdk.Generated.Model +{ + /// + /// `GET|PUT /device/{udid}/zoom` — ZoomTouch enabled state. + /// + [DataContract(Name = "ZoomTouchState")] + public partial class ZoomTouchState + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ZoomTouchState() { } + /// + /// Initializes a new instance of the class. + /// + /// zoomTouchEnabled (required). + public ZoomTouchState(bool zoomTouchEnabled = default) + { + this.ZoomTouchEnabled = zoomTouchEnabled; + } + + /// + /// Gets or Sets ZoomTouchEnabled + /// + [DataMember(Name = "ZoomTouchEnabled", IsRequired = true, EmitDefaultValue = true)] + public bool ZoomTouchEnabled { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ZoomTouchState {\n"); + sb.Append(" ZoomTouchEnabled: ").Append(ZoomTouchEnabled).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/sdks/packages/csharp/src/GoIos.Sdk/AppsClient.cs b/sdks/packages/csharp/src/GoIos.Sdk/AppsClient.cs new file mode 100644 index 000000000..d1e984b6d --- /dev/null +++ b/sdks/packages/csharp/src/GoIos.Sdk/AppsClient.cs @@ -0,0 +1,61 @@ +using System.Net.Http; +using System.Net.Http.Headers; +using GoIos.Sdk; +using Gen = GoIos.Sdk.Generated.Api; +using GenModel = GoIos.Sdk.Generated.Model; + +namespace GoIos; + +/// App lifecycle operations for a single device. +public sealed class AppsClient +{ + private readonly string _udid; + private readonly Gen.DefaultApi _api; + private readonly RawHttp _raw; + + internal AppsClient(string udid, Gen.DefaultApi api, RawHttp raw) + { + _udid = udid; + _api = api; + _raw = raw; + } + + /// List installed applications. Each entry is an open Info.plist map. + public Task> ListAsync(CancellationToken cancellationToken = default) + => _api.DevicesListAppsAsync(_udid, cancellationToken); + + /// Launch an application by bundle id. + public Task LaunchAsync(string bundleId, CancellationToken cancellationToken = default) + => _api.DevicesLaunchAppAsync(_udid, bundleId, cancellationToken); + + /// Kill a running application by bundle id. + public Task KillAsync(string bundleId, CancellationToken cancellationToken = default) + => _api.DevicesKillAppAsync(_udid, bundleId, cancellationToken); + + /// Uninstall an application by bundle id. + public Task UninstallAsync(string bundleId, CancellationToken cancellationToken = default) + => _api.DevicesUninstallAppAsync(_udid, bundleId, cancellationToken); + + /// Install an application from a local .ipa/.app archive path. + public async Task InstallAsync(string filePath, CancellationToken cancellationToken = default) + { + var bytes = await File.ReadAllBytesAsync(filePath, cancellationToken).ConfigureAwait(false); + return await InstallAsync(bytes, Path.GetFileName(filePath), cancellationToken).ConfigureAwait(false); + } + + /// + /// Install an application from in-memory archive bytes. Uploaded as multipart + /// file per the spec (the part must be 1 byte–200 MB). + /// + public Task InstallAsync( + byte[] archive, string fileName = "app.ipa", CancellationToken cancellationToken = default) + { + var req = _raw.NewRequest(HttpMethod.Post, $"api/v1/device/{Uri.EscapeDataString(_udid)}/apps/install"); + var form = new MultipartFormDataContent(); + var part = new ByteArrayContent(archive); + part.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream"); + form.Add(part, "file", fileName); + req.Content = form; + return _raw.SendJsonAsync(req, cancellationToken); + } +} diff --git a/sdks/packages/csharp/src/GoIos.Sdk/DeviceClient.cs b/sdks/packages/csharp/src/GoIos.Sdk/DeviceClient.cs new file mode 100644 index 000000000..2bd40427a --- /dev/null +++ b/sdks/packages/csharp/src/GoIos.Sdk/DeviceClient.cs @@ -0,0 +1,560 @@ +using System.Net.Http; +using System.Net.Http.Headers; +using System.Runtime.CompilerServices; +using System.Text.Json; +using GoIos.Sdk; +using Gen = GoIos.Sdk.Generated.Api; +using GenModel = GoIos.Sdk.Generated.Model; + +namespace GoIos; + +/// +/// Device-scoped operations. Obtained via . +/// +public sealed class DeviceClient +{ + private readonly string _udid; + private readonly Gen.DefaultApi _api; + private readonly RawHttp _raw; + + /// The device udid this handle is scoped to (its properties.serialNumber). + public string Udid => _udid; + + /// App lifecycle operations for this device. + public AppsClient Apps { get; } + + /// WebDriverAgent (XCUITest) session operations for this device. + public WdaClient Wda { get; } + + /// AFC file-system operations for this device. + public FilesClient Files { get; } + + /// Crash-report operations for this device. + public CrashesClient Crashes { get; } + + /// Wallpaper / icon-layout / pasteboard operations for this device. + public MediaClient Media { get; } + + /// Settings toggles (AssistiveTouch / time format / Wi-Fi) for this device. + public SettingsClient Settings { get; } + + /// MDM (supervised) operations for this device. + public MdmClient Mdm { get; } + + /// Global HTTP-proxy configuration for this device. + public ProxyClient Proxy { get; } + + /// Background-job operations (runtest / runwda / forward) for this device. + public JobsClient Jobs { get; } + + /// AFC file-sync operations (ios fsync) for this device. + public FsyncClient Fsync { get; } + + /// WebInspector (remote web debugging) operations for this device. + public WebInspectorClient WebInspector { get; } + + /// UI automation (WDA / DeviceKit) operations for this device. + public UiClient Ui { get; } + + internal DeviceClient(string udid, Gen.DefaultApi api, RawHttp raw) + { + _udid = udid; + _api = api; + _raw = raw; + Apps = new AppsClient(udid, api, raw); + Wda = new WdaClient(udid, api); + Files = new FilesClient(udid, api, raw); + Crashes = new CrashesClient(udid, api); + Media = new MediaClient(udid, api, raw); + Settings = new SettingsClient(udid, api); + Mdm = new MdmClient(udid, raw); + Proxy = new ProxyClient(udid, api, raw); + Jobs = new JobsClient(udid, api, raw); + Fsync = new FsyncClient(udid, api, raw); + WebInspector = new WebInspectorClient(udid, api); + Ui = new UiClient(udid, api, raw); + } + + // --- Info / lifecycle -------------------------------------------------- + + /// Get lockdown values plus instruments:* keys for the device. + public async Task> InfoAsync(CancellationToken cancellationToken = default) + { + var raw = await _api.DevicesGetInfoAsync(_udid, cancellationToken).ConfigureAwait(false); + return ToDictionary(raw); + } + + /// Activate the device. + public Task ActivateAsync(CancellationToken cancellationToken = default) + => _api.DevicesActivateAsync(_udid, cancellationToken); + + /// Capture a screenshot and return the raw PNG bytes. + public Task ScreenshotAsync(CancellationToken cancellationToken = default) + => _raw.GetBytesAsync($"api/v1/device/{Esc(_udid)}/screenshot", "image/png", cancellationToken); + + // --- Pairing ----------------------------------------------------------- + + /// + /// Pair the device. For supervised pairing supply the supervision identity + /// () and passphrase (). + /// + public Task PairAsync( + bool supervised = false, + byte[]? p12File = null, + string? supervisionPassword = null, + CancellationToken cancellationToken = default) + { + var url = $"api/v1/device/{Esc(_udid)}/pair?supervised={(supervised ? "true" : "false")}"; + var req = _raw.NewRequest(HttpMethod.Post, url); + if (!string.IsNullOrEmpty(supervisionPassword)) + req.Headers.TryAddWithoutValidation("Supervision-Password", supervisionPassword); + + if (p12File is not null) + { + var form = new MultipartFormDataContent(); + var part = new ByteArrayContent(p12File); + part.Headers.ContentType = new MediaTypeHeaderValue("application/x-pkcs12"); + form.Add(part, "p12file", "supervision.p12"); + req.Content = form; + } + + return _raw.SendJsonAsync(req, cancellationToken); + } + + // --- Conditions -------------------------------------------------------- + + /// List available condition inducer profile types. + public Task> ConditionsAsync(CancellationToken cancellationToken = default) + => _api.DevicesListConditionsAsync(_udid, cancellationToken); + + /// Enable a condition inducer profile. + public Task EnableConditionAsync( + string profileTypeId, string profileId, CancellationToken cancellationToken = default) + => _api.DevicesEnableConditionAsync(_udid, profileTypeId, profileId, cancellationToken); + + /// Disable the active condition inducer profile. + public Task DisableConditionAsync(CancellationToken cancellationToken = default) + => _api.DevicesDisableConditionAsync(_udid, cancellationToken); + + // --- Developer disk images -------------------------------------------- + + /// List the developer disk images mounted on / known to the device. + public Task> ImagesAsync(CancellationToken cancellationToken = default) + => _api.DevicesListImagesAsync(_udid, cancellationToken); + + /// + /// Mount a Developer Disk Image. Either let the server auto-resolve and + /// download the correct image ( = true, optionally with + /// ), or stream the raw image bytes + /// (). + /// + public Task InstallImageAsync( + bool auto = false, + string? baseDir = null, + byte[]? imageBytes = null, + CancellationToken cancellationToken = default) + { + var query = new List(); + if (auto) query.Add("auto=true"); + if (!string.IsNullOrEmpty(baseDir)) query.Add("basedir=" + Uri.EscapeDataString(baseDir)); + var qs = query.Count > 0 ? "?" + string.Join("&", query) : ""; + + var req = _raw.NewRequest(HttpMethod.Put, $"api/v1/device/{Esc(_udid)}/image{qs}"); + if (imageBytes is not null) + { + var body = new ByteArrayContent(imageBytes); + body.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream"); + req.Content = body; + } + return _raw.SendJsonAsync(req, cancellationToken); + } + + // --- Profiles / resets / location ------------------------------------- + + /// List installed configuration profiles. + public async Task> ProfilesAsync(CancellationToken cancellationToken = default) + { + var raw = await _api.DevicesGetProfilesAsync(_udid, cancellationToken).ConfigureAwait(false); + return ToDictionary(raw); + } + + /// Reset accessibility settings on the device. + public Task ResetAccessibilityAsync(CancellationToken cancellationToken = default) + => _api.DevicesResetAccessibilityAsync(_udid, cancellationToken); + + /// Reset the simulated location back to the device's real GPS. + public Task ResetLocationAsync(CancellationToken cancellationToken = default) + => _api.DevicesResetLocationAsync(_udid, cancellationToken); + + /// Set a simulated GPS location. + public Task SetLocationAsync( + double latitude, double longitude, CancellationToken cancellationToken = default) + => _api.DevicesSetLocationAsync( + _udid, + latitude.ToString(System.Globalization.CultureInfo.InvariantCulture), + longitude.ToString(System.Globalization.CultureInfo.InvariantCulture), + cancellationToken); + + // --- Device information ------------------------------------------------ + + /// Get the device name (GET /devicename). + public Task DeviceNameAsync(CancellationToken cancellationToken = default) + => _api.DevicesGetDeviceNameAsync(_udid, cancellationToken); + + /// Get the device's current date/time (GET /date). + public Task DateAsync(CancellationToken cancellationToken = default) + => _api.DevicesGetDeviceDateAsync(_udid, cancellationToken); + + /// Get battery status (GET /battery). + public Task BatteryAsync(CancellationToken cancellationToken = default) + => _api.DevicesGetBatteryAsync(_udid, cancellationToken); + + /// Get IORegistry diagnostics (GET /diagnostics). + public async Task> DiagnosticsAsync(CancellationToken cancellationToken = default) + => JsonHelpers.ToDictionary(await _api.DevicesGetDiagnosticsAsync(_udid, cancellationToken).ConfigureAwait(false)); + + /// Query one or more MobileGestalt keys (GET /mobilegestalt). + public async Task> MobileGestaltAsync( + IEnumerable keys, CancellationToken cancellationToken = default) + { + var list = keys as List ?? new List(keys); + return JsonHelpers.ToDictionary(await _api.DevicesGetMobileGestaltAsync(_udid, list, cancellationToken).ConfigureAwait(false)); + } + + /// List running processes (GET /processes). Set to include app metadata. + public Task> ProcessesAsync(bool? apps = null, CancellationToken cancellationToken = default) + => _api.DevicesGetProcessesAsync(_udid, apps, cancellationToken); + + /// + /// Get lockdown values (GET /lockdown). Pass to + /// read a specific lockdown domain (e.g. com.apple.mobile.battery); + /// omit it for the default domain. + /// + public async Task> LockdownAsync( + string? domain = null, CancellationToken cancellationToken = default) + => JsonHelpers.ToDictionary(await _api.DevicesGetLockdownValuesAsync(_udid, domain, cancellationToken).ConfigureAwait(false)); + + // --- Diagnostics / network -------------------------------------------- + + /// Get the device's data-partition disk usage (GET /diskspace). + public Task DiskSpaceAsync(CancellationToken cancellationToken = default) + => _api.DiagnosticsNetGetDiskSpaceAsync(_udid, cancellationToken); + + /// Get the device's MAC / IPv4 / IPv6 addresses (GET /ip). + public Task IpAsync(CancellationToken cancellationToken = default) + => _api.DiagnosticsNetGetDeviceIpAsync(_udid, cancellationToken); + + /// Get the RemoteServiceDiscovery (RSD) service map for the device (GET /rsd). + public async Task> RsdAsync(CancellationToken cancellationToken = default) + => JsonHelpers.ToDictionary(await _api.DiagnosticsNetGetRsdServicesAsync(_udid, cancellationToken).ConfigureAwait(false)); + + /// Get the detailed IOKit battery registry snapshot (GET /battery/registry). + public Task BatteryRegistryAsync(CancellationToken cancellationToken = default) + => _api.DiagnosticsNetGetBatteryRegistryAsync(_udid, cancellationToken); + + // --- Accessibility ----------------------------------------------------- + + /// Get the VoiceOver enabled state (GET /voiceover). + public Task VoiceOverAsync(CancellationToken cancellationToken = default) + => _api.AccessibilityGetVoiceOverAsync(_udid, cancellationToken); + + /// Enable or disable VoiceOver (PUT /voiceover). + public Task SetVoiceOverAsync(bool enabled, CancellationToken cancellationToken = default) + => _api.AccessibilitySetVoiceOverAsync(_udid, null, new GenModel.AXEnabledRequest(enabled), cancellationToken); + + /// Get the Zoom (accessibility) enabled state (GET /zoom). + public Task ZoomAsync(CancellationToken cancellationToken = default) + => _api.AccessibilityGetZoomTouchAsync(_udid, cancellationToken); + + /// Enable or disable Zoom (PUT /zoom). + public Task SetZoomAsync(bool enabled, CancellationToken cancellationToken = default) + => _api.AccessibilitySetZoomTouchAsync(_udid, null, new GenModel.AXEnabledRequest(enabled), cancellationToken); + + /// Run the accessibility audit against the focused app (POST /ax/audit). Bounded by seconds. + public async Task>> AxAuditAsync( + int? timeout = null, CancellationToken cancellationToken = default) + { + var raw = await _api.AccessibilityRunAxAuditAsync(_udid, timeout, cancellationToken).ConfigureAwait(false); + return (raw ?? new List()).Select(JsonHelpers.ToDictionary).ToList(); + } + + /// Get the current accessibility (AX) element snapshot/hierarchy (GET /ax). + public async Task> AxAsync(CancellationToken cancellationToken = default) + => JsonHelpers.ToDictionary(await _api.AccessibilityGetAxSnapshotAsync(_udid, cancellationToken).ConfigureAwait(false)); + + /// Simulate live location tracking from an uploaded GPX file's bytes (PUT /setlocation/gpx, multipart). + public Task SetLocationGpxAsync(byte[] gpx, CancellationToken cancellationToken = default) + { + var form = new MultipartFormDataContent { { Octet(gpx), "gpx", "route.gpx" } }; + var req = _raw.NewRequest(HttpMethod.Put, $"api/v1/device/{Esc(_udid)}/setlocation/gpx"); + req.Content = form; + return _raw.SendJsonAsync(req, cancellationToken); + } + + /// Read the device's cloud-configuration (supervision) payload (GET /cloudconfig). + public async Task> CloudConfigAsync(CancellationToken cancellationToken = default) + => JsonHelpers.ToDictionary(await _api.FsyncGetCloudConfigAsync(_udid, cancellationToken).ConfigureAwait(false)); + + // --- Preparation ------------------------------------------------------- + + /// + /// Run the device preparation/provisioning flow (POST /prepare, multipart). + /// To supervise the device supply a (DER/PEM/P12 identity) + /// and optional ; lists setup + /// panes to skip (see ). + /// + public Task PrepareAsync( + byte[]? cert = null, string? p12Password = null, IEnumerable? skip = null, + string? orgName = null, string? locale = null, string? lang = null, + CancellationToken cancellationToken = default) + { + var form = new MultipartFormDataContent(); + if (cert is not null) form.Add(Octet(cert), "cert", "supervision.p12"); + if (!string.IsNullOrEmpty(p12Password)) form.Add(new StringContent(p12Password), "p12password"); + if (skip is not null) foreach (var s in skip) form.Add(new StringContent(s), "skip"); + if (!string.IsNullOrEmpty(orgName)) form.Add(new StringContent(orgName), "orgname"); + if (!string.IsNullOrEmpty(locale)) form.Add(new StringContent(locale), "locale"); + if (!string.IsNullOrEmpty(lang)) form.Add(new StringContent(lang), "lang"); + var req = _raw.NewRequest(HttpMethod.Post, $"api/v1/device/{Esc(_udid)}/prepare"); + req.Content = form; + return _raw.SendJsonAsync(req, cancellationToken); + } + + // --- Binary streams (raw bytes, NOT SSE) ------------------------------ + + /// + /// Open an MJPEG (multipart/x-mixed-replace) stream of device screenshots + /// (GET /screenshot/stream). Returns a raw ; + /// dispose it to stop. is the JPEG quality (1–100). + /// + public Task ScreenshotStreamAsync(int? quality = null, CancellationToken cancellationToken = default) + { + var qs = quality.HasValue ? $"?quality={quality.Value}" : ""; + var req = _raw.NewRequest(HttpMethod.Get, $"api/v1/device/{Esc(_udid)}/screenshot/stream{qs}"); + return _raw.OpenBinaryStreamAsync(req, "image/jpeg", cancellationToken); + } + + /// + /// Open a live pcap capture as a libpcap byte stream (GET /pcap). Returns + /// a raw ; dispose it to stop. Runs until + /// seconds elapse or the client disconnects. + /// + public Task PcapAsync(int? timeout = null, CancellationToken cancellationToken = default) + { + var qs = timeout.HasValue ? $"?timeout={timeout.Value}" : ""; + var req = _raw.NewRequest(HttpMethod.Get, $"api/v1/device/{Esc(_udid)}/pcap{qs}"); + return _raw.OpenBinaryStreamAsync(req, "application/vnd.tcpdump.pcap", cancellationToken); + } + + // --- Management -------------------------------------------------------- + + /// Reboot the device (POST /reboot). + public Task RebootAsync(CancellationToken cancellationToken = default) + => _api.DevicesRebootAsync(_udid, cancellationToken); + + /// Shut the device down (POST /shutdown). + public Task ShutdownAsync(CancellationToken cancellationToken = default) + => _api.DevicesShutdownAsync(_udid, cancellationToken); + + /// Erase all content and settings (POST /erase). Destructive — must be true. + public Task EraseAsync(bool confirm, CancellationToken cancellationToken = default) + => _api.DevicesEraseAsync(_udid, confirm, cancellationToken); + + /// Get developer-mode state (GET /devmode). + public Task DevmodeAsync(CancellationToken cancellationToken = default) + => _api.DevicesGetDevModeAsync(_udid, cancellationToken); + + /// + /// Set developer mode (POST /devmode). is + /// enable or reveal; arms it across the next reboot. + /// + public Task SetDevmodeAsync( + string action, bool enablePostRestart = false, CancellationToken cancellationToken = default) + => _api.DevicesSetDevModeAsync(_udid, new GenModel.DevModeRequest(action, enablePostRestart), cancellationToken); + + /// Get the language/locale configuration (GET /lang). + public Task LangAsync(CancellationToken cancellationToken = default) + => _api.DevicesGetLanguageAsync(_udid, cancellationToken); + + /// Set the language and/or locale (PUT /lang). + public Task SetLangAsync( + string? language = null, string? locale = null, CancellationToken cancellationToken = default) + => _api.DevicesSetLanguageAsync( + _udid, + new GenModel.SetLanguageRequest { Language = language!, Locale = locale! }, + cancellationToken); + + /// Waive the memory limit for a process (POST /memlimitoff). + public Task MemLimitOffAsync(string process, CancellationToken cancellationToken = default) + => _api.DevicesMemLimitOffAsync(_udid, process, new GenModel.MemLimitRequest(process), cancellationToken); + + // --- Images / profiles ------------------------------------------------- + + /// List the signatures of mounted developer disk images (GET /image/list). + public Task MountedImagesAsync(CancellationToken cancellationToken = default) + => _api.DevicesListMountedImagesAsync(_udid, cancellationToken); + + /// Unmount the developer disk image (DELETE /image). + public Task UnmountImageAsync(CancellationToken cancellationToken = default) + => _api.DevicesUnmountImageAsync(_udid, cancellationToken); + + /// + /// Install a configuration profile (POST /profiles). Supply the + /// .mobileconfig bytes; for a supervised install add a + /// identity (and its ). + /// + public Task AddProfileAsync( + byte[] profile, byte[]? p12 = null, string? password = null, + CancellationToken cancellationToken = default) + { + var form = new MultipartFormDataContent { { Octet(profile), "profile", "profile.mobileconfig" } }; + if (p12 is not null) form.Add(Octet(p12), "p12", "supervision.p12"); + if (!string.IsNullOrEmpty(password)) form.Add(new StringContent(password), "password"); + var req = _raw.NewRequest(HttpMethod.Post, $"api/v1/device/{Esc(_udid)}/profiles"); + req.Content = form; + return _raw.SendJsonAsync(req, cancellationToken); + } + + /// Remove an installed configuration profile by name/identifier (DELETE /profiles/{name}). + public Task RemoveProfileAsync(string name, CancellationToken cancellationToken = default) + => _api.DevicesRemoveProfileAsync(_udid, name, cancellationToken); + + // --- Streaming (Server-Sent Events) ----------------------------------- + + /// Stream syslog lines as they arrive. Heartbeats are surfaced as . + public IAsyncEnumerable SyslogAsync(CancellationToken cancellationToken = default) + => StreamAsync($"api/v1/device/{Esc(_udid)}/syslog", SyslogFactory, cancellationToken); + + /// Stream app foreground/background/lifecycle notifications. + public IAsyncEnumerable NotificationsAsync(CancellationToken cancellationToken = default) + => StreamAsync($"api/v1/device/{Esc(_udid)}/notifications", NotificationsFactory, cancellationToken); + + /// + /// Stream structured os_log trace entries, optionally filtered (AND-combined). + /// + public IAsyncEnumerable OsTraceAsync( + OsTraceFilters? filters = null, CancellationToken cancellationToken = default) + { + var path = $"api/v1/device/{Esc(_udid)}/ostrace" + (filters?.ToQueryString() ?? ""); + return StreamAsync(path, OsTraceFactory, cancellationToken); + } + + /// Stream device attach/detach/pair events from the host. + public IAsyncEnumerable ListenAsync(CancellationToken cancellationToken = default) + => StreamAsync($"api/v1/device/{Esc(_udid)}/listen", ListenFactory, cancellationToken); + + /// + /// Stream sysmontap CPU-usage samples (GET /sysmontap). Samples are + /// surfaced as ; keep-alives as . + /// + public IAsyncEnumerable SysmontapAsync(CancellationToken cancellationToken = default) + => StreamAsync($"api/v1/device/{Esc(_udid)}/sysmontap", SysmontapFactory, cancellationToken); + + // --- SSE dispatch factories ------------------------------------------- + + private static SseEvent? SyslogFactory(string name, string data) => name switch + { + "syslog" => SseReader.Deserialize(data), + _ => null, + }; + + private static SseEvent? NotificationsFactory(string name, string data) => name switch + { + "appstate" => SseReader.Deserialize(data), + _ => null, + }; + + private static SseEvent? OsTraceFactory(string name, string data) => name switch + { + "ostrace" => SseReader.Deserialize(data), + _ => null, + }; + + private static SseEvent? ListenFactory(string name, string data) => name switch + { + "attachdetach" => SseReader.Deserialize(data), + _ => null, + }; + + private static SseEvent? SysmontapFactory(string name, string data) => name switch + { + "sample" => SseReader.Deserialize(data), + _ => null, + }; + + private async IAsyncEnumerable StreamAsync( + string path, SseEventFactory factory, + [EnumeratorCancellation] CancellationToken cancellationToken) + { + using var req = _raw.NewRequest(HttpMethod.Get, path); + req.Headers.Accept.ParseAdd("text/event-stream"); + using var resp = await _raw.Http + .SendAsync(req, HttpCompletionOption.ResponseHeadersRead, cancellationToken) + .ConfigureAwait(false); + await RawHttp.EnsureSuccessAsync(resp, cancellationToken).ConfigureAwait(false); + +#if NET5_0_OR_GREATER + await using var stream = await resp.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); +#else + using var stream = await resp.Content.ReadAsStreamAsync().ConfigureAwait(false); +#endif + await foreach (var e in SseReader.ReadAsync(stream, factory, cancellationToken).ConfigureAwait(false)) + yield return e; + } + + // --- helpers ----------------------------------------------------------- + + private static IReadOnlyDictionary ToDictionary(object? raw) + => JsonHelpers.ToDictionary(raw); + + private static ByteArrayContent Octet(byte[] bytes) + { + var c = new ByteArrayContent(bytes); + c.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream"); + return c; + } + + private static string Esc(string s) => Uri.EscapeDataString(s); +} + +/// Optional AND-combined filters for . +public sealed class OsTraceFilters +{ + /// Only include entries from this process id. + public int? Pid { get; set; } + /// Minimum log level (e.g. info, debug, error). + public string? Level { get; set; } + /// Only include entries from this subsystem. + public string? Subsystem { get; set; } + /// Only include entries whose message matches this substring/pattern. + public string? Match { get; set; } + /// Exclude entries whose message matches this substring/pattern. + public string? Exclude { get; set; } + + internal string ToQueryString() + { + var parts = new List(); + if (Pid.HasValue) parts.Add("pid=" + Pid.Value); + if (!string.IsNullOrEmpty(Level)) parts.Add("level=" + Uri.EscapeDataString(Level)); + if (!string.IsNullOrEmpty(Subsystem)) parts.Add("subsystem=" + Uri.EscapeDataString(Subsystem)); + if (!string.IsNullOrEmpty(Match)) parts.Add("match=" + Uri.EscapeDataString(Match)); + if (!string.IsNullOrEmpty(Exclude)) parts.Add("exclude=" + Uri.EscapeDataString(Exclude)); + return parts.Count > 0 ? "?" + string.Join("&", parts) : ""; + } +} + +/// Thrown when a raw (streaming / binary / multipart) request returns a non-success status. +public sealed class IosApiException : Exception +{ + /// HTTP status code. + public int StatusCode { get; } + /// Response body, if any. + public string? ResponseBody { get; } + + internal IosApiException(int statusCode, string? reason, string? body) + : base($"go-ios API request failed: {statusCode} {reason}") + { + StatusCode = statusCode; + ResponseBody = body; + } +} diff --git a/sdks/packages/csharp/src/GoIos.Sdk/DeviceExtraClients.cs b/sdks/packages/csharp/src/GoIos.Sdk/DeviceExtraClients.cs new file mode 100644 index 000000000..1865d1211 --- /dev/null +++ b/sdks/packages/csharp/src/GoIos.Sdk/DeviceExtraClients.cs @@ -0,0 +1,310 @@ +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using GoIos.Sdk; +using Gen = GoIos.Sdk.Generated.Api; +using GenModel = GoIos.Sdk.Generated.Model; + +namespace GoIos; + +/// +/// AFC file-sync operations (ios fsync ...) for a single device. Every +/// call takes a device path and an optional app bundleId that +/// scopes the operation to that app's container (otherwise the media dir). +/// Obtained via . +/// +public sealed class FsyncClient +{ + private readonly string _udid; + private readonly Gen.DefaultApi _api; + private readonly RawHttp _raw; + + internal FsyncClient(string udid, Gen.DefaultApi api, RawHttp raw) + { + _udid = udid; + _api = api; + _raw = raw; + } + + /// List the immediate entries under (GET /fsync/ls). + public Task LsAsync( + string? path = null, string? bundleId = null, CancellationToken cancellationToken = default) + => _api.FsyncFsyncLsAsync(_udid, bundleId, path, cancellationToken); + + /// Recursively list the tree under (GET /fsync/tree). + public Task TreeAsync( + string? path = null, string? bundleId = null, CancellationToken cancellationToken = default) + => _api.FsyncFsyncTreeAsync(_udid, bundleId, path, cancellationToken); + + /// Download a file over AFC and return its raw bytes (GET /fsync/pull). + public Task PullAsync( + string path, string? bundleId = null, CancellationToken cancellationToken = default) + { + var qs = BuildQuery(("bundleID", bundleId), ("path", path)); + var req = _raw.NewRequest(HttpMethod.Get, $"api/v1/device/{Esc(_udid)}/fsync/pull{qs}"); + req.Headers.Accept.ParseAdd("application/octet-stream"); + return _raw.SendBytesAsync(req, cancellationToken); + } + + /// Upload raw bytes to over AFC (POST /fsync/push, octet-stream body). + public Task PushAsync( + string path, byte[] content, string? bundleId = null, CancellationToken cancellationToken = default) + { + var qs = BuildQuery(("bundleID", bundleId), ("path", path)); + var req = _raw.NewRequest(HttpMethod.Post, $"api/v1/device/{Esc(_udid)}/fsync/push{qs}"); + var body = new ByteArrayContent(content); + body.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream"); + req.Content = body; + return _raw.SendJsonAsync(req, cancellationToken); + } + + /// Upload a local file's contents to over AFC (POST /fsync/push). + public async Task PushAsync( + string path, string localPath, string? bundleId = null, CancellationToken cancellationToken = default) + { + var bytes = await File.ReadAllBytesAsync(localPath, cancellationToken).ConfigureAwait(false); + return await PushAsync(path, bytes, bundleId, cancellationToken).ConfigureAwait(false); + } + + /// Remove a file or directory at (DELETE /fsync/rm). + public Task RmAsync( + string path, bool recursive = false, string? bundleId = null, CancellationToken cancellationToken = default) + => _api.FsyncFsyncRmAsync(_udid, path, bundleId, recursive, cancellationToken); + + /// Create a directory at (POST /fsync/mkdir). + public Task MkdirAsync( + string path, string? bundleId = null, CancellationToken cancellationToken = default) + => _api.FsyncFsyncMkdirAsync(_udid, path, bundleId, cancellationToken); + + private static string BuildQuery(params (string Key, string? Value)[] pairs) + { + var parts = new List(); + foreach (var (k, v) in pairs) + if (!string.IsNullOrEmpty(v)) + parts.Add(k + "=" + Uri.EscapeDataString(v)); + return parts.Count > 0 ? "?" + string.Join("&", parts) : ""; + } + + private static string Esc(string s) => Uri.EscapeDataString(s); +} + +/// +/// WebInspector (Safari / WKWebView remote debugging) operations for a single +/// device. Obtained via . +/// +public sealed class WebInspectorClient +{ + private readonly string _udid; + private readonly Gen.DefaultApi _api; + + internal WebInspectorClient(string udid, Gen.DefaultApi api) + { + _udid = udid; + _api = api; + } + + /// List the inspectable pages/targets on the device (GET /webinspector/pages). + public async Task>> PagesAsync( + CancellationToken cancellationToken = default) + { + var raw = await _api.WebInspectorWebInspectorPagesAsync(_udid, cancellationToken).ConfigureAwait(false); + return (raw ?? new List()).Select(JsonHelpers.ToDictionary).ToList(); + } + + /// Open a URL (or a bundle id's default page) for inspection (POST /webinspector/launch). + public Task LaunchAsync( + string? url = null, string? bundleId = null, CancellationToken cancellationToken = default) + => _api.WebInspectorWebInspectorLaunchAsync( + _udid, null, new GenModel.WebInspectorLaunchRequest(url: url!, bundleId: bundleId!), cancellationToken); + + /// Evaluate a JavaScript against a page (POST /webinspector/eval). + public Task EvalAsync( + string script, string? page = null, string? bundleId = null, CancellationToken cancellationToken = default) + => _api.WebInspectorWebInspectorEvalAsync( + _udid, new GenModel.WebInspectorEvalRequest(page: page!, bundleId: bundleId!, script: script), + cancellationToken); +} + +/// +/// UI automation operations backed by WebDriverAgent or DeviceKit +/// (ios ui ...). Every call accepts optional +/// (wda | devicekit), wdaUrl and timeout (seconds) +/// selectors. Obtained via . +/// +public sealed class UiClient +{ + private readonly string _udid; + private readonly Gen.DefaultApi _api; + private readonly RawHttp _raw; + + internal UiClient(string udid, Gen.DefaultApi api, RawHttp raw) + { + _udid = udid; + _api = api; + _raw = raw; + } + + /// Optional backend selectors shared by every UI call. + public sealed class Options + { + /// Backend to target: wda (default) or devicekit. + public string? Backend { get; set; } + /// Forwarded backend base URL (defaults per backend). + public string? WdaUrl { get; set; } + /// Per-request HTTP timeout in seconds (default 60). + public int? Timeout { get; set; } + } + + // --- Gestures ---------------------------------------------------------- + + /// Tap at (, ) (POST /ui/tap). + public async Task> TapAsync( + int x, int y, Options? options = null, CancellationToken cancellationToken = default) + => JsonHelpers.ToDictionary(await _api.UIUiTapAsync( + _udid, new GenModel.UITapRequest(x, y), B(options), U(options), T(options), cancellationToken).ConfigureAwait(false)); + + /// Swipe from (, ) to (, ) (POST /ui/swipe). + public async Task> SwipeAsync( + int x1, int y1, int x2, int y2, double duration = 0, + Options? options = null, CancellationToken cancellationToken = default) + => JsonHelpers.ToDictionary(await _api.UIUiSwipeAsync( + _udid, new GenModel.UISwipeRequest(x1, y1, x2, y2, duration), B(options), U(options), T(options), cancellationToken).ConfigureAwait(false)); + + /// Long-press at (, ) for seconds (POST /ui/longpress). + public async Task> LongPressAsync( + int x, int y, double duration = 1.0, + Options? options = null, CancellationToken cancellationToken = default) + => JsonHelpers.ToDictionary(await _api.UIUiLongPressAsync( + _udid, new GenModel.UILongPressRequest(x, y, duration), B(options), U(options), T(options), cancellationToken).ConfigureAwait(false)); + + /// Type into the focused element (POST /ui/type). + public async Task> TypeAsync( + string text, Options? options = null, CancellationToken cancellationToken = default) + => JsonHelpers.ToDictionary(await _api.UIUiTypeAsync( + _udid, new GenModel.UITypeRequest(text), B(options), U(options), T(options), cancellationToken).ConfigureAwait(false)); + + /// Press a hardware/system button by (e.g. home) (POST /ui/button). + public async Task> ButtonAsync( + string name, Options? options = null, CancellationToken cancellationToken = default) + => JsonHelpers.ToDictionary(await _api.UIUiButtonAsync( + _udid, new GenModel.UIButtonRequest(name), B(options), U(options), T(options), cancellationToken).ConfigureAwait(false)); + + // --- Introspection ----------------------------------------------------- + + /// Capture the screen and return raw PNG bytes (GET /ui/screenshot). + public Task ScreenshotAsync(Options? options = null, CancellationToken cancellationToken = default) + { + var req = _raw.NewRequest(HttpMethod.Get, $"api/v1/device/{Esc(_udid)}/ui/screenshot{Query(options)}"); + req.Headers.Accept.ParseAdd("image/png"); + return _raw.SendBytesAsync(req, cancellationToken); + } + + /// Return the current view hierarchy (XML for WDA) (GET /ui/source). + public Task SourceAsync(Options? options = null, CancellationToken cancellationToken = default) + { + var req = _raw.NewRequest(HttpMethod.Get, $"api/v1/device/{Esc(_udid)}/ui/source{Query(options)}"); + req.Headers.Accept.ParseAdd("application/xml"); + return _raw.SendTextAsync(req, cancellationToken); + } + + /// Get the window/screen size (GET /ui/size). + public async Task> SizeAsync( + Options? options = null, CancellationToken cancellationToken = default) + => JsonHelpers.ToDictionary(await _api.UIUiWindowSizeAsync( + _udid, B(options), U(options), T(options), cancellationToken).ConfigureAwait(false)); + + /// Get the current device orientation (GET /ui/orientation). + public async Task> OrientationAsync( + Options? options = null, CancellationToken cancellationToken = default) + => JsonHelpers.ToDictionary(await _api.UIUiGetOrientationAsync( + _udid, B(options), U(options), T(options), cancellationToken).ConfigureAwait(false)); + + /// Set the device orientation (PUT /ui/orientation). + public async Task> SetOrientationAsync( + string orientation, Options? options = null, CancellationToken cancellationToken = default) + => JsonHelpers.ToDictionary(await _api.UIUiSetOrientationAsync( + _udid, new GenModel.UIOrientationRequest(orientation), B(options), U(options), T(options), cancellationToken).ConfigureAwait(false)); + + /// Get the backend's status/health payload (GET /ui/status). + public async Task> StatusAsync( + Options? options = null, CancellationToken cancellationToken = default) + => JsonHelpers.ToDictionary(await _api.UIUiStatusAsync( + _udid, B(options), U(options), T(options), cancellationToken).ConfigureAwait(false)); + + // --- App control ------------------------------------------------------- + + /// Launch an app by bundle id via the UI backend (POST /ui/app/launch). + public async Task> AppLaunchAsync( + string bundleId, Options? options = null, CancellationToken cancellationToken = default) + => JsonHelpers.ToDictionary(await _api.UIUiAppLaunchAsync( + _udid, new GenModel.UIAppRequest(bundleId), B(options), U(options), T(options), cancellationToken).ConfigureAwait(false)); + + /// Terminate an app by bundle id via the UI backend (POST /ui/app/terminate). + public async Task> AppTerminateAsync( + string bundleId, Options? options = null, CancellationToken cancellationToken = default) + => JsonHelpers.ToDictionary(await _api.UIUiAppTerminateAsync( + _udid, new GenModel.UIAppRequest(bundleId), B(options), U(options), T(options), cancellationToken).ConfigureAwait(false)); + + /// Get the currently foregrounded app (POST /ui/app/foreground). + public async Task> AppForegroundAsync( + Options? options = null, CancellationToken cancellationToken = default) + => JsonHelpers.ToDictionary(await _api.UIUiAppForegroundAsync( + _udid, B(options), U(options), T(options), cancellationToken).ConfigureAwait(false)); + + // --- Passthrough / streaming ------------------------------------------ + + /// + /// Send a raw request through to the backend (POST /ui/api): either an + /// HTTP passthrough ( + [+ ]) + /// or a DeviceKit RPC ( + ). + /// + public async Task> ApiAsync( + string? method = null, string? path = null, string? body = null, + string? rpcMethod = null, object? rpcParams = null, + Options? options = null, CancellationToken cancellationToken = default) + { + var request = new GenModel.UIAPIRequest + { + Method = method!, Path = path!, Body = body!, RpcMethod = rpcMethod!, RpcParams = rpcParams!, + }; + return JsonHelpers.ToDictionary(await _api.UIUiApiAsync( + _udid, request, B(options), U(options), T(options), cancellationToken).ConfigureAwait(false)); + } + + /// + /// Open a live UI video stream (GET /ui/stream). Returns a raw + /// of MJPEG (default) or H.264 bytes; dispose it to + /// stop. Honors the . + /// + public Task StreamAsync( + Options? options = null, string? codec = null, string? fps = null, string? quality = null, + string? scale = null, string? bitrate = null, CancellationToken cancellationToken = default) + { + var qs = BuildQuery( + ("backend", options?.Backend), ("wdaUrl", options?.WdaUrl), + ("timeout", options?.Timeout?.ToString()), + ("codec", codec), ("fps", fps), ("quality", quality), ("scale", scale), ("bitrate", bitrate)); + var req = _raw.NewRequest(HttpMethod.Get, $"api/v1/device/{Esc(_udid)}/ui/stream{qs}"); + return _raw.OpenBinaryStreamAsync(req, "application/octet-stream", cancellationToken); + } + + // --- helpers ----------------------------------------------------------- + + private static string? B(Options? o) => string.IsNullOrEmpty(o?.Backend) ? null : o!.Backend; + private static string? U(Options? o) => string.IsNullOrEmpty(o?.WdaUrl) ? null : o!.WdaUrl; + private static int? T(Options? o) => o?.Timeout; + + private static string Query(Options? o) + => BuildQuery(("backend", o?.Backend), ("wdaUrl", o?.WdaUrl), ("timeout", o?.Timeout?.ToString())); + + private static string BuildQuery(params (string Key, string? Value)[] pairs) + { + var parts = new List(); + foreach (var (k, v) in pairs) + if (!string.IsNullOrEmpty(v)) + parts.Add(k + "=" + Uri.EscapeDataString(v)); + return parts.Count > 0 ? "?" + string.Join("&", parts) : ""; + } + + private static string Esc(string s) => Uri.EscapeDataString(s); +} diff --git a/sdks/packages/csharp/src/GoIos.Sdk/DeviceSubClients.cs b/sdks/packages/csharp/src/GoIos.Sdk/DeviceSubClients.cs new file mode 100644 index 000000000..d21ca2997 --- /dev/null +++ b/sdks/packages/csharp/src/GoIos.Sdk/DeviceSubClients.cs @@ -0,0 +1,226 @@ +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text; +using GoIos.Sdk; +using Gen = GoIos.Sdk.Generated.Api; +using GenModel = GoIos.Sdk.Generated.Model; + +namespace GoIos; + +/// Crash-report operations for a single device. +public sealed class CrashesClient +{ + private readonly string _udid; + private readonly Gen.DefaultApi _api; + internal CrashesClient(string udid, Gen.DefaultApi api) { _udid = udid; _api = api; } + + /// List crash-report file names, optionally filtered by glob (GET /crashes). + public Task ListAsync(string? pattern = null, CancellationToken cancellationToken = default) + => _api.DevicesListCrashesAsync(_udid, pattern, cancellationToken); + + /// + /// Remove (copy-out then delete) crash reports matching + /// under working directory (defaults to ".") (DELETE /crashes). + /// + public Task RemoveAsync(string pattern, string cwd = ".", CancellationToken cancellationToken = default) + => _api.DevicesRemoveCrashesAsync(_udid, cwd, pattern, cancellationToken); +} + +/// +/// Media / presentation operations: wallpaper, SpringBoard icon layout and the +/// pasteboard. Binary and multipart transfers use the raw HTTP pipeline. +/// +public sealed class MediaClient +{ + private readonly string _udid; + private readonly Gen.DefaultApi _api; + private readonly RawHttp _raw; + internal MediaClient(string udid, Gen.DefaultApi api, RawHttp raw) { _udid = udid; _api = api; _raw = raw; } + + /// Get the current wallpaper as PNG bytes (GET /wallpaper). + public Task WallpaperAsync(CancellationToken cancellationToken = default) + => _raw.GetBytesAsync($"api/v1/device/{Esc(_udid)}/wallpaper", "image/png", cancellationToken); + + /// + /// Set the wallpaper (PUT /wallpaper, supervised). Requires a supervision + /// identity ; is home, + /// lock or both. + /// + public Task SetWallpaperAsync( + byte[] image, byte[] p12, string? password = null, string? screen = null, + string imageFileName = "wallpaper.png", CancellationToken cancellationToken = default) + { + var form = new MultipartFormDataContent + { + { Octet(image), "image", imageFileName }, + { Octet(p12), "p12", "supervision.p12" }, + }; + if (!string.IsNullOrEmpty(password)) form.Add(new StringContent(password), "password"); + if (!string.IsNullOrEmpty(screen)) form.Add(new StringContent(screen), "screen"); + var req = _raw.NewRequest(HttpMethod.Put, $"api/v1/device/{Esc(_udid)}/wallpaper"); + req.Content = form; + return _raw.SendJsonAsync(req, cancellationToken); + } + + /// Get the SpringBoard icon layout (GET /icon-layout). + public async Task> IconLayoutAsync(CancellationToken cancellationToken = default) + => JsonHelpers.ToDictionary(await _api.DevicesGetIconLayoutAsync(_udid, cancellationToken).ConfigureAwait(false)); + + /// Set the SpringBoard icon layout (PUT /icon-layout). + public Task SetIconLayoutAsync(object layout, CancellationToken cancellationToken = default) + => _api.DevicesSetIconLayoutAsync(_udid, layout, cancellationToken); + + /// Read the device pasteboard (GET /pasteboard). + public Task PasteboardAsync(CancellationToken cancellationToken = default) + => _api.DevicesGetPasteboardAsync(_udid, cancellationToken); + + /// Set the device pasteboard text (PUT /pasteboard, text/plain body). + public Task SetPasteboardAsync(string text, CancellationToken cancellationToken = default) + { + var req = _raw.NewRequest(HttpMethod.Put, $"api/v1/device/{Esc(_udid)}/pasteboard"); + req.Content = new StringContent(text, Encoding.UTF8, "text/plain"); + return _raw.SendJsonAsync(req, cancellationToken); + } + + private static ByteArrayContent Octet(byte[] bytes) + { + var c = new ByteArrayContent(bytes); + c.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream"); + return c; + } + + private static string Esc(string s) => Uri.EscapeDataString(s); +} + +/// Device settings toggles: AssistiveTouch, time format and Wi-Fi. +public sealed class SettingsClient +{ + private readonly string _udid; + private readonly Gen.DefaultApi _api; + internal SettingsClient(string udid, Gen.DefaultApi api) { _udid = udid; _api = api; } + + /// Get the AssistiveTouch enabled state (GET /assistivetouch). + public Task AssistiveTouchAsync(CancellationToken cancellationToken = default) + => _api.DevicesGetAssistiveTouchAsync(_udid, cancellationToken); + + /// Enable or disable AssistiveTouch (PUT /assistivetouch). + public Task SetAssistiveTouchAsync(bool enabled, CancellationToken cancellationToken = default) + => _api.DevicesSetAssistiveTouchAsync(_udid, new GenModel.EnabledRequest(enabled), cancellationToken); + + /// Get the 24-hour time-format state (GET /timeformat). + public Task TimeFormatAsync(CancellationToken cancellationToken = default) + => _api.DevicesGetTimeFormatAsync(_udid, cancellationToken); + + /// Set whether the device uses a 24-hour clock (PUT /timeformat). + public Task SetTimeFormatAsync(bool uses24Hour, CancellationToken cancellationToken = default) + => _api.DevicesSetTimeFormatAsync(_udid, new GenModel.TimeFormatRequest(uses24Hour), cancellationToken); + + /// Join a Wi-Fi network (PUT /wifi). + public Task SetWifiAsync( + string ssid, string? password = null, string? encType = null, CancellationToken cancellationToken = default) + => _api.DevicesSetWifiAsync( + _udid, + new GenModel.WifiRequest(ssid) { Password = password!, EncType = encType! }, + cancellationToken); + + /// Forget / remove a Wi-Fi network by (DELETE /wifi). + public Task RemoveWifiAsync(string ssid, CancellationToken cancellationToken = default) + => _api.DevicesRemoveWifiAsync(_udid, ssid, cancellationToken); +} + +/// MDM (supervised) operations for a single device. All require a supervision identity. +public sealed class MdmClient +{ + private readonly string _udid; + private readonly RawHttp _raw; + internal MdmClient(string udid, RawHttp raw) { _udid = udid; _raw = raw; } + + /// Fetch device security info (POST /mdm/security-info). + public Task> SecurityInfoAsync( + byte[] p12, string? password = null, CancellationToken cancellationToken = default) + => PostP12DictAsync("security-info", p12, password, null, cancellationToken); + + /// Fetch the escrow unlock token (POST /mdm/fetch-unlock-token). + public async Task FetchUnlockTokenAsync( + byte[] p12, string? password = null, CancellationToken cancellationToken = default) + { + var req = BuildP12Request("fetch-unlock-token", p12, password, null); + return await _raw.SendJsonAsync(req, cancellationToken).ConfigureAwait(false); + } + + /// Clear the device passcode using an escrow (POST /mdm/clear-passcode). + public Task ClearPasscodeAsync( + byte[] p12, string token, string? password = null, CancellationToken cancellationToken = default) + { + var req = BuildP12Request("clear-passcode", p12, password, form => + form.Add(new StringContent(token), "token")); + return _raw.SendJsonAsync(req, cancellationToken); + } + + /// Clear the Screen Time passcode (POST /mdm/clear-screen-time-password). + public Task ClearScreenTimePasswordAsync( + byte[] p12, string? password = null, CancellationToken cancellationToken = default) + { + var req = BuildP12Request("clear-screen-time-password", p12, password, null); + return _raw.SendJsonAsync(req, cancellationToken); + } + + private async Task> PostP12DictAsync( + string leaf, byte[] p12, string? password, Action? extra, CancellationToken ct) + { + var req = BuildP12Request(leaf, p12, password, extra); + var text = await _raw.SendTextAsync(req, ct).ConfigureAwait(false); + return JsonHelpers.ToDictionary(text); + } + + private HttpRequestMessage BuildP12Request( + string leaf, byte[] p12, string? password, Action? extra) + { + var p12Content = new ByteArrayContent(p12); + p12Content.Headers.ContentType = new MediaTypeHeaderValue("application/x-pkcs12"); + var form = new MultipartFormDataContent { { p12Content, "p12", "supervision.p12" } }; + if (!string.IsNullOrEmpty(password)) form.Add(new StringContent(password), "password"); + extra?.Invoke(form); + var req = _raw.NewRequest(HttpMethod.Post, $"api/v1/device/{Uri.EscapeDataString(_udid)}/mdm/{leaf}"); + req.Content = form; + return req; + } +} + +/// Global HTTP-proxy configuration for a single device. +public sealed class ProxyClient +{ + private readonly string _udid; + private readonly Gen.DefaultApi _api; + private readonly RawHttp _raw; + internal ProxyClient(string udid, Gen.DefaultApi api, RawHttp raw) { _udid = udid; _api = api; _raw = raw; } + + /// + /// Configure the global HTTP proxy (PUT /httpproxy, supervised). Requires a + /// supervision identity . + /// + public Task SetHttpProxyAsync( + string host, string port, byte[] p12, + string? user = null, string? pass = null, string? password = null, + CancellationToken cancellationToken = default) + { + var p12Content = new ByteArrayContent(p12); + p12Content.Headers.ContentType = new MediaTypeHeaderValue("application/x-pkcs12"); + var form = new MultipartFormDataContent + { + { new StringContent(host), "host" }, + { new StringContent(port), "port" }, + { p12Content, "p12", "supervision.p12" }, + }; + if (!string.IsNullOrEmpty(user)) form.Add(new StringContent(user), "user"); + if (!string.IsNullOrEmpty(pass)) form.Add(new StringContent(pass), "pass"); + if (!string.IsNullOrEmpty(password)) form.Add(new StringContent(password), "password"); + var req = _raw.NewRequest(HttpMethod.Put, $"api/v1/device/{Uri.EscapeDataString(_udid)}/httpproxy"); + req.Content = form; + return _raw.SendJsonAsync(req, cancellationToken); + } + + /// Remove the global HTTP proxy (DELETE /httpproxy). + public Task RemoveHttpProxyAsync(CancellationToken cancellationToken = default) + => _api.DevicesRemoveHttpProxyAsync(_udid, cancellationToken); +} diff --git a/sdks/packages/csharp/src/GoIos.Sdk/Discovery.cs b/sdks/packages/csharp/src/GoIos.Sdk/Discovery.cs new file mode 100644 index 000000000..b71f3694c --- /dev/null +++ b/sdks/packages/csharp/src/GoIos.Sdk/Discovery.cs @@ -0,0 +1,120 @@ +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace GoIos; + +/// +/// Locates a locally running go-ios REST daemon by reading the discovery file +/// (<home>/rest-api.json) that the daemon writes after it binds a +/// (by default ephemeral, loopback-only) port. +/// +/// +/// Home directory resolution matches the cross-language discovery contract: +/// the GO_IOS_HOME environment variable when set and non-empty, otherwise +/// ~/.go-ios (the user profile directory). +/// +public static class Discovery +{ + /// Name of the discovery file written by the daemon. + public const string DiscoveryFileName = "rest-api.json"; + + /// + /// Resolve the go-ios home directory: GO_IOS_HOME env if set and + /// non-empty, otherwise ~/.go-ios. + /// + public static string HomeDirectory() + { + var home = Environment.GetEnvironmentVariable("GO_IOS_HOME"); + if (!string.IsNullOrWhiteSpace(home)) + return home; + + var profile = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); + if (string.IsNullOrEmpty(profile)) + profile = Environment.GetEnvironmentVariable("HOME") ?? "."; + return Path.Combine(profile, ".go-ios"); + } + + /// Full path to the discovery file (<home>/rest-api.json). + public static string DiscoveryFilePath() => Path.Combine(HomeDirectory(), DiscoveryFileName); + + /// + /// Discover the base URL of the local go-ios REST daemon by reading the + /// discovery file. Throws with a clear, + /// actionable message when the file is missing, unreadable, or malformed. + /// + public static string DiscoverBaseUrl() + { + var path = DiscoveryFilePath(); + + string json; + try + { + json = File.ReadAllText(path); + } + catch (Exception ex) when (ex is FileNotFoundException or DirectoryNotFoundException or IOException or UnauthorizedAccessException) + { + throw NotFound(path, ex); + } + + DiscoveryFile? info; + try + { + info = JsonSerializer.Deserialize(json, DiscoveryJsonContext.Default.DiscoveryFile); + } + catch (JsonException ex) + { + throw NotFound(path, ex); + } + + if (info is null || string.IsNullOrWhiteSpace(info.BaseUrl)) + throw NotFound(path, null); + + return info.BaseUrl; + } + + private static DaemonNotFoundException NotFound(string path, Exception? inner) => + new( + $"no local go-ios REST daemon found at {path}; start it (run the go-ios REST API) or pass an explicit BaseUrl", + inner); + + /// Shape of rest-api.json. Only baseUrl is authoritative. + internal sealed class DiscoveryFile + { + [JsonPropertyName("baseUrl")] + public string? BaseUrl { get; set; } + + [JsonPropertyName("host")] + public string? Host { get; set; } + + [JsonPropertyName("port")] + public int Port { get; set; } + + [JsonPropertyName("pid")] + public int Pid { get; set; } + + [JsonPropertyName("startedAt")] + public string? StartedAt { get; set; } + + [JsonPropertyName("tls")] + public bool Tls { get; set; } + } +} + +[JsonSourceGenerationOptions(PropertyNameCaseInsensitive = true)] +[JsonSerializable(typeof(Discovery.DiscoveryFile))] +internal sealed partial class DiscoveryJsonContext : JsonSerializerContext +{ +} + +/// +/// Thrown when no local go-ios REST daemon can be discovered and no explicit +/// or GO_IOS_BASE_URL was provided. +/// +public sealed class DaemonNotFoundException : Exception +{ + /// Create a new . + public DaemonNotFoundException(string message, Exception? innerException = null) + : base(message, innerException) + { + } +} diff --git a/sdks/packages/csharp/src/GoIos.Sdk/Events.cs b/sdks/packages/csharp/src/GoIos.Sdk/Events.cs new file mode 100644 index 000000000..1f7509ad7 --- /dev/null +++ b/sdks/packages/csharp/src/GoIos.Sdk/Events.cs @@ -0,0 +1,127 @@ +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace GoIos.Sdk; + +/// +/// Base type for every event surfaced by a streaming (Server-Sent Events) +/// endpoint. The is the SSE event: field. +/// +public abstract record SseEvent +{ + /// The SSE event: name this frame carried. + [JsonIgnore] + public string EventName { get; init; } = ""; +} + +/// +/// Periodic keep-alive frame emitted on every stream (event: heartbeat, +/// empty {} payload). Lets a client tell "live but idle" from "dropped". +/// +public sealed record HeartbeatEvent : SseEvent; + +/// +/// An event whose event: name did not match any known type for the stream. +/// Surfaced (not dropped) for forward-compatibility. The raw JSON payload is kept. +/// +public sealed record UnknownEvent : SseEvent +{ + /// The raw, undeserialized data: JSON payload (may be empty). + public string RawData { get; init; } = ""; +} + +// --- /syslog : SyslogEvents ------------------------------------------------ + +/// A single syslog line from the device (event: syslog). +public sealed record SyslogMessageEvent : SseEvent +{ + [JsonPropertyName("message")] public string Message { get; init; } = ""; + [JsonPropertyName("timestamp")] public long? Timestamp { get; init; } +} + +// --- /notifications : NotificationEvents ----------------------------------- + +/// An app foreground/background/lifecycle state change (event: appstate). +public sealed record AppStateNotificationEvent : SseEvent +{ + [JsonPropertyName("bundleId")] public string BundleId { get; init; } = ""; + + /// + /// New application state. Typical values: foreground, background, + /// suspended, terminated, unknown. + /// + [JsonPropertyName("state")] public string State { get; init; } = ""; + [JsonPropertyName("timestamp")] public long? Timestamp { get; init; } +} + +// --- /ostrace : OsTraceEvents ---------------------------------------------- + +/// A structured os_log trace entry (event: ostrace). +public sealed record OsTraceEntryEvent : SseEvent +{ + [JsonPropertyName("pid")] public int? Pid { get; init; } + [JsonPropertyName("processName")] public string? ProcessName { get; init; } + + /// Log level, e.g. default, info, debug, error, fault. + [JsonPropertyName("level")] public string? Level { get; init; } + [JsonPropertyName("subsystem")] public string? Subsystem { get; init; } + [JsonPropertyName("category")] public string? Category { get; init; } + [JsonPropertyName("message")] public string Message { get; init; } = ""; + [JsonPropertyName("timestamp")] public long? Timestamp { get; init; } +} + +// --- /listen : ListenEvents ------------------------------------------------ + +/// Device properties reported by usbmuxd / lockdown (payload of an attach event). +public sealed record DevicePropertiesData +{ + [JsonPropertyName("connectionSpeed")] public int? ConnectionSpeed { get; init; } + [JsonPropertyName("connectionType")] public string? ConnectionType { get; init; } + [JsonPropertyName("deviceID")] public int? DeviceID { get; init; } + [JsonPropertyName("locationID")] public int? LocationID { get; init; } + [JsonPropertyName("productID")] public int? ProductID { get; init; } + [JsonPropertyName("serialNumber")] public string SerialNumber { get; init; } = ""; +} + +/// A device was attached to or detached from the host (event: attachdetach). +public sealed record AttachDetachEventEvent : SseEvent +{ + /// Event kind: attached, detached, or paired. + [JsonPropertyName("event")] public string Event { get; init; } = ""; + [JsonPropertyName("deviceID")] public int? DeviceID { get; init; } + [JsonPropertyName("udid")] public string? Udid { get; init; } + + /// Full device properties, present on attached. + [JsonPropertyName("properties")] public DevicePropertiesData? Properties { get; init; } +} + +// --- /sysmontap : SysmontapEvents ------------------------------------------ + +/// +/// A single sysmontap CPU-usage sample (event: sample). This is an open +/// map — samplers report additional keys depending on the OS — so the well-known +/// load fields are surfaced strongly-typed and the rest is kept in . +/// +public sealed record CpuUsageSampleEvent : SseEvent +{ + /// Total CPU load across all cores (0–100). + [JsonPropertyName("CPU_TotalLoad")] public double? CpuTotalLoad { get; init; } + + /// System (kernel) CPU load. + [JsonPropertyName("SystemLoad")] public double? SystemLoad { get; init; } + + /// User CPU load. + [JsonPropertyName("UserLoad")] public double? UserLoad { get; init; } + + /// Any extra sampler keys not modelled above (OS-dependent). + [JsonExtensionData] public Dictionary? Extra { get; init; } +} + +// --- /jobs/{id}/logs : JobLogEvents ---------------------------------------- + +/// A single line of a job's log output (event: log). +public sealed record JobLogLineEvent : SseEvent +{ + /// The raw log line (already newline-terminated in the buffer). + [JsonPropertyName("line")] public string Line { get; init; } = ""; +} diff --git a/sdks/packages/csharp/src/GoIos.Sdk/FilesClient.cs b/sdks/packages/csharp/src/GoIos.Sdk/FilesClient.cs new file mode 100644 index 000000000..ed2c729b8 --- /dev/null +++ b/sdks/packages/csharp/src/GoIos.Sdk/FilesClient.cs @@ -0,0 +1,85 @@ +using System.Net.Http; +using System.Net.Http.Headers; +using GoIos.Sdk; +using Gen = GoIos.Sdk.Generated.Api; +using GenModel = GoIos.Sdk.Generated.Model; + +namespace GoIos; + +/// +/// AFC file-system operations for a single device, scoped to an application +/// sandbox domain (e.g. appDocuments, appContainer, +/// appGroupContainer, media, root). Binary transfers go +/// through the raw HTTP pipeline. +/// +public sealed class FilesClient +{ + private readonly string _udid; + private readonly Gen.DefaultApi _api; + private readonly RawHttp _raw; + + internal FilesClient(string udid, Gen.DefaultApi api, RawHttp raw) + { + _udid = udid; + _api = api; + _raw = raw; + } + + /// + /// List files under in the given + /// (GET /files). is the app bundle id when + /// the domain is app-scoped. + /// + public Task LsAsync( + string domain, string? path = null, string? identifier = null, + CancellationToken cancellationToken = default) + { + var qs = BuildQuery(("domain", domain), ("identifier", identifier), ("path", path)); + var req = _raw.NewRequest(HttpMethod.Get, $"api/v1/device/{Esc(_udid)}/files{qs}"); + return _raw.SendJsonAsync(req, cancellationToken); + } + + /// Pull a single file's raw bytes (GET /files/pull). + public Task PullAsync( + string domain, string remote, string? identifier = null, + CancellationToken cancellationToken = default) + { + var qs = BuildQuery(("domain", domain), ("identifier", identifier), ("remote", remote)); + var req = _raw.NewRequest(HttpMethod.Get, $"api/v1/device/{Esc(_udid)}/files/pull{qs}"); + req.Headers.Accept.ParseAdd("application/octet-stream"); + return _raw.SendBytesAsync(req, cancellationToken); + } + + /// Push bytes to as an octet-stream body (POST /files/push). + public Task PushAsync( + string domain, string remote, byte[] content, string? identifier = null, + CancellationToken cancellationToken = default) + { + var qs = BuildQuery(("domain", domain), ("identifier", identifier), ("remote", remote)); + var req = _raw.NewRequest(HttpMethod.Post, $"api/v1/device/{Esc(_udid)}/files/push{qs}"); + var body = new ByteArrayContent(content); + body.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream"); + req.Content = body; + return _raw.SendJsonAsync(req, cancellationToken); + } + + /// Push a local file's contents to (POST /files/push). + public async Task PushAsync( + string domain, string remote, string localPath, string? identifier = null, + CancellationToken cancellationToken = default) + { + var bytes = await File.ReadAllBytesAsync(localPath, cancellationToken).ConfigureAwait(false); + return await PushAsync(domain, remote, bytes, identifier, cancellationToken).ConfigureAwait(false); + } + + private static string BuildQuery(params (string Key, string? Value)[] pairs) + { + var parts = new List(); + foreach (var (k, v) in pairs) + if (!string.IsNullOrEmpty(v)) + parts.Add(k + "=" + Uri.EscapeDataString(v)); + return parts.Count > 0 ? "?" + string.Join("&", parts) : ""; + } + + private static string Esc(string s) => Uri.EscapeDataString(s); +} diff --git a/sdks/packages/csharp/src/GoIos.Sdk/GoIos.Sdk.csproj b/sdks/packages/csharp/src/GoIos.Sdk/GoIos.Sdk.csproj new file mode 100644 index 000000000..9c2f3cb29 --- /dev/null +++ b/sdks/packages/csharp/src/GoIos.Sdk/GoIos.Sdk.csproj @@ -0,0 +1,72 @@ + + + + net8.0 + latest + enable + enable + false + true + + $(NoWarn);CS1591 + + + GoIos.Sdk + 0.1.0 + go-ios contributors + go-ios + Ergonomic C#/.NET SDK for the go-ios REST API (device automation for iOS). Typed client with an idiomatic async facade and IAsyncEnumerable Server-Sent Events streaming. + ios;go-ios;appium;device;automation;xcuitest;wda + MIT + README.md + https://github.com/danielpaulus/go-ios-sdks + git + https://github.com/danielpaulus/go-ios-sdks + true + + + true + true + true + true + true + snupkg + + + + + + + + + + + + + + + + + + + $(TargetsForTfmSpecificBuildOutput);IncludeGeneratedClientInPackage + + + + + + + + + + + + diff --git a/sdks/packages/csharp/src/GoIos.Sdk/HostClients.cs b/sdks/packages/csharp/src/GoIos.Sdk/HostClients.cs new file mode 100644 index 000000000..a7316124d --- /dev/null +++ b/sdks/packages/csharp/src/GoIos.Sdk/HostClients.cs @@ -0,0 +1,135 @@ +using System.Net.Http; +using System.Net.Http.Headers; +using GoIos.Sdk; +using Gen = GoIos.Sdk.Generated.Api; +using GenModel = GoIos.Sdk.Generated.Model; + +namespace GoIos; + +/// +/// Host-scoped (device-free) code-signing operations backed by App Store Connect +/// (ios sign ...). Obtained via . Uploads are +/// multipart; the certificate/app results are returned as raw bytes. +/// +public sealed class SignClient +{ + private readonly RawHttp _raw; + internal SignClient(RawHttp raw) => _raw = raw; + + /// + /// Create one App Store Connect signing certificate and return its P12 + /// (certificate + private key) bytes (POST /sign/certificate). The + /// generated P12 password is echoed back in the X-P12-Password response + /// header. + /// + public Task CertificateAsync( + byte[] ascPrivateKey, string ascKeyId, string ascIssuerId, + bool revokeExisting = false, string? p12Password = null, + CancellationToken cancellationToken = default) + { + var form = new MultipartFormDataContent + { + { Octet(ascPrivateKey), "asc-private-key", "AuthKey.p8" }, + { new StringContent(ascKeyId), "asc-key-id" }, + { new StringContent(ascIssuerId), "asc-issuer-id" }, + }; + if (revokeExisting) form.Add(new StringContent("true"), "revoke-existing"); + if (!string.IsNullOrEmpty(p12Password)) form.Add(new StringContent(p12Password), "p12password"); + + var req = _raw.NewRequest(HttpMethod.Post, "api/v1/sign/certificate"); + req.Content = form; + req.Headers.Accept.ParseAdd("application/x-pkcs12"); + return _raw.SendBytesAsync(req, cancellationToken); + } + + /// + /// Create a bundle id, development certificate and provisioning profile for a + /// device and return both artifacts base64-encoded (POST /sign/provision). + /// + public Task ProvisionAsync( + byte[] ascPrivateKey, string ascKeyId, string ascIssuerId, + string bundleId, string udid, + string? bundleName = null, string? profileName = null, string? deviceName = null, + string? certificateId = null, bool revokeExisting = false, string? p12Password = null, + CancellationToken cancellationToken = default) + { + var form = new MultipartFormDataContent + { + { Octet(ascPrivateKey), "asc-private-key", "AuthKey.p8" }, + { new StringContent(ascKeyId), "asc-key-id" }, + { new StringContent(ascIssuerId), "asc-issuer-id" }, + { new StringContent(bundleId), "bundleid" }, + { new StringContent(udid), "udid" }, + }; + if (!string.IsNullOrEmpty(bundleName)) form.Add(new StringContent(bundleName), "bundlename"); + if (!string.IsNullOrEmpty(profileName)) form.Add(new StringContent(profileName), "profilename"); + if (!string.IsNullOrEmpty(deviceName)) form.Add(new StringContent(deviceName), "devicename"); + if (!string.IsNullOrEmpty(certificateId)) form.Add(new StringContent(certificateId), "certificateId"); + if (revokeExisting) form.Add(new StringContent("true"), "revoke-existing"); + if (!string.IsNullOrEmpty(p12Password)) form.Add(new StringContent(p12Password), "p12password"); + + var req = _raw.NewRequest(HttpMethod.Post, "api/v1/sign/provision"); + req.Content = form; + return _raw.SendJsonAsync(req, cancellationToken); + } + + /// + /// Resign an uploaded app/IPA with a P12 identity and provisioning profile and + /// return the signed IPA bytes (POST /sign/app). + /// + public Task AppAsync( + byte[] ipa, byte[] p12File, byte[] profile, + string? p12Password = null, string? bundleId = null, + CancellationToken cancellationToken = default) + { + var form = new MultipartFormDataContent + { + { Octet(ipa), "ipa", "app.ipa" }, + { P12(p12File), "p12file", "signing.p12" }, + { Octet(profile), "profile", "profile.mobileprovision" }, + }; + if (!string.IsNullOrEmpty(p12Password)) form.Add(new StringContent(p12Password), "p12password"); + if (!string.IsNullOrEmpty(bundleId)) form.Add(new StringContent(bundleId), "bundleid"); + + var req = _raw.NewRequest(HttpMethod.Post, "api/v1/sign/app"); + req.Content = form; + req.Headers.Accept.ParseAdd("application/octet-stream"); + return _raw.SendBytesAsync(req, cancellationToken); + } + + private static ByteArrayContent Octet(byte[] bytes) + { + var c = new ByteArrayContent(bytes); + c.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream"); + return c; + } + + private static ByteArrayContent P12(byte[] bytes) + { + var c = new ByteArrayContent(bytes); + c.Headers.ContentType = new MediaTypeHeaderValue("application/x-pkcs12"); + return c; + } +} + +/// +/// Host-scoped device-preparation helpers (ios prepare ...). Obtained via +/// . The device-scoped preparation flow itself is +/// . +/// +public sealed class PrepareClient +{ + private readonly Gen.DefaultApi _api; + internal PrepareClient(Gen.DefaultApi api) => _api = api; + + /// + /// Generate a self-signed supervision identity and return the DER (base64) and + /// PEM for the certificate and private key (POST /prepare/create-cert). + /// + public Task CreateCertAsync(CancellationToken cancellationToken = default) + => _api.PrepareCreateCertAsync(cancellationToken); + + /// List the setup-pane skip options usable when preparing a device (GET /prepare/skip-options). + public Task SkipOptionsAsync(CancellationToken cancellationToken = default) + => _api.GetPrepareSkipOptionsAsync(cancellationToken); +} diff --git a/sdks/packages/csharp/src/GoIos.Sdk/IosClient.cs b/sdks/packages/csharp/src/GoIos.Sdk/IosClient.cs new file mode 100644 index 000000000..595841552 --- /dev/null +++ b/sdks/packages/csharp/src/GoIos.Sdk/IosClient.cs @@ -0,0 +1,139 @@ +using System.Net.Http; +using System.Net.Http.Headers; +using GoIos.Sdk; +using Gen = GoIos.Sdk.Generated.Api; +using GenClient = GoIos.Sdk.Generated.Client; +using GenModel = GoIos.Sdk.Generated.Model; + +namespace GoIos; + +/// +/// Entry point for the go-ios SDK. Construct once and reuse; it is thread-safe. +/// +/// +/// +/// var client = new IosClient(new IosClientOptions { BaseUrl = "http://localhost:60105", ApiKey = "secret" }); +/// var devices = await client.Devices.ListAsync(); +/// var info = await client.Device(udid).InfoAsync(); +/// await foreach (var e in client.Device(udid).SyslogAsync(ct)) { /* ... */ } +/// +/// +public sealed class IosClient : IDisposable +{ + private readonly HttpClient _http; + private readonly bool _ownsHttp; + private readonly Gen.DefaultApi _api; + private readonly RawHttp _raw; + + /// Device-collection operations (list all devices). + public DevicesClient Devices { get; } + + /// Global tunnel-agent operations. + public TunnelsClient Tunnels { get; } + + /// Host-scoped code-signing operations (App Store Connect). + public SignClient Sign { get; } + + /// Host-scoped device-preparation helpers (supervision cert / skip options). + public PrepareClient Prepare { get; } + + /// + /// Create a client that auto-resolves the go-ios REST daemon address via + /// GO_IOS_BASE_URL or local discovery (see ). + /// + public IosClient() : this(new IosClientOptions()) + { + } + + /// + /// Create a new client with the given options. + /// + /// + /// When is not set, the base URL is + /// resolved in this order: + /// + /// explicit (targets remote daemons; skips discovery); + /// the GO_IOS_BASE_URL environment variable; + /// discovery of a local daemon via <home>/rest-api.json. + /// + /// If none resolve, a is thrown. + /// + public IosClient(IosClientOptions options) + { + ArgumentNullException.ThrowIfNull(options); + + var baseUrl = new Uri(ResolveBaseUrl(options).TrimEnd('/') + "/", UriKind.Absolute); + var apiKey = options.ApiKey; + + if (options.HttpClient is not null) + { + _http = options.HttpClient; + _ownsHttp = false; + } + else + { + // No default timeout: streaming endpoints are long-lived. + _http = new HttpClient { Timeout = Timeout.InfiniteTimeSpan }; + _ownsHttp = true; + } + + var config = new GenClient.Configuration { BasePath = baseUrl.ToString().TrimEnd('/') }; + if (!string.IsNullOrEmpty(apiKey)) + { + // Send the bearer token explicitly so it does not depend on the + // generator's (nonstandard "Bearer" scheme) auth wiring. + config.DefaultHeaders["Authorization"] = "Bearer " + apiKey; + } + // Share the (possibly caller-supplied) HttpClient with the generated + // client so unary and streaming/binary calls go through one pipeline. + _api = new Gen.DefaultApi(_http, config); + _raw = new RawHttp(_http, baseUrl, apiKey); + + Devices = new DevicesClient(_api); + Tunnels = new TunnelsClient(_api); + Sign = new SignClient(_raw); + Prepare = new PrepareClient(_api); + } + + /// Scope subsequent operations to a single device by udid. + public DeviceClient Device(string udid) + { + if (string.IsNullOrWhiteSpace(udid)) + throw new ArgumentException("udid must be set", nameof(udid)); + return new DeviceClient(udid, _api, _raw); + } + + /// + /// Resolve the base URL: explicit option > GO_IOS_BASE_URL env > + /// local discovery. Throws when nothing + /// resolves. + /// + private static string ResolveBaseUrl(IosClientOptions options) + { + if (!string.IsNullOrWhiteSpace(options.BaseUrl)) + return options.BaseUrl!; + + var env = Environment.GetEnvironmentVariable("GO_IOS_BASE_URL"); + if (!string.IsNullOrWhiteSpace(env)) + return env; + + return Discovery.DiscoverBaseUrl(); + } + + /// + public void Dispose() + { + if (_ownsHttp) _http.Dispose(); + } +} + +/// Operations over the device collection. +public sealed class DevicesClient +{ + private readonly Gen.DefaultApi _api; + internal DevicesClient(Gen.DefaultApi api) => _api = api; + + /// List all attached / reachable devices. + public async Task ListAsync(CancellationToken cancellationToken = default) + => await _api.ListDevicesAsync(cancellationToken).ConfigureAwait(false); +} diff --git a/sdks/packages/csharp/src/GoIos.Sdk/IosClientOptions.cs b/sdks/packages/csharp/src/GoIos.Sdk/IosClientOptions.cs new file mode 100644 index 000000000..2228645ab --- /dev/null +++ b/sdks/packages/csharp/src/GoIos.Sdk/IosClientOptions.cs @@ -0,0 +1,34 @@ +using System.Net.Http; + +namespace GoIos; + +/// +/// Configuration for . +/// +public sealed class IosClientOptions +{ + /// + /// Base URL of the go-ios REST server, e.g. http://127.0.0.1:54321. + /// Optional: when unset (null/empty), the client resolves the address in this + /// order — the GO_IOS_BASE_URL environment variable, then discovery of a + /// local daemon via <home>/rest-api.json (see ). + /// Set this explicitly to target a remote daemon; it is then used verbatim and + /// discovery is skipped. + /// + public string? BaseUrl { get; set; } + + /// + /// Bearer token sent as Authorization: Bearer <ApiKey> on every + /// request. Optional (the server may be launched with --disable-auth), + /// but strongly encouraged and sent whenever set. + /// + public string? ApiKey { get; set; } + + /// + /// Optional caller-supplied used for both unary and + /// streaming (SSE) calls. When null, the SDK creates and owns one. + /// Note: streaming endpoints are long-lived; if you supply your own client, + /// do not set a short . + /// + public HttpClient? HttpClient { get; set; } +} diff --git a/sdks/packages/csharp/src/GoIos.Sdk/JobsClient.cs b/sdks/packages/csharp/src/GoIos.Sdk/JobsClient.cs new file mode 100644 index 000000000..13bf9ac9d --- /dev/null +++ b/sdks/packages/csharp/src/GoIos.Sdk/JobsClient.cs @@ -0,0 +1,109 @@ +using System.Net.Http; +using System.Runtime.CompilerServices; +using GoIos.Sdk; +using Gen = GoIos.Sdk.Generated.Api; +using GenModel = GoIos.Sdk.Generated.Model; + +namespace GoIos; + +/// +/// Background-job operations (runtest / runwda / port-forward) for a single +/// device. Jobs are device-scoped in the daemon +/// (/api/v1/device/{udid}/jobs/...); obtain this via +/// . +/// +public sealed class JobsClient +{ + private readonly string _udid; + private readonly Gen.DefaultApi _api; + private readonly RawHttp _raw; + + internal JobsClient(string udid, Gen.DefaultApi api, RawHttp raw) + { + _udid = udid; + _api = api; + _raw = raw; + } + + /// Start an XCUITest run as a background job (POST /jobs/runtest). + public Task RuntestAsync( + GenModel.RunTestRequest request, CancellationToken cancellationToken = default) + => _api.DevicesStartRunTestAsync(_udid, request, cancellationToken); + + /// Start WebDriverAgent as a background job (POST /jobs/runwda). + public Task RunwdaAsync( + GenModel.RunTestRequest? request = null, CancellationToken cancellationToken = default) + => _api.DevicesStartRunWdaAsync(_udid, request, cancellationToken); + + /// Start a host↔device TCP port-forward as a background job (POST /jobs/forward). + public Task ForwardAsync( + int hostPort, int targetPort, CancellationToken cancellationToken = default) + => _api.DevicesStartForwardAsync(_udid, new GenModel.ForwardRequest(hostPort, targetPort), cancellationToken); + + /// List background jobs for this device (GET /jobs). + public Task> ListAsync(CancellationToken cancellationToken = default) + => _api.DevicesListJobsAsync(_udid, cancellationToken); + + /// Get a single job by id (GET /jobs/{id}). + public Task GetAsync(string id, CancellationToken cancellationToken = default) + => _api.DevicesGetJobAsync(_udid, id, cancellationToken); + + /// Stop / delete a job by id (DELETE /jobs/{id}). + public Task DeleteAsync(string id, CancellationToken cancellationToken = default) + => _api.DevicesStopJobAsync(_udid, id, cancellationToken); + + /// + /// Stream a job's log output (GET /jobs/{id}/logs) as typed events. + /// Log lines are surfaced as ; keep-alives as + /// . + /// + public IAsyncEnumerable LogsAsync(string id, CancellationToken cancellationToken = default) + => StreamAsync($"api/v1/device/{Esc(_udid)}/jobs/{Esc(id)}/logs", JobLogsFactory, cancellationToken); + + private static SseEvent? JobLogsFactory(string name, string data) => name switch + { + "log" => SseReader.Deserialize(data), + _ => null, + }; + + private async IAsyncEnumerable StreamAsync( + string path, SseEventFactory factory, + [EnumeratorCancellation] CancellationToken cancellationToken) + { + using var req = _raw.NewRequest(HttpMethod.Get, path); + req.Headers.Accept.ParseAdd("text/event-stream"); + using var resp = await _raw.Http + .SendAsync(req, HttpCompletionOption.ResponseHeadersRead, cancellationToken) + .ConfigureAwait(false); + await RawHttp.EnsureSuccessAsync(resp, cancellationToken).ConfigureAwait(false); + + await using var stream = await resp.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + await foreach (var e in SseReader.ReadAsync(stream, factory, cancellationToken).ConfigureAwait(false)) + yield return e; + } + + private static string Esc(string s) => Uri.EscapeDataString(s); +} + +/// Global CoreDevice / RemoteXPC tunnel-agent operations. Obtained via . +public sealed class TunnelsClient +{ + private readonly Gen.DefaultApi _api; + internal TunnelsClient(Gen.DefaultApi api) => _api = api; + + /// List active tunnels (GET /tunnels). + public Task> ListAsync(CancellationToken cancellationToken = default) + => _api.ListTunnelsAsync(cancellationToken); + + /// Stop a tunnel for a device (DELETE /tunnels/{udid}). + public Task DeleteAsync(string udid, CancellationToken cancellationToken = default) + => _api.StopTunnelAsync(udid, cancellationToken); + + /// Refresh (re-establish) a device's tunnel (POST /tunnels/{udid}/refresh). + public Task RefreshAsync(string udid, CancellationToken cancellationToken = default) + => _api.RefreshTunnelAsync(udid, cancellationToken); + + /// Shut down the whole tunnel agent (POST /tunnel-agent/shutdown). + public Task ShutdownAgentAsync(CancellationToken cancellationToken = default) + => _api.ShutdownTunnelAgentAsync(cancellationToken); +} diff --git a/sdks/packages/csharp/src/GoIos.Sdk/JsonHelpers.cs b/sdks/packages/csharp/src/GoIos.Sdk/JsonHelpers.cs new file mode 100644 index 000000000..90d68e194 --- /dev/null +++ b/sdks/packages/csharp/src/GoIos.Sdk/JsonHelpers.cs @@ -0,0 +1,21 @@ +using System.Text.Json; + +namespace GoIos.Sdk; + +/// +/// Shared normalization helpers for endpoints whose response is an open, +/// schema-less JSON object (the generated client surfaces these as +/// ). Returns a plain string-keyed dictionary. +/// +internal static class JsonHelpers +{ + /// Normalize an arbitrary generated/Newtonsoft-parsed value into a dictionary. + public static IReadOnlyDictionary ToDictionary(object? raw) + { + if (raw is null) return new Dictionary(); + var json = raw is string s ? s : Newtonsoft.Json.JsonConvert.SerializeObject(raw); + if (string.IsNullOrWhiteSpace(json)) return new Dictionary(); + var dict = JsonSerializer.Deserialize>(json, JsonOptions.Default); + return dict ?? new Dictionary(); + } +} diff --git a/sdks/packages/csharp/src/GoIos.Sdk/RawHttp.cs b/sdks/packages/csharp/src/GoIos.Sdk/RawHttp.cs new file mode 100644 index 000000000..131673529 --- /dev/null +++ b/sdks/packages/csharp/src/GoIos.Sdk/RawHttp.cs @@ -0,0 +1,194 @@ +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using GoIos; + +namespace GoIos.Sdk; + +/// +/// Internal helper wrapping the used for endpoints the +/// generated JSON client cannot handle well: binary bodies (screenshot, image +/// mount), multipart uploads (app install, supervised pairing), and long-lived +/// SSE streams. Applies bearer auth and normalizes error responses. +/// +internal sealed class RawHttp +{ + private readonly HttpClient _http; + private readonly Uri _baseUrl; + private readonly string? _apiKey; + + public RawHttp(HttpClient http, Uri baseUrl, string? apiKey) + { + _http = http; + _baseUrl = baseUrl; + _apiKey = apiKey; + } + + public HttpClient Http => _http; + + public HttpRequestMessage NewRequest(HttpMethod method, string relativePath) + { + var req = new HttpRequestMessage(method, new Uri(_baseUrl, relativePath)); + if (!string.IsNullOrEmpty(_apiKey)) + req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", _apiKey); + return req; + } + + public async Task GetBytesAsync(string path, string accept, CancellationToken ct) + { + using var req = NewRequest(HttpMethod.Get, path); + req.Headers.Accept.ParseAdd(accept); + using var resp = await _http.SendAsync(req, HttpCompletionOption.ResponseHeadersRead, ct).ConfigureAwait(false); + await EnsureSuccessAsync(resp, ct).ConfigureAwait(false); + return await resp.Content.ReadAsByteArrayAsync(ct).ConfigureAwait(false); + } + + /// + /// Open a raw binary stream (NOT SSE): sends the request with + /// and returns the live + /// response of bytes. The returned + /// owns the request/response and must be disposed to release the connection. + /// + public async Task OpenBinaryStreamAsync(HttpRequestMessage req, string? accept, CancellationToken ct) + { + if (!string.IsNullOrEmpty(accept)) req.Headers.Accept.ParseAdd(accept); + var resp = await _http.SendAsync(req, HttpCompletionOption.ResponseHeadersRead, ct).ConfigureAwait(false); + try + { + await EnsureSuccessAsync(resp, ct).ConfigureAwait(false); +#if NET5_0_OR_GREATER + var stream = await resp.Content.ReadAsStreamAsync(ct).ConfigureAwait(false); +#else + var stream = await resp.Content.ReadAsStreamAsync().ConfigureAwait(false); +#endif + return new BinaryStream(stream, resp, req, resp.Content.Headers.ContentType?.MediaType); + } + catch + { + resp.Dispose(); + req.Dispose(); + throw; + } + } + + /// Send a request whose response body is raw bytes (e.g. octet-stream file pull). + public async Task SendBytesAsync(HttpRequestMessage req, CancellationToken ct) + { + using (req) + { + using var resp = await _http.SendAsync(req, HttpCompletionOption.ResponseHeadersRead, ct).ConfigureAwait(false); + await EnsureSuccessAsync(resp, ct).ConfigureAwait(false); + return await resp.Content.ReadAsByteArrayAsync(ct).ConfigureAwait(false); + } + } + + /// Send a request expecting no meaningful body; returns the (possibly empty) text. + public async Task SendTextAsync(HttpRequestMessage req, CancellationToken ct) + { + using (req) + { + using var resp = await _http.SendAsync(req, ct).ConfigureAwait(false); + await EnsureSuccessAsync(resp, ct).ConfigureAwait(false); + return await resp.Content.ReadAsStringAsync(ct).ConfigureAwait(false); + } + } + + public async Task SendJsonAsync(HttpRequestMessage req, CancellationToken ct) + { + using (req) + { + using var resp = await _http.SendAsync(req, ct).ConfigureAwait(false); + await EnsureSuccessAsync(resp, ct).ConfigureAwait(false); +#if NET5_0_OR_GREATER + await using var s = await resp.Content.ReadAsStreamAsync(ct).ConfigureAwait(false); +#else + using var s = await resp.Content.ReadAsStreamAsync().ConfigureAwait(false); +#endif + var value = await JsonSerializer.DeserializeAsync(s, JsonOptions.Default, ct).ConfigureAwait(false); + return value!; + } + } + + public static async Task EnsureSuccessAsync(HttpResponseMessage resp, CancellationToken ct) + { + if (resp.IsSuccessStatusCode) return; + string body = ""; + try { body = await resp.Content.ReadAsStringAsync(ct).ConfigureAwait(false); } catch { /* ignore */ } + throw new IosApiException((int)resp.StatusCode, resp.ReasonPhrase, body); + } +} + +/// +/// A live read-only of raw response bytes returned by a +/// binary streaming endpoint (pcap, UI video, MJPEG screenshot stream). It is a +/// pass-through over the HTTP response body: reads pull bytes off the socket as +/// they arrive and honor the passed to the +/// originating call. Disposing it releases the underlying HTTP connection. +/// +public sealed class BinaryStream : Stream +{ + private readonly Stream _inner; + private readonly HttpResponseMessage _response; + private readonly HttpRequestMessage _request; + + /// The response Content-Type (e.g. application/vnd.tcpdump.pcap, multipart/x-mixed-replace), if any. + public string? ContentType { get; } + + internal BinaryStream(Stream inner, HttpResponseMessage response, HttpRequestMessage request, string? contentType) + { + _inner = inner; + _response = response; + _request = request; + ContentType = contentType; + } + + /// + public override bool CanRead => true; + /// + public override bool CanSeek => false; + /// + public override bool CanWrite => false; + /// + public override long Length => throw new NotSupportedException(); + /// + public override long Position { get => throw new NotSupportedException(); set => throw new NotSupportedException(); } + + /// + public override int Read(byte[] buffer, int offset, int count) => _inner.Read(buffer, offset, count); + /// + public override Task ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) + => _inner.ReadAsync(buffer, offset, count, cancellationToken); + /// + public override ValueTask ReadAsync(Memory buffer, CancellationToken cancellationToken = default) + => _inner.ReadAsync(buffer, cancellationToken); + + /// + public override void Flush() { } + /// + public override long Seek(long offset, SeekOrigin origin) => throw new NotSupportedException(); + /// + public override void SetLength(long value) => throw new NotSupportedException(); + /// + public override void Write(byte[] buffer, int offset, int count) => throw new NotSupportedException(); + + /// + protected override void Dispose(bool disposing) + { + if (disposing) + { + _inner.Dispose(); + _response.Dispose(); + _request.Dispose(); + } + base.Dispose(disposing); + } + + /// + public override async ValueTask DisposeAsync() + { + await _inner.DisposeAsync().ConfigureAwait(false); + _response.Dispose(); + _request.Dispose(); + await base.DisposeAsync().ConfigureAwait(false); + } +} diff --git a/sdks/packages/csharp/src/GoIos.Sdk/SseReader.cs b/sdks/packages/csharp/src/GoIos.Sdk/SseReader.cs new file mode 100644 index 000000000..4a1cc793d --- /dev/null +++ b/sdks/packages/csharp/src/GoIos.Sdk/SseReader.cs @@ -0,0 +1,155 @@ +using System.Runtime.CompilerServices; +using System.Text; +using System.Text.Json; + +namespace GoIos.Sdk; + +/// +/// Maps an SSE event: name plus its raw data: JSON to a typed +/// . Return null to fall through to the reader's +/// unknown-event handling. +/// +public delegate SseEvent? SseEventFactory(string eventName, string data); + +/// +/// A reusable, allocation-light parser for the go-ios Server-Sent Events wire +/// contract. Each frame is: +/// +/// event: <name>\n +/// data: <compact-json>\n +/// \n +/// +/// The reader tolerates split reads (a frame arriving across multiple chunks), +/// multiple frames per chunk, CRLF or LF line endings, and multi-line +/// data: fields (joined with \n per the SSE spec). Comment lines +/// (starting with :) are ignored. +/// +public static class SseReader +{ + /// + /// Reads an event stream and yields typed events. Heartbeats are surfaced as + /// ; frames whose event: name the + /// does not recognize are surfaced as + /// . + /// + public static async IAsyncEnumerable ReadAsync( + Stream stream, + SseEventFactory factory, + [EnumeratorCancellation] CancellationToken cancellationToken = default) + { + using var reader = new StreamReader(stream, Encoding.UTF8, detectEncodingFromByteOrderMarks: false); + + string? eventName = null; + var data = new StringBuilder(); + bool sawData = false; + + while (!cancellationToken.IsCancellationRequested) + { + string? line; + try + { + line = await reader.ReadLineAsync(cancellationToken).ConfigureAwait(false); + } + catch (OperationCanceledException) + { + yield break; + } + + if (line is null) + { + // End of stream. Flush a trailing frame that had no blank-line terminator. + if (eventName is not null || sawData) + { + var evt = Dispatch(factory, eventName, data.ToString()); + if (evt is not null) yield return evt; + } + yield break; + } + + if (line.Length == 0) + { + // Blank line: dispatch the accumulated frame (if any). + if (eventName is not null || sawData) + { + var evt = Dispatch(factory, eventName, data.ToString()); + if (evt is not null) yield return evt; + } + eventName = null; + data.Clear(); + sawData = false; + continue; + } + + if (line[0] == ':') + { + // SSE comment / keep-alive colon line — ignore. + continue; + } + + var colon = line.IndexOf(':'); + string field, value; + if (colon < 0) + { + field = line; + value = ""; + } + else + { + field = line.Substring(0, colon); + value = line.Substring(colon + 1); + if (value.StartsWith(' ')) value = value.Substring(1); // strip one leading space + } + + switch (field) + { + case "event": + eventName = value; + break; + case "data": + if (sawData) data.Append('\n'); + data.Append(value); + sawData = true; + break; + // "id" and "retry" are part of SSE but unused by this contract. + default: + break; + } + } + } + + private static SseEvent? Dispatch(SseEventFactory factory, string? eventName, string data) + { + var name = eventName ?? "message"; + + if (name == "heartbeat") + return new HeartbeatEvent { EventName = name }; + + var typed = factory(name, data); + if (typed is not null) + return typed with { EventName = name }; + + return new UnknownEvent { EventName = name, RawData = data }; + } + + /// + /// Helper for factories: deserialize to + /// using the SDK's JSON options, tolerating empty + /// payloads (returns a default-constructed instance). + /// + public static T Deserialize(string data) where T : new() + { + if (string.IsNullOrWhiteSpace(data)) + return new T(); + return JsonSerializer.Deserialize(data, JsonOptions.Default) ?? new T(); + } +} + +/// Shared System.Text.Json options for SSE payload deserialization. +internal static class JsonOptions +{ + public static readonly JsonSerializerOptions Default = new() + { + PropertyNameCaseInsensitive = true, + NumberHandling = System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString, + }; +} diff --git a/sdks/packages/csharp/src/GoIos.Sdk/WdaClient.cs b/sdks/packages/csharp/src/GoIos.Sdk/WdaClient.cs new file mode 100644 index 000000000..fa9452a75 --- /dev/null +++ b/sdks/packages/csharp/src/GoIos.Sdk/WdaClient.cs @@ -0,0 +1,32 @@ +using Gen = GoIos.Sdk.Generated.Api; +using GenModel = GoIos.Sdk.Generated.Model; + +namespace GoIos; + +/// WebDriverAgent (XCUITest) session operations for a single device. +public sealed class WdaClient +{ + private readonly string _udid; + private readonly Gen.DefaultApi _api; + + internal WdaClient(string udid, Gen.DefaultApi api) + { + _udid = udid; + _api = api; + } + + /// Start a new WebDriverAgent (XCUITest) runner session. + public Task CreateSessionAsync( + GenModel.WdaConfig config, CancellationToken cancellationToken = default) + => _api.DevicesCreateWdaSessionAsync(_udid, config, cancellationToken); + + /// Read a running WebDriverAgent session by id. + public Task ReadSessionAsync( + string sessionId, CancellationToken cancellationToken = default) + => _api.DevicesGetWdaSessionAsync(_udid, sessionId, cancellationToken); + + /// Stop and delete a running WebDriverAgent session by id. + public Task DeleteSessionAsync( + string sessionId, CancellationToken cancellationToken = default) + => _api.DevicesDeleteWdaSessionAsync(_udid, sessionId, cancellationToken); +} diff --git a/sdks/packages/csharp/tests/GoIos.Sdk.Tests/DiscoveryTests.cs b/sdks/packages/csharp/tests/GoIos.Sdk.Tests/DiscoveryTests.cs new file mode 100644 index 000000000..8cdc92d22 --- /dev/null +++ b/sdks/packages/csharp/tests/GoIos.Sdk.Tests/DiscoveryTests.cs @@ -0,0 +1,145 @@ +using System.Net; +using System.Net.Http; +using GoIos; +using Xunit; + +namespace GoIos.Sdk.Tests; + +/// +/// Tests for ephemeral-daemon discovery. These mutate process-wide environment +/// variables (GO_IOS_HOME / GO_IOS_BASE_URL), so they run in a +/// dedicated non-parallel collection and restore the environment afterwards. +/// +[Collection("discovery-env")] +public sealed class DiscoveryTests : IDisposable +{ + private readonly string? _origHome = Environment.GetEnvironmentVariable("GO_IOS_HOME"); + private readonly string? _origBaseUrl = Environment.GetEnvironmentVariable("GO_IOS_BASE_URL"); + private readonly string _tempHome; + + public DiscoveryTests() + { + _tempHome = Path.Combine(Path.GetTempPath(), "goios-discovery-" + Guid.NewGuid().ToString("N")); + Directory.CreateDirectory(_tempHome); + Environment.SetEnvironmentVariable("GO_IOS_HOME", _tempHome); + Environment.SetEnvironmentVariable("GO_IOS_BASE_URL", null); + } + + public void Dispose() + { + Environment.SetEnvironmentVariable("GO_IOS_HOME", _origHome); + Environment.SetEnvironmentVariable("GO_IOS_BASE_URL", _origBaseUrl); + try { Directory.Delete(_tempHome, recursive: true); } catch { /* best effort */ } + } + + private void WriteDiscoveryFile(string baseUrl) + { + var json = $"{{\"baseUrl\":\"{baseUrl}\",\"host\":\"127.0.0.1\",\"port\":54321,\"pid\":12345,\"startedAt\":\"2026-08-11T15:00:00Z\",\"tls\":false}}"; + File.WriteAllText(Path.Combine(_tempHome, Discovery.DiscoveryFileName), json); + } + + private static (IosClient client, StubHttpMessageHandler handler) ClientWith(IosClientOptions options) + { + var handler = StubHttpMessageHandler.Json("{\"deviceList\":[]}"); + options.HttpClient = new HttpClient(handler) { Timeout = Timeout.InfiniteTimeSpan }; + return (new IosClient(options), handler); + } + + [Fact] + public void Discovery_HomeDirectory_Uses_GoIosHome_Env() + { + Assert.Equal(_tempHome, Discovery.HomeDirectory()); + Assert.Equal(Path.Combine(_tempHome, "rest-api.json"), Discovery.DiscoveryFilePath()); + } + + [Fact] + public async Task NoBaseUrl_Uses_Discovered_BaseUrl() + { + WriteDiscoveryFile("http://127.0.0.1:54321"); + var (client, handler) = ClientWith(new IosClientOptions()); + using (client) + { + await client.Devices.ListAsync(); + } + + var req = Assert.Single(handler.Requests); + Assert.Equal("127.0.0.1", req.RequestUri!.Host); + Assert.Equal(54321, req.RequestUri!.Port); + } + + [Fact] + public void Parameterless_Constructor_Uses_Discovery() + { + WriteDiscoveryFile("http://127.0.0.1:54321"); + // The parameterless ctor owns its HttpClient; constructing without an + // exception proves the discovered address resolved. + using var client = new IosClient(); + Assert.NotNull(client); + } + + [Fact] + public async Task Explicit_BaseUrl_Overrides_Discovery_And_Env() + { + WriteDiscoveryFile("http://127.0.0.1:54321"); + Environment.SetEnvironmentVariable("GO_IOS_BASE_URL", "http://127.0.0.1:11111"); + + var (client, handler) = ClientWith(new IosClientOptions { BaseUrl = "http://127.0.0.1:22222" }); + using (client) + { + await client.Devices.ListAsync(); + } + + var req = Assert.Single(handler.Requests); + Assert.Equal(22222, req.RequestUri!.Port); + } + + [Fact] + public async Task GoIosBaseUrl_Env_Overrides_Discovery() + { + WriteDiscoveryFile("http://127.0.0.1:54321"); + Environment.SetEnvironmentVariable("GO_IOS_BASE_URL", "http://127.0.0.1:33333"); + + var (client, handler) = ClientWith(new IosClientOptions()); + using (client) + { + await client.Devices.ListAsync(); + } + + var req = Assert.Single(handler.Requests); + Assert.Equal(33333, req.RequestUri!.Port); + } + + [Fact] + public void Missing_Discovery_File_Throws_Clear_Exception() + { + // No file written, no env set. + var ex = Assert.Throws(() => new IosClient(new IosClientOptions())); + Assert.Contains("no local go-ios REST daemon found", ex.Message); + Assert.Contains(Discovery.DiscoveryFilePath(), ex.Message); + Assert.Contains("BaseUrl", ex.Message); + } + + [Fact] + public void Malformed_Discovery_File_Throws_Clear_Exception() + { + File.WriteAllText(Path.Combine(_tempHome, Discovery.DiscoveryFileName), "{ not json"); + var ex = Assert.Throws(() => Discovery.DiscoverBaseUrl()); + Assert.Contains("no local go-ios REST daemon found", ex.Message); + } + + [Fact] + public void Discovery_File_Without_BaseUrl_Throws() + { + File.WriteAllText(Path.Combine(_tempHome, Discovery.DiscoveryFileName), "{\"port\":54321}"); + Assert.Throws(() => Discovery.DiscoverBaseUrl()); + } +} + +/// +/// Serializes discovery tests (which mutate process env) so they don't race the +/// rest of the suite. +/// +[CollectionDefinition("discovery-env", DisableParallelization = true)] +public sealed class DiscoveryEnvCollection +{ +} diff --git a/sdks/packages/csharp/tests/GoIos.Sdk.Tests/ExtendedFacadeTests.cs b/sdks/packages/csharp/tests/GoIos.Sdk.Tests/ExtendedFacadeTests.cs new file mode 100644 index 000000000..eb1479c2c --- /dev/null +++ b/sdks/packages/csharp/tests/GoIos.Sdk.Tests/ExtendedFacadeTests.cs @@ -0,0 +1,347 @@ +using System.Net; +using System.Net.Http; +using GoIos; +using Xunit; + +namespace GoIos.Sdk.Tests; + +/// Tests for the endpoints added to reach the full 80-op daemon surface. +public class ExtendedFacadeTests +{ + private static IosClient ClientWith(HttpMessageHandler handler, string? apiKey = "secret") + { + var http = new HttpClient(handler) { Timeout = Timeout.InfiniteTimeSpan }; + return new IosClient(new IosClientOptions + { + BaseUrl = "http://localhost:60105", + ApiKey = apiKey, + HttpClient = http, + }); + } + + // --- Device information ------------------------------------------------- + + [Fact] + public async Task Battery_Deserializes() + { + var handler = StubHttpMessageHandler.Json( + "{\"CurrentCapacity\":83,\"ExternalConnected\":true,\"IsCharging\":true,\"Temperature\":2980}"); + using var client = ClientWith(handler); + + var battery = await client.Device("udid1").BatteryAsync(); + + Assert.Equal(83, battery.CurrentCapacity); + Assert.True(battery.IsCharging); + var req = Assert.Single(handler.Requests); + Assert.EndsWith("/battery", req.RequestUri!.AbsolutePath); + } + + [Fact] + public async Task MobileGestalt_Sends_Comma_Joined_Keys() + { + var handler = StubHttpMessageHandler.Json("{\"ProductType\":\"iPhone14,2\",\"UniqueDeviceID\":\"abc\"}"); + using var client = ClientWith(handler); + + var map = await client.Device("udid1").MobileGestaltAsync(new[] { "ProductType", "UniqueDeviceID" }); + + Assert.Equal("iPhone14,2", map["ProductType"]?.ToString()); + var req = Assert.Single(handler.Requests); + // explode=false array -> single "key=" param with comma-joined values. + Assert.Contains("key=ProductType%2CUniqueDeviceID", req.RequestUri!.Query); + } + + // --- Management --------------------------------------------------------- + + [Fact] + public async Task Erase_Requires_Confirm_Query() + { + var handler = StubHttpMessageHandler.Json("{\"message\":\"erasing\"}"); + using var client = ClientWith(handler); + + await client.Device("udid1").EraseAsync(confirm: true); + + var req = Assert.Single(handler.Requests); + Assert.Equal(HttpMethod.Post, req.Method); + Assert.EndsWith("/erase", req.RequestUri!.AbsolutePath); + Assert.Contains("confirm=true", req.RequestUri!.Query); + } + + [Fact] + public async Task Reboot_Posts_To_Reboot() + { + var handler = StubHttpMessageHandler.Json("{\"message\":\"ok\"}"); + using var client = ClientWith(handler); + + await client.Device("udid1").RebootAsync(); + + var req = Assert.Single(handler.Requests); + Assert.Equal(HttpMethod.Post, req.Method); + Assert.EndsWith("/reboot", req.RequestUri!.AbsolutePath); + } + + // --- Settings ----------------------------------------------------------- + + [Fact] + public async Task Settings_SetWifi_Puts_Json_Body() + { + string? body = null; + var handler = new StubHttpMessageHandler(req => + { + body = req.Content?.ReadAsStringAsync().GetAwaiter().GetResult(); + return new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new StringContent("{\"message\":\"ok\"}", System.Text.Encoding.UTF8, "application/json"), + }; + }); + using var client = ClientWith(handler); + + await client.Device("udid1").Settings.SetWifiAsync("MyNet", "hunter2", "WPA2"); + + var req = Assert.Single(handler.Requests); + Assert.Equal(HttpMethod.Put, req.Method); + Assert.EndsWith("/wifi", req.RequestUri!.AbsolutePath); + Assert.Contains("MyNet", body); + Assert.Contains("hunter2", body); + } + + [Fact] + public async Task Settings_RemoveWifi_Sends_Ssid_Query() + { + var handler = StubHttpMessageHandler.Json("{\"message\":\"ok\"}"); + using var client = ClientWith(handler); + + await client.Device("udid1").Settings.RemoveWifiAsync("MyNet"); + + var req = Assert.Single(handler.Requests); + Assert.Equal(HttpMethod.Delete, req.Method); + Assert.Contains("ssid=MyNet", req.RequestUri!.Query); + } + + // --- Media (pasteboard text/plain + multipart wallpaper) --------------- + + [Fact] + public async Task Media_SetPasteboard_Sends_Text_Plain() + { + string? contentType = null; + string? body = null; + var handler = new StubHttpMessageHandler(req => + { + contentType = req.Content?.Headers.ContentType?.MediaType; + body = req.Content?.ReadAsStringAsync().GetAwaiter().GetResult(); + return new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new StringContent("{\"message\":\"ok\"}", System.Text.Encoding.UTF8, "application/json"), + }; + }); + using var client = ClientWith(handler); + + await client.Device("udid1").Media.SetPasteboardAsync("copied text"); + + var req = Assert.Single(handler.Requests); + Assert.Equal(HttpMethod.Put, req.Method); + Assert.EndsWith("/pasteboard", req.RequestUri!.AbsolutePath); + Assert.Equal("text/plain", contentType); + Assert.Equal("copied text", body); + } + + // --- Files (raw binary pull) ------------------------------------------- + + [Fact] + public async Task Files_Pull_Returns_Raw_Bytes_With_Domain_Query() + { + var payload = new byte[] { 1, 2, 3, 4, 5 }; + var handler = new StubHttpMessageHandler(_ => + new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new ByteArrayContent(payload) + { + Headers = { ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream") }, + }, + }); + using var client = ClientWith(handler); + + var bytes = await client.Device("udid1").Files.PullAsync( + domain: "appDocuments", remote: "Documents/log.txt", identifier: "com.example.app"); + + Assert.Equal(payload, bytes); + var req = Assert.Single(handler.Requests); + Assert.EndsWith("/files/pull", req.RequestUri!.AbsolutePath); + var q = req.RequestUri!.Query; + Assert.Contains("domain=appDocuments", q); + Assert.Contains("identifier=com.example.app", q); + Assert.Contains("remote=Documents%2Flog.txt", q); + } + + // --- Crashes ------------------------------------------------------------ + + [Fact] + public async Task Crashes_List_Deserializes_And_Sends_Pattern() + { + var handler = StubHttpMessageHandler.Json("{\"files\":[\"a.ips\",\"b.ips\"],\"count\":2}"); + using var client = ClientWith(handler); + + var listing = await client.Device("udid1").Crashes.ListAsync("*.ips"); + + Assert.Equal(2, listing.Count); + Assert.Equal(new[] { "a.ips", "b.ips" }, listing.Files); + var req = Assert.Single(handler.Requests); + Assert.Contains("pattern=", req.RequestUri!.Query); + } + + [Fact] + public async Task Crashes_Remove_Sends_Pattern_And_Defaults_Cwd_To_Dot() + { + var handler = StubHttpMessageHandler.Json("{\"message\":\"removed\"}"); + using var client = ClientWith(handler); + + // pattern is primary/required; cwd defaults to ".". + await client.Device("udid1").Crashes.RemoveAsync("*.ips"); + + var req = Assert.Single(handler.Requests); + Assert.Contains("pattern=", req.RequestUri!.Query); + Assert.Contains("cwd=.", req.RequestUri!.Query); + } + + [Fact] + public async Task Crashes_Remove_Sends_Explicit_Cwd() + { + var handler = StubHttpMessageHandler.Json("{\"message\":\"removed\"}"); + using var client = ClientWith(handler); + + await client.Device("udid1").Crashes.RemoveAsync("*.ips", cwd: "/tmp/crashes"); + + var req = Assert.Single(handler.Requests); + Assert.Contains("pattern=", req.RequestUri!.Query); + Assert.Contains("cwd=", req.RequestUri!.Query); + } + + // --- Jobs (unary) ------------------------------------------------------- + + [Fact] + public async Task Jobs_Forward_Posts_Job_And_Deserializes() + { + var handler = new StubHttpMessageHandler(_ => + new HttpResponseMessage(HttpStatusCode.Accepted) + { + Content = new StringContent( + "{\"id\":\"forward-1\",\"kind\":\"forward\",\"udid\":\"udid1\",\"status\":\"running\",\"startedAt\":\"2024-01-01T00:00:00Z\"}", + System.Text.Encoding.UTF8, "application/json"), + }); + using var client = ClientWith(handler); + + var job = await client.Device("udid1").Jobs.ForwardAsync(hostPort: 8100, targetPort: 8100); + + Assert.Equal("forward-1", job.Id); + Assert.Equal("forward", job.Kind); + var req = Assert.Single(handler.Requests); + Assert.Equal(HttpMethod.Post, req.Method); + Assert.EndsWith("/jobs/forward", req.RequestUri!.AbsolutePath); + } + + // --- Tunnels ------------------------------------------------------------ + + [Fact] + public async Task Tunnels_List_Deserializes() + { + var handler = StubHttpMessageHandler.Json( + "[{\"Udid\":\"udid1\",\"Address\":\"fd00::1\",\"RsdPort\":50000,\"UserspaceTUN\":false,\"UserspaceTUNPort\":0}]"); + using var client = ClientWith(handler); + + var tunnels = await client.Tunnels.ListAsync(); + + var t = Assert.Single(tunnels); + Assert.Equal("udid1", t.Udid); + Assert.Equal(50000, t.RsdPort); + var req = Assert.Single(handler.Requests); + Assert.EndsWith("/tunnels", req.RequestUri!.AbsolutePath); + } + + [Fact] + public async Task Tunnels_ShutdownAgent_Posts() + { + var handler = StubHttpMessageHandler.Json("{\"status\":\"shutting-down\"}"); + using var client = ClientWith(handler); + + var res = await client.Tunnels.ShutdownAgentAsync(); + + Assert.Equal("shutting-down", res.Status); + var req = Assert.Single(handler.Requests); + Assert.Equal(HttpMethod.Post, req.Method); + Assert.EndsWith("/tunnel-agent/shutdown", req.RequestUri!.AbsolutePath); + } + + // --- New SSE stream #1: sysmontap -------------------------------------- + + [Fact] + public async Task Sysmontap_Streams_Typed_Samples_And_Heartbeats() + { + var wire = + "event: sample\ndata: {\"CPU_TotalLoad\":42.5,\"SystemLoad\":10.0,\"UserLoad\":32.5,\"nCPU\":6}\n\n" + + "event: heartbeat\ndata: {}\n\n" + + "event: sample\ndata: {\"CPU_TotalLoad\":11.0}\n\n"; + var handler = new StubHttpMessageHandler(_ => + new HttpResponseMessage(HttpStatusCode.OK) { Content = new ChunkedContent(new[] { wire }) }); + using var client = ClientWith(handler); + + var loads = new List(); + var heartbeats = 0; + object? extraValue = null; + await foreach (var e in client.Device("udid1").SysmontapAsync()) + { + switch (e) + { + case CpuUsageSampleEvent s: + loads.Add(s.CpuTotalLoad); + extraValue ??= s.Extra != null && s.Extra.TryGetValue("nCPU", out var v) ? v : null; + break; + case HeartbeatEvent: heartbeats++; break; + } + } + + Assert.Equal(new double?[] { 42.5, 11.0 }, loads); + Assert.Equal(1, heartbeats); + Assert.NotNull(extraValue); // open-map extension keys preserved + var req = Assert.Single(handler.Requests); + Assert.EndsWith("/sysmontap", req.RequestUri!.AbsolutePath); + Assert.Contains("text/event-stream", req.Headers.Accept.ToString()); + } + + // --- New SSE stream #2: job logs --------------------------------------- + + [Fact] + public async Task Jobs_Logs_Streams_Typed_Lines_And_Heartbeats() + { + var wire = + "event: log\ndata: {\"line\":\"Test suite started\"}\n\n" + + "event: heartbeat\ndata: {}\n\n" + + "event: log\ndata: {\"line\":\"Test suite passed\"}\n\n"; + var handler = new StubHttpMessageHandler(_ => + new HttpResponseMessage(HttpStatusCode.OK) { Content = new ChunkedContent(new[] { wire }) }); + using var client = ClientWith(handler); + + var lines = new List(); + var heartbeats = 0; + await foreach (var e in client.Device("udid1").Jobs.LogsAsync("runtest-3")) + { + switch (e) + { + case JobLogLineEvent l: lines.Add(l.Line); break; + case HeartbeatEvent: heartbeats++; break; + } + } + + Assert.Equal(new[] { "Test suite started", "Test suite passed" }, lines); + Assert.Equal(1, heartbeats); + var req = Assert.Single(handler.Requests); + Assert.EndsWith("/jobs/runtest-3/logs", req.RequestUri!.AbsolutePath); + } + + // --- udid convenience accessor ----------------------------------------- + + [Fact] + public void Device_Exposes_Udid_Accessor() + { + using var client = ClientWith(StubHttpMessageHandler.Json("{}")); + Assert.Equal("00008110-ABC", client.Device("00008110-ABC").Udid); + } +} diff --git a/sdks/packages/csharp/tests/GoIos.Sdk.Tests/FacadeTests.cs b/sdks/packages/csharp/tests/GoIos.Sdk.Tests/FacadeTests.cs new file mode 100644 index 000000000..fd6373a23 --- /dev/null +++ b/sdks/packages/csharp/tests/GoIos.Sdk.Tests/FacadeTests.cs @@ -0,0 +1,136 @@ +using System.Net; +using System.Net.Http; +using GoIos; +using Xunit; + +namespace GoIos.Sdk.Tests; + +public class FacadeTests +{ + private static IosClient ClientWith(HttpMessageHandler handler, string? apiKey = "secret") + { + var http = new HttpClient(handler) { Timeout = Timeout.InfiniteTimeSpan }; + return new IosClient(new IosClientOptions + { + BaseUrl = "http://localhost:60105", + ApiKey = apiKey, + HttpClient = http, + }); + } + + [Fact] + public async Task Screenshot_Returns_Raw_Bytes_And_Sends_Bearer() + { + var png = new byte[] { 0x89, 0x50, 0x4E, 0x47, 1, 2, 3 }; + var handler = new StubHttpMessageHandler(_ => + new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new ByteArrayContent(png) + { + Headers = { ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("image/png") }, + }, + }); + using var client = ClientWith(handler); + + var bytes = await client.Device("00008110-ABC").ScreenshotAsync(); + + Assert.Equal(png, bytes); + var req = Assert.Single(handler.Requests); + Assert.Equal("Bearer", req.Headers.Authorization?.Scheme); + Assert.Equal("secret", req.Headers.Authorization?.Parameter); + Assert.EndsWith("/screenshot", req.RequestUri!.AbsolutePath); + } + + [Fact] + public async Task SetLocation_Sends_Longitude_Query_Param() + { + var handler = StubHttpMessageHandler.Json("{\"message\":\"ok\"}"); + using var client = ClientWith(handler); + + await client.Device("udid1").SetLocationAsync(52.5, 13.4); + + var req = Assert.Single(handler.Requests); + var q = req.RequestUri!.Query; + Assert.Contains("longitude=13.4", q); + Assert.Contains("latitude=52.5", q); + Assert.DoesNotContain("longtitude", q); + } + + [Fact] + public async Task Devices_List_Deserializes() + { + var json = "{\"deviceList\":[{\"deviceID\":5,\"properties\":{\"serialNumber\":\"00008110-XYZ\"}}]}"; + var handler = StubHttpMessageHandler.Json(json); + using var client = ClientWith(handler); + + var list = await client.Devices.ListAsync(); + + Assert.Single(list.VarDeviceList); + Assert.Equal("00008110-XYZ", list.VarDeviceList[0].Properties.SerialNumber); + } + + [Fact] + public async Task Syslog_Streams_Typed_Events_EndToEnd() + { + var wire = + "event: syslog\ndata: {\"message\":\"hello\"}\n\n" + + "event: heartbeat\ndata: {}\n\n" + + "event: syslog\ndata: {\"message\":\"world\"}\n\n"; + var handler = new StubHttpMessageHandler(_ => + new HttpResponseMessage(HttpStatusCode.OK) { Content = new ChunkedContent(new[] { wire }) }); + using var client = ClientWith(handler); + + var messages = new List(); + var heartbeats = 0; + await foreach (var e in client.Device("udid1").SyslogAsync()) + { + switch (e) + { + case SyslogMessageEvent s: messages.Add(s.Message); break; + case HeartbeatEvent: heartbeats++; break; + } + } + + Assert.Equal(new[] { "hello", "world" }, messages); + Assert.Equal(1, heartbeats); + var req = Assert.Single(handler.Requests); + Assert.Contains("text/event-stream", req.Headers.Accept.ToString()); + } + + [Fact] + public async Task OsTrace_Applies_Filters_To_Query() + { + var handler = new StubHttpMessageHandler(_ => + new HttpResponseMessage(HttpStatusCode.OK) { Content = new ChunkedContent(new[] { "" }) }); + using var client = ClientWith(handler); + + await foreach (var _ in client.Device("udid1") + .OsTraceAsync(new OsTraceFilters { Pid = 123, Level = "error", Subsystem = "com.apple.network" })) + { + // drain + } + + var req = Assert.Single(handler.Requests); + var q = req.RequestUri!.Query; + Assert.Contains("pid=123", q); + Assert.Contains("level=error", q); + Assert.Contains("subsystem=com.apple.network", q); + } + + [Fact] + public async Task Non_Success_Stream_Throws_IosApiException() + { + var handler = new StubHttpMessageHandler(_ => + new HttpResponseMessage(HttpStatusCode.NotFound) + { + Content = new StringContent("{\"error\":\"device not found\"}"), + }); + using var client = ClientWith(handler); + + var ex = await Assert.ThrowsAsync(async () => + { + await foreach (var _ in client.Device("nope").SyslogAsync()) { } + }); + Assert.Equal(404, ex.StatusCode); + } +} diff --git a/sdks/packages/csharp/tests/GoIos.Sdk.Tests/GoIos.Sdk.Tests.csproj b/sdks/packages/csharp/tests/GoIos.Sdk.Tests/GoIos.Sdk.Tests.csproj new file mode 100644 index 000000000..2faff37e4 --- /dev/null +++ b/sdks/packages/csharp/tests/GoIos.Sdk.Tests/GoIos.Sdk.Tests.csproj @@ -0,0 +1,21 @@ + + + + net8.0 + latest + enable + enable + false + + + + + + + + + + + + + diff --git a/sdks/packages/csharp/tests/GoIos.Sdk.Tests/SseReaderTests.cs b/sdks/packages/csharp/tests/GoIos.Sdk.Tests/SseReaderTests.cs new file mode 100644 index 000000000..cbe374d5e --- /dev/null +++ b/sdks/packages/csharp/tests/GoIos.Sdk.Tests/SseReaderTests.cs @@ -0,0 +1,131 @@ +using System.Text; +using Xunit; + +namespace GoIos.Sdk.Tests; + +public class SseReaderTests +{ + private static SseEvent? SyslogFactory(string name, string data) => name switch + { + "syslog" => SseReader.Deserialize(data), + _ => null, + }; + + private static async Task> ReadAll(string wire, CancellationToken ct = default) + { + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(wire)); + var events = new List(); + await foreach (var e in SseReader.ReadAsync(stream, SyslogFactory, ct)) + events.Add(e); + return events; + } + + [Fact] + public async Task Parses_Multiple_Frames() + { + var wire = + "event: syslog\ndata: {\"message\":\"one\",\"timestamp\":1}\n\n" + + "event: syslog\ndata: {\"message\":\"two\"}\n\n"; + + var events = await ReadAll(wire); + + Assert.Equal(2, events.Count); + var first = Assert.IsType(events[0]); + Assert.Equal("one", first.Message); + Assert.Equal(1, first.Timestamp); + Assert.Equal("syslog", first.EventName); + var second = Assert.IsType(events[1]); + Assert.Equal("two", second.Message); + Assert.Null(second.Timestamp); + } + + [Fact] + public async Task Surfaces_Heartbeat() + { + var wire = "event: heartbeat\ndata: {}\n\n"; + var events = await ReadAll(wire); + var e = Assert.Single(events); + Assert.IsType(e); + Assert.Equal("heartbeat", e.EventName); + } + + [Fact] + public async Task Surfaces_Unknown_Event_With_RawData() + { + var wire = "event: somethingnew\ndata: {\"x\":1}\n\n"; + var events = await ReadAll(wire); + var e = Assert.Single(events); + var unknown = Assert.IsType(e); + Assert.Equal("somethingnew", unknown.EventName); + Assert.Equal("{\"x\":1}", unknown.RawData); + } + + [Fact] + public async Task Handles_Frame_Split_Across_Reads() + { + // Deliver the same logical stream but split mid-frame across chunks. + var chunks = new[] + { + "event: sys", + "log\ndata: {\"mess", + "age\":\"split\"}\n", + "\nevent: heartbeat\ndata: {}\n\n", + }; + using var content = new ChunkedContent(chunks); + using var stream = await content.ReadAsStreamAsync(); + + var events = new List(); + await foreach (var e in SseReader.ReadAsync(stream, SyslogFactory)) + events.Add(e); + + Assert.Equal(2, events.Count); + Assert.Equal("split", Assert.IsType(events[0]).Message); + Assert.IsType(events[1]); + } + + [Fact] + public async Task Handles_CRLF_And_Multiline_Data() + { + // CRLF line endings and a data field spanning two "data:" lines. + var wire = "event: syslog\r\ndata: {\"message\":\r\ndata: \"joined\"}\r\n\r\n"; + var events = await ReadAll(wire); + var e = Assert.Single(events); + Assert.Equal("joined", Assert.IsType(e).Message); + } + + [Fact] + public async Task Ignores_Comment_Lines() + { + var wire = ": this is a keep-alive comment\nevent: syslog\ndata: {\"message\":\"ok\"}\n\n"; + var events = await ReadAll(wire); + var e = Assert.Single(events); + Assert.Equal("ok", Assert.IsType(e).Message); + } + + [Fact] + public async Task Flushes_Trailing_Frame_Without_Blank_Line() + { + var wire = "event: syslog\ndata: {\"message\":\"last\"}"; + var events = await ReadAll(wire); + var e = Assert.Single(events); + Assert.Equal("last", Assert.IsType(e).Message); + } + + [Fact] + public async Task Honors_Cancellation() + { + // A frame followed by an unterminated one; cancel after the first. + var wire = "event: syslog\ndata: {\"message\":\"one\"}\n\n"; + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(wire)); + using var cts = new CancellationTokenSource(); + + var events = new List(); + await foreach (var e in SseReader.ReadAsync(stream, SyslogFactory, cts.Token)) + { + events.Add(e); + cts.Cancel(); // request stop after first event + } + + Assert.Single(events); + } +} diff --git a/sdks/packages/csharp/tests/GoIos.Sdk.Tests/StubHttpMessageHandler.cs b/sdks/packages/csharp/tests/GoIos.Sdk.Tests/StubHttpMessageHandler.cs new file mode 100644 index 000000000..08c762925 --- /dev/null +++ b/sdks/packages/csharp/tests/GoIos.Sdk.Tests/StubHttpMessageHandler.cs @@ -0,0 +1,61 @@ +using System.Net; +using System.Net.Http; + +namespace GoIos.Sdk.Tests; + +/// +/// A stub that returns a caller-supplied +/// response (built lazily so streaming bodies can be provided). Records the +/// requests it saw for assertions. +/// +internal sealed class StubHttpMessageHandler : HttpMessageHandler +{ + private readonly Func _responder; + public List Requests { get; } = new(); + + public StubHttpMessageHandler(Func responder) + => _responder = responder; + + public static StubHttpMessageHandler Json(string json, HttpStatusCode status = HttpStatusCode.OK) + => new(_ => new HttpResponseMessage(status) + { + Content = new StringContent(json, System.Text.Encoding.UTF8, "application/json"), + }); + + protected override Task SendAsync( + HttpRequestMessage request, CancellationToken cancellationToken) + { + Requests.Add(request); + return Task.FromResult(_responder(request)); + } +} + +/// +/// An HttpContent whose stream releases bytes in caller-controlled chunks, so we +/// can exercise the SSE reader against a frame that arrives split across reads. +/// +internal sealed class ChunkedContent : HttpContent +{ + private readonly IReadOnlyList _chunks; + + public ChunkedContent(IEnumerable chunks) + { + _chunks = chunks.Select(c => System.Text.Encoding.UTF8.GetBytes(c)).ToList(); + Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("text/event-stream"); + } + + protected override async Task SerializeToStreamAsync(Stream stream, System.Net.TransportContext? context) + { + foreach (var chunk in _chunks) + { + await stream.WriteAsync(chunk); + await stream.FlushAsync(); + } + } + + protected override bool TryComputeLength(out long length) + { + length = 0; + return false; + } +} diff --git a/sdks/packages/csharp/tests/GoIos.Sdk.Tests/V3FacadeTests.cs b/sdks/packages/csharp/tests/GoIos.Sdk.Tests/V3FacadeTests.cs new file mode 100644 index 000000000..58812b7d9 --- /dev/null +++ b/sdks/packages/csharp/tests/GoIos.Sdk.Tests/V3FacadeTests.cs @@ -0,0 +1,453 @@ +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text; +using GoIos; +using Xunit; + +namespace GoIos.Sdk.Tests; + +/// +/// Tests for the endpoints added to reach the full 125-op daemon surface: +/// diagnostics/network, accessibility, fsync, webinspector, ui, host signing, +/// and the raw binary streams. +/// +public class V3FacadeTests +{ + private static IosClient ClientWith(HttpMessageHandler handler, string? apiKey = "secret") + { + var http = new HttpClient(handler) { Timeout = Timeout.InfiniteTimeSpan }; + return new IosClient(new IosClientOptions + { + BaseUrl = "http://localhost:60105", + ApiKey = apiKey, + HttpClient = http, + }); + } + + private static StubHttpMessageHandler Capturing(string json, out Func<(HttpMethod?, string?, string?)> last) + { + HttpRequestMessage? seen = null; + string? body = null; + var handler = new StubHttpMessageHandler(req => + { + seen = req; + body = req.Content?.ReadAsStringAsync().GetAwaiter().GetResult(); + return new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new StringContent(json, Encoding.UTF8, "application/json"), + }; + }); + last = () => (seen?.Method, seen?.RequestUri?.AbsolutePath, body); + return handler; + } + + // --- Diagnostics / network --------------------------------------------- + + [Fact] + public async Task DiskSpace_Deserializes() + { + var handler = StubHttpMessageHandler.Json( + "{\"FSTotalBytes\":128000000000,\"FSFreeBytes\":64000000000,\"FSBlockSize\":4096,\"Model\":\"APPLE SSD\"}"); + using var client = ClientWith(handler); + + var d = await client.Device("udid1").DiskSpaceAsync(); + + Assert.Equal(128000000000L, d.FSTotalBytes); + Assert.Equal(64000000000L, d.FSFreeBytes); + Assert.EndsWith("/diskspace", Assert.Single(handler.Requests).RequestUri!.AbsolutePath); + } + + [Fact] + public async Task Ip_Deserializes() + { + var handler = StubHttpMessageHandler.Json( + "{\"MacAddress\":\"aa:bb:cc:dd:ee:ff\",\"IPv4\":\"192.168.0.5\",\"IPv6\":\"fe80::1\"}"); + using var client = ClientWith(handler); + + var ip = await client.Device("udid1").IpAsync(); + + Assert.Equal("192.168.0.5", ip.IPv4); + Assert.EndsWith("/ip", Assert.Single(handler.Requests).RequestUri!.AbsolutePath); + } + + // --- Accessibility ------------------------------------------------------ + + [Fact] + public async Task SetVoiceOver_Puts_Enabled_Body() + { + var handler = Capturing("{\"voiceOverEnabled\":true}", out var last); + using var client = ClientWith(handler); + + var state = await client.Device("udid1").SetVoiceOverAsync(true); + + Assert.True(state.VoiceOverEnabled); + var (method, path, body) = last(); + Assert.Equal(HttpMethod.Put, method); + Assert.EndsWith("/voiceover", path); + Assert.Contains("true", body); + } + + [Fact] + public async Task AxAudit_Sends_Timeout_And_Returns_List() + { + var handler = StubHttpMessageHandler.Json("[{\"type\":\"contrast\",\"element\":\"Button\"}]"); + using var client = ClientWith(handler); + + var issues = await client.Device("udid1").AxAuditAsync(timeout: 30); + + var issue = Assert.Single(issues); + Assert.Equal("contrast", issue["type"]?.ToString()); + var req = Assert.Single(handler.Requests); + Assert.EndsWith("/ax/audit", req.RequestUri!.AbsolutePath); + Assert.Contains("timeout=30", req.RequestUri!.Query); + } + + // --- Fsync -------------------------------------------------------------- + + [Fact] + public async Task Fsync_Ls_Sends_BundleId_And_Path() + { + var handler = StubHttpMessageHandler.Json("{\"path\":\"/Documents\",\"files\":[\"a.txt\",\"b.txt\"],\"count\":2}"); + using var client = ClientWith(handler); + + var listing = await client.Device("udid1").Fsync.LsAsync(path: "/Documents", bundleId: "com.example.app"); + + Assert.Equal(2, listing.Count); + Assert.Equal(new[] { "a.txt", "b.txt" }, listing.Files); + var req = Assert.Single(handler.Requests); + Assert.EndsWith("/fsync/ls", req.RequestUri!.AbsolutePath); + Assert.Contains("bundleID=com.example.app", req.RequestUri!.Query); + Assert.Contains("path=%2FDocuments", req.RequestUri!.Query); + } + + [Fact] + public async Task Fsync_Pull_Returns_Raw_Bytes() + { + var payload = new byte[] { 9, 8, 7 }; + var handler = new StubHttpMessageHandler(_ => + new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new ByteArrayContent(payload) + { + Headers = { ContentType = new MediaTypeHeaderValue("application/octet-stream") }, + }, + }); + using var client = ClientWith(handler); + + var bytes = await client.Device("udid1").Fsync.PullAsync(path: "/var/log.txt"); + + Assert.Equal(payload, bytes); + Assert.EndsWith("/fsync/pull", Assert.Single(handler.Requests).RequestUri!.AbsolutePath); + } + + [Fact] + public async Task Fsync_Rm_Sends_Recursive_Query() + { + var handler = StubHttpMessageHandler.Json("{\"message\":\"removed\",\"path\":\"/tmp/x\"}"); + using var client = ClientWith(handler); + + var res = await client.Device("udid1").Fsync.RmAsync("/tmp/x", recursive: true); + + Assert.Equal("removed", res.Message); + var req = Assert.Single(handler.Requests); + Assert.Equal(HttpMethod.Delete, req.Method); + Assert.Contains("recursive=true", req.RequestUri!.Query); + } + + // --- WebInspector ------------------------------------------------------- + + [Fact] + public async Task WebInspector_Eval_Posts_Script() + { + var handler = Capturing("{\"page\":\"1\",\"result\":42}", out var last); + using var client = ClientWith(handler); + + var res = await client.Device("udid1").WebInspector.EvalAsync("1+1", page: "1"); + + Assert.Equal("1", res.Page); + var (method, path, body) = last(); + Assert.Equal(HttpMethod.Post, method); + Assert.EndsWith("/webinspector/eval", path); + Assert.Contains("1+1", body); + } + + // --- UI ----------------------------------------------------------------- + + [Fact] + public async Task Ui_Tap_Posts_Coordinates_With_Backend_Option() + { + var handler = Capturing("{\"status\":\"ok\"}", out var last); + using var client = ClientWith(handler); + + var res = await client.Device("udid1").Ui.TapAsync( + 10, 20, new UiClient.Options { Backend = "wda", Timeout = 15 }); + + Assert.Equal("ok", res["status"]?.ToString()); + var (method, path, body) = last(); + Assert.Equal(HttpMethod.Post, method); + Assert.EndsWith("/ui/tap", path); + Assert.Contains("\"x\":10", body!.Replace(" ", "")); + var req = Assert.Single(handler.Requests); + Assert.Contains("backend=wda", req.RequestUri!.Query); + Assert.Contains("timeout=15", req.RequestUri!.Query); + } + + [Fact] + public async Task Ui_Screenshot_Returns_Png_Bytes() + { + var png = new byte[] { 0x89, 0x50, 0x4E, 0x47 }; + var handler = new StubHttpMessageHandler(_ => + new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new ByteArrayContent(png) + { + Headers = { ContentType = new MediaTypeHeaderValue("image/png") }, + }, + }); + using var client = ClientWith(handler); + + var bytes = await client.Device("udid1").Ui.ScreenshotAsync(); + + Assert.Equal(png, bytes); + Assert.EndsWith("/ui/screenshot", Assert.Single(handler.Requests).RequestUri!.AbsolutePath); + } + + [Fact] + public async Task Ui_Source_Returns_Xml_Text() + { + var xml = ""; + var handler = new StubHttpMessageHandler(_ => + new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new StringContent(xml, Encoding.UTF8, "application/xml"), + }); + using var client = ClientWith(handler); + + var source = await client.Device("udid1").Ui.SourceAsync(); + + Assert.Equal(xml, source); + Assert.EndsWith("/ui/source", Assert.Single(handler.Requests).RequestUri!.AbsolutePath); + } + + // --- Host: signing / prepare ------------------------------------------- + + [Fact] + public async Task Sign_Certificate_Posts_Multipart_And_Returns_P12_Bytes() + { + var p12 = new byte[] { 1, 2, 3, 4 }; + string? contentType = null; + var handler = new StubHttpMessageHandler(req => + { + contentType = req.Content?.Headers.ContentType?.MediaType; + return new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new ByteArrayContent(p12) + { + Headers = { ContentType = new MediaTypeHeaderValue("application/x-pkcs12") }, + }, + }; + }); + using var client = ClientWith(handler); + + var bytes = await client.Sign.CertificateAsync( + ascPrivateKey: new byte[] { 5, 6 }, ascKeyId: "KEYID", ascIssuerId: "ISSUER"); + + Assert.Equal(p12, bytes); + var req = Assert.Single(handler.Requests); + Assert.Equal(HttpMethod.Post, req.Method); + Assert.EndsWith("/sign/certificate", req.RequestUri!.AbsolutePath); + Assert.StartsWith("multipart/form-data", contentType); + } + + [Fact] + public async Task Prepare_SkipOptions_Deserializes() + { + var handler = StubHttpMessageHandler.Json("{\"options\":[\"Passcode\",\"Siri\"],\"count\":2}"); + using var client = ClientWith(handler); + + var opts = await client.Prepare.SkipOptionsAsync(); + + Assert.Equal(2, opts.Count); + Assert.Contains("Siri", opts.Options); + Assert.EndsWith("/prepare/skip-options", Assert.Single(handler.Requests).RequestUri!.AbsolutePath); + } + + [Fact] + public async Task Device_Prepare_Posts_Multipart_With_Skip_Fields() + { + string? contentType = null; + string? body = null; + var handler = new StubHttpMessageHandler(req => + { + contentType = req.Content?.Headers.ContentType?.MediaType; + body = req.Content?.ReadAsStringAsync().GetAwaiter().GetResult(); + return new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new StringContent("{\"status\":\"prepared\",\"supervised\":true}", Encoding.UTF8, "application/json"), + }; + }); + using var client = ClientWith(handler); + + var res = await client.Device("udid1").PrepareAsync( + cert: new byte[] { 1 }, p12Password: "pw", skip: new[] { "Siri" }, orgName: "Acme"); + + Assert.Equal("prepared", res.Status); + Assert.True(res.Supervised); + var req = Assert.Single(handler.Requests); + Assert.Equal(HttpMethod.Post, req.Method); + Assert.EndsWith("/prepare", req.RequestUri!.AbsolutePath); + Assert.StartsWith("multipart/form-data", contentType); + Assert.Contains("Acme", body); + Assert.Contains("Siri", body); + } + + // --- Lockdown domain (regenerated signature) --------------------------- + + [Fact] + public async Task Lockdown_Sends_Domain_Query_When_Provided() + { + var handler = StubHttpMessageHandler.Json("{\"BatteryCurrentCapacity\":80}"); + using var client = ClientWith(handler); + + var map = await client.Device("udid1").LockdownAsync(domain: "com.apple.mobile.battery"); + + Assert.Equal("80", map["BatteryCurrentCapacity"]?.ToString()); + var req = Assert.Single(handler.Requests); + Assert.Contains("domain=com.apple.mobile.battery", req.RequestUri!.Query); + } + + // --- Binary stream: chunked read -------------------------------------- + + [Fact] + public async Task PcapStream_Reads_Chunks_As_A_Raw_Stream() + { + // A finite binary body delivered in two chunks: the facade must expose it + // as a live byte Stream (via ResponseHeadersRead), readable incrementally. + var handler = new StubHttpMessageHandler(_ => + new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new BinaryChunkedContent( + new[] { new byte[] { 1, 2, 3 }, new byte[] { 4, 5, 6 } }, + "application/vnd.tcpdump.pcap"), + }); + using var client = ClientWith(handler); + + await using var stream = await client.Device("udid1").PcapAsync(timeout: 5); + + Assert.Equal("application/vnd.tcpdump.pcap", stream.ContentType); + + var all = new MemoryStream(); + await stream.CopyToAsync(all); + Assert.Equal(new byte[] { 1, 2, 3, 4, 5, 6 }, all.ToArray()); + + var req = Assert.Single(handler.Requests); + Assert.EndsWith("/pcap", req.RequestUri!.AbsolutePath); + Assert.Contains("timeout=5", req.RequestUri!.Query); + } + + // --- Binary stream: cancellation -------------------------------------- + + [Fact] + public async Task BinaryStream_Open_Honors_Cancellation() + { + // The CancellationToken must flow through the whole binary-stream open path + // (SendAsync / ResponseHeadersRead). The handler observes the token: if the + // facade did not forward it, no exception would surface. + var handler = new CancellationObservingHandler(); + using var client = ClientWith(handler); + + using var cts = new CancellationTokenSource(); + cts.Cancel(); + await Assert.ThrowsAnyAsync( + async () => await client.Device("udid1").PcapAsync(cancellationToken: cts.Token)); + } + + [Fact] + public async Task BinaryStream_Read_Passes_Token_To_Underlying_Stream() + { + // After the stream is open, a canceled read must not silently succeed: + // cancellation is forwarded to the underlying response stream. + var handler = new StubHttpMessageHandler(_ => + new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new BinaryChunkedContent(new[] { new byte[] { 1, 2, 3 } }, "application/vnd.tcpdump.pcap"), + }); + using var client = ClientWith(handler); + + await using var stream = await client.Device("udid1").PcapAsync(); + using var cts = new CancellationTokenSource(); + cts.Cancel(); + await Assert.ThrowsAnyAsync( + async () => await stream.ReadAsync(new byte[16].AsMemory(), cts.Token)); + } + + [Fact] + public async Task ScreenshotStream_Sends_Quality_And_Exposes_ContentType() + { + var handler = new StubHttpMessageHandler(_ => + new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new BinaryChunkedContent( + new[] { new byte[] { 0xFF, 0xD8, 0xFF } }, "image/jpeg"), + }); + using var client = ClientWith(handler); + + await using var stream = await client.Device("udid1").ScreenshotStreamAsync(quality: 70); + Assert.Equal("image/jpeg", stream.ContentType); + var buf = new byte[3]; + int n = await stream.ReadAsync(buf.AsMemory()); + Assert.Equal(3, n); + + var req = Assert.Single(handler.Requests); + Assert.EndsWith("/screenshot/stream", req.RequestUri!.AbsolutePath); + Assert.Contains("quality=70", req.RequestUri!.Query); + } +} + +/// +/// Binary that releases the given byte chunks then +/// completes, so a test can read a finite raw stream incrementally. +/// +internal sealed class BinaryChunkedContent : HttpContent +{ + private readonly IReadOnlyList _chunks; + + public BinaryChunkedContent(IEnumerable chunks, string mediaType) + { + _chunks = chunks.ToList(); + Headers.ContentType = new MediaTypeHeaderValue(mediaType); + } + + protected override async Task SerializeToStreamAsync(Stream stream, System.Net.TransportContext? context) + { + foreach (var chunk in _chunks) + { + await stream.WriteAsync(chunk); + await stream.FlushAsync(); + } + } + + protected override bool TryComputeLength(out long length) + { + length = 0; + return false; + } +} + +/// +/// A handler that honors the it is given, so we +/// can prove the facade forwards it into the binary-stream open path. +/// +internal sealed class CancellationObservingHandler : HttpMessageHandler +{ + protected override Task SendAsync( + HttpRequestMessage request, CancellationToken cancellationToken) + { + cancellationToken.ThrowIfCancellationRequested(); + return Task.FromResult(new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new BinaryChunkedContent(new[] { new byte[] { 1, 2, 3 } }, "application/vnd.tcpdump.pcap"), + }); + } +} diff --git a/sdks/packages/java/.gitignore b/sdks/packages/java/.gitignore new file mode 100644 index 000000000..61c700bf9 --- /dev/null +++ b/sdks/packages/java/.gitignore @@ -0,0 +1,19 @@ +# Build output +target/ + +# Local build tooling downloaded by scripts/generate.sh and the compile check: +# the openapi-generator jar and the javac/JUnit classpath jars. Not committed. +.tools/ + +# The generated low-level client IS committed for this package (see README), +# so undo the repo-root "generated/" ignore for this subtree. +!generated/ +!generated/** + +# The repo-root .gitignore has a bare "main" pattern (for the compiled go-ios +# "main" binary) that also matches this Maven package's src/main/ directory, +# which would silently untrack the hand-written Java facade sources. Re-include +# the SDK sources so they are always tracked regardless of that rule. +!src/ +!src/main/ +!src/main/** diff --git a/sdks/packages/java/README.md b/sdks/packages/java/README.md new file mode 100644 index 000000000..496f3651f --- /dev/null +++ b/sdks/packages/java/README.md @@ -0,0 +1,360 @@ +# go-ios SDK (Java) + +Java 17 SDK for the [go-ios](https://github.com/danielpaulus/go-ios) REST API. It +covers the **full 125-operation daemon surface**: device lifecycle, apps, +WebDriverAgent sessions, device info & network/disk diagnostics, device +management, house-arrest files & crashes, AFC file transfer (`fsync`), media, +profiles, settings, accessibility (VoiceOver / Zoom / audit / element snapshot), +MDM, the HTTP proxy, UI automation, the Safari Web Inspector, host-scoped app +signing & device preparation, the tunnel agent, async jobs, typed Server-Sent +Event streams (syslog, notifications, os_trace, listen, sysmontap, job logs), and +raw binary streams (UI video, MJPEG screenshots, pcap). + +- **Generated low-level client:** [openapi-generator](https://openapi-generator.tech/) + `7.11.0`, `java` generator, **`native`** HTTP library (`java.net.http`), + consuming `spec/openapi/openapi.yaml` (OpenAPI 3.1). Generated sources live in + [`generated/`](generated/) and are committed; regenerate with + [`scripts/generate.sh`](scripts/generate.sh). +- **Ergonomic facade:** a thin hand-written layer (`com.github.danielpaulus.goios`) + driving `java.net.http` directly, with a public API aligned to the other go-ios + SDKs (TypeScript / Python / C#). +- **Streaming:** two seams — a typed SSE reader for `text/event-stream` + endpoints, and a raw `BinaryStream` (an `InputStream`) for the `x-stream: + binary` endpoints. Both are `AutoCloseable` and cancel the underlying HTTP + connection on close. + +## Install + +Maven: + +```xml + + com.github.danielpaulus + go-ios-sdk + 0.1.0 + +``` + +Gradle: + +```groovy +implementation("com.github.danielpaulus:go-ios-sdk:0.1.0") +``` + +## Connecting — daemon discovery + +`baseUrl` is **optional**. The go-ios REST daemon now binds an **ephemeral +loopback port by default** and writes a discovery file at `/rest-api.json`; +the SDK reads it so you don't have to know the port. When you build a client with +no explicit `baseUrl`, the endpoint is resolved in this order: + +1. an explicit `.baseUrl(...)` on the builder (use this for remote daemons); +2. the `GO_IOS_BASE_URL` env var; +3. **discovery** — the `baseUrl` field of `/rest-api.json`, where `` + is `GO_IOS_HOME` if set and non-empty, else `~/.go-ios`; +4. otherwise `build()` throws `IosDiscoveryException` naming the expected path + (start the go-ios REST API, or pass a `baseUrl`). + +```java +// Auto-discover a locally running daemon (no baseUrl needed): +try (IosClient client = IosClient.builder() + .apiKey(System.getenv("GO_IOS_API_KEY")) + .build()) { + // ... +} +``` + +To pin the daemon to a fixed port instead, start it with `--addr :8080` and/or +set `GO_IOS_BASE_URL` (or pass `.baseUrl("http://localhost:8080")`). + +## Authentication + +All `/api/v1` routes require `Authorization: Bearer `. Pass the +key via the builder (or set `GO_IOS_API_KEY` and read it yourself). It is +optional (a server started with `--disable-auth` accepts requests without it) +but strongly encouraged; the SDK sends it whenever it is set. The API key is +**not** read from the discovery file. + +```java +IosClient client = IosClient.builder() + .baseUrl("http://localhost:8080") // optional; /api/v1 is appended automatically + .apiKey(System.getenv("GO_IOS_API_KEY")) // optional but recommended + .build(); +``` + +## Quickstart — unary calls + +```java +import com.github.danielpaulus.goios.*; +import com.github.danielpaulus.goios.generated.model.*; + +try (IosClient client = IosClient.builder() + .apiKey(System.getenv("GO_IOS_API_KEY")) // baseUrl auto-discovered + .build()) { + + // Fleet + for (DeviceEntry d : client.devices().list()) { + System.out.println(Devices.udid(d)); + } + + // One device + Device device = client.device("00008110-0011..."); + Object info = device.info(); + byte[] png = device.screenshot(); // image/png bytes + device.setLocation(37.3349, -122.0090); // correctly-spelled longitude + device.resetLocation(); + + // Apps + device.apps().install(Files.readAllBytes(Path.of("app.ipa"))); + device.apps().launch("com.apple.Preferences"); + for (AppInfo app : device.apps().list()) { + System.out.println(app.getCfBundleIdentifier()); + } + device.apps().kill("com.apple.Preferences"); + + // WebDriverAgent + WdaConfig cfg = new WdaConfig() + .bundleId("com.facebook.WebDriverAgentRunner.xctrunner"); + WdaSession session = device.wda().createSession(cfg); + device.wda().getSession(session.getSessionId()); + device.wda().deleteSession(session.getSessionId()); +} +``` + +Non-2xx responses throw `IosApiException` carrying the HTTP status and the +decoded `GenericResponse` error envelope: + +```java +try { + client.device("does-not-exist").info(); +} catch (IosApiException e) { + if (e.statusCode() == 404) { + System.out.println("unknown device: " + e.errorBody().getError()); + } +} +``` + +## Quickstart — streaming (SSE) + +Each SSE method returns an `SseReader`, which is both an `Iterable` and +an `AutoCloseable`. Use pattern matching to branch on the typed event, and +try-with-resources to guarantee the underlying HTTP stream is cancelled: + +```java +import com.github.danielpaulus.goios.stream.*; + +try (SseReader stream = device.syslog()) { + for (SseEvent ev : stream) { + if (ev instanceof SyslogEvent s) { + System.out.println(s.payload().getMessage()); + } + if (someStopCondition) { + break; // closing the try-with-resources aborts the stream + } + } +} +``` + +Available SSE streams and their typed events (heartbeats are parsed and skipped +by default; pass `true` to include them): + +| Method | Event type | Payload | +| --------------------------------------------------- | ------------------- | ----------------------- | +| `device.syslog()` | `SyslogEvent` | `SyslogMessage` | +| `device.notifications()` | `AppStateEvent` | `AppStateNotification` | +| `device.ostrace(pid, level, subsystem, m, x, hb)` | `OsTraceEvent` | `OsTraceEntry` | +| `device.listen()` | `AttachDetachEvent` | attach/detach payload | +| `device.sysmontap()` | `SysmontapEvent` | `CpuUsageSample` | +| `device.jobs().logs(jobId)` | `JobLogEvent` | `JobLogLine` | + +Any unrecognized `event:` name is surfaced as `UnknownEvent` (never dropped) for +forward-compatibility. `device.ostrace()` (no args) streams unfiltered. + +## Quickstart — binary streams + +The `x-stream: binary` endpoints (UI video, MJPEG screenshots, live pcap) are +**not** SSE — they return an opaque byte stream. The SDK exposes them as a +`BinaryStream`, a plain `InputStream` the caller reads directly. Closing it +releases (cancels) the HTTP connection, so a long-lived capture can be stopped +at any time: + +```java +import com.github.danielpaulus.goios.stream.BinaryStream; + +// Live pcap capture piped to a file (stop after `timeout` seconds server-side). +try (BinaryStream pcap = device.pcap(30); + var out = Files.newOutputStream(Path.of("capture.pcap"))) { + pcap.transferTo(out); +} + +// MJPEG screenshot stream / UI video stream. +try (BinaryStream video = device.ui().stream()) { + System.out.println(video.contentType()); // e.g. multipart/x-mixed-replace + byte[] frameBytes = video.readNBytes(64 * 1024); +} + +try (BinaryStream shots = device.screenshotStream(80 /* quality */)) { /* ... */ } +``` + +## Full API surface + +`client.device(udid)` returns a `Device`; grouped operations are reached through +sub-facades. Host-scoped (device-free) operations hang off the client. + +```java +Device d = client.device(udid); + +// Device info & diagnostics +d.info(); d.deviceName(); d.date(); d.battery(); d.batteryRegistry(); +d.diagnostics(); d.diskSpace(); d.ip(); d.rsd(); +d.mobileGestalt(List.of("ProductType")); d.processes(null); +d.lockdown(); d.lockdown("com.apple.mobile.battery"); // no-arg or domain-scoped + +// Device management +d.activate(); d.reboot(); d.shutdown(); d.erase(true); +d.devMode(); d.setDevMode("enable", true); +d.lang(); d.setLang("en", "en_US"); d.memlimitoff("backboardd"); + +// Location +d.setLocation(37.3349, -122.0090); d.resetLocation(); +d.setLocationGpx(Files.readAllBytes(Path.of("track.gpx"))); // multipart + +// Accessibility +d.ax(); // focused element snapshot +d.axAudit(60); // run the a11y audit (timeout seconds) +d.voiceOver(); d.setVoiceOver(true); +d.zoom(); d.setZoom(true); +d.resetAccessibility(); + +// Developer image +d.images(); d.mountImage(bytes); d.mountImageAuto(basedir); +d.mountedImages(); d.unmountImage(); + +// Profiles & conditions +d.profiles(); d.addProfile(mobileconfig, p12, pass); d.removeProfile(name); +d.conditions(); d.enableCondition(profileTypeId, profileId); d.disableCondition(); + +// House-arrest files & crashes +d.files().ls("app", "com.x", "/Documents"); +byte[] f = d.files().pull("app", "com.x", "/Documents/log.txt"); +d.files().push("app", "com.x", "/Documents/out.txt", bytes); +d.crashes().list(); d.crashes().remove("*.crash"); d.crashes().remove("*.crash", cwd); + +// AFC file transfer (fsync); pass a bundleId to scope to an app container +d.fsync().ls("/Documents", "com.x"); d.fsync().tree("/Documents", null); +byte[] b = d.fsync().pull("/Documents/a.txt", null); +d.fsync().push("/Documents/x.bin", bytes, null); +d.fsync().mkdir("/Documents/new", null); d.fsync().rm("/Documents/old", null, true); +d.cloudConfig(); + +// Media +byte[] wp = d.media().wallpaper(); +d.media().setWallpaper(image, p12, pass, "home"); // supervised multipart +d.media().iconLayout(); d.media().setIconLayout(layout); +d.media().pasteboard(); d.media().setPasteboard("copied"); + +// Settings +d.settings().assistiveTouch(); d.settings().setAssistiveTouch(true); +d.settings().timeFormat(); d.settings().setTimeFormat(true); +d.settings().setWifi("ssid", "pw", "WPA2"); d.settings().removeWifi("ssid"); + +// MDM (supervised; each takes a .p12 identity) +d.mdm().securityInfo(p12, pass); +d.mdm().fetchUnlockToken(p12, pass); +d.mdm().clearPasscode(p12, pass, token); +d.mdm().clearScreenTimePassword(p12, pass); + +// HTTP proxy & pairing / prepare (supervised, multipart) +d.setHttpProxy(host, port, user, pass, p12, p12Pass); d.removeHttpProxy(); +d.pair(true, p12, supervisionPassword); +d.prepare(cert, p12password, List.of("Passcode", "Siri"), orgname, "en_US", "en"); + +// UI automation (backend/wdaUrl/timeout via Ui.Options; convenience overloads use defaults) +d.ui().tap(100, 200); +d.ui().swipe(10, 10, 300, 300, 0.5, null); +d.ui().longPress(50, 50); +d.ui().type("hello"); +d.ui().button("home"); +byte[] uiShot = d.ui().screenshot(); +d.ui().source(); d.ui().size(); d.ui().status(); +d.ui().orientation(); d.ui().setOrientation("LANDSCAPE"); +d.ui().appLaunch(bundleId); d.ui().appTerminate(bundleId); d.ui().appForeground(); +d.ui().api(rawBackendBody, new Ui.Options("devicekit", null, 60)); + +// Safari Web Inspector +d.webinspector().pages(); +d.webinspector().launch("https://example.com", null); +d.webinspector().eval("document.title", pageId, null); + +// Async jobs (device-scoped) +Job job = d.jobs().runWda(new RunTestRequest()); +d.jobs().runTest(req); d.jobs().forward(8080, 9090); +d.jobs().list(); d.jobs().get(job.getId()); d.jobs().delete(job.getId()); +try (SseReader logs = d.jobs().logs(job.getId())) { /* stream */ } + +// Tunnel agent (fleet-level) +client.tunnels().list(); +client.tunnels().refresh(udid); +client.tunnels().delete(udid); +client.tunnels().shutdownAgent(); + +// Host-scoped app signing (device-free) +byte[] signedIpa = client.sign().app(ipa, p12, profile, p12pass, bundleId); +byte[] p12Cert = client.sign().certificate(ascKeyP8, keyId, issuerId, false, p12pass); +ProvisioningResult prov = client.sign().provision( + ascKeyP8, keyId, issuerId, bundleId, udid, + null, null, null, null, false, p12pass); + +// Host-scoped preparation helpers +client.prepare().createCert(); // self-signed supervision cert + key +client.prepare().skipOptions(); // setup panes that prepare can skip +``` + +## Examples + +Runnable, heavily commented example programs live in [`examples/`](examples/) — +each a standalone `main`, configured via `GO_IOS_BASE_URL` / `GO_IOS_API_KEY` / +`GO_IOS_UDID`. They double as documentation and as a pre-release smoke test: +[`examples/RunAllExamples.java`](examples/RunAllExamples.java) runs listing +devices, device info, apps, a screenshot and an SSE syslog stream in sequence +(plus an optional UI-automation example gated on `RUN_UI=1`) and exits non-zero +if any core step fails. Compile and run them without Maven: + +```bash +export GO_IOS_API_KEY=... # required +bash examples/run.sh # compile + run all examples +bash examples/run.sh --compile-only # compile only; no daemon needed +``` + +See [`examples/README.md`](examples/README.md) for the full list and setup. + +## Build & test + +Maven (recommended): + +```bash +mvn -q package # compile facade + committed generated sources, run tests +mvn -q -DskipTests package # compile only +``` + +Without Maven (JDK 17+ only), a helper compiles with `javac --release 17` and +runs the suite via the JUnit Platform Console Standalone launcher (dependency +jars are downloaded once into `.tools/lib/`, gitignored): + +```bash +./scripts/verify.sh +``` + +Regenerate the low-level client from the spec: + +```bash +./scripts/generate.sh # pins openapi-generator-cli 7.11.0 +``` + +## Publishing (maintainers) + +Configured for **Maven Central** via the Sonatype Central Publisher Portal under +the `release` profile (`central-publishing-maven-plugin` + `maven-gpg-plugin`). +No credentials are stored here. To publish a release you would supply a +`central` server entry in `~/.m2/settings.xml` and a GPG signing key, then run +`mvn -Prelease clean deploy`. diff --git a/sdks/packages/java/examples/README.md b/sdks/packages/java/examples/README.md new file mode 100644 index 000000000..67ce77500 --- /dev/null +++ b/sdks/packages/java/examples/README.md @@ -0,0 +1,80 @@ +# go-ios Java SDK — examples + +Runnable, heavily commented example programs for the go-ios Java SDK. Each class +has its own `main`, is configured entirely through environment variables, and +demonstrates exactly one feature so it can be read as documentation. Together +they also serve as a **pre-release smoke test** (see [`run.sh`](run.sh)): +[`RunAllExamples`](RunAllExamples.java) runs them in sequence and exits non-zero +if any core example throws. + +## The examples + +| # | Class | What it shows | +| - | ----- | ------------- | +| 1 | [`ListDevicesExample`](src/com/github/danielpaulus/goios/examples/ListDevicesExample.java) | Build an `IosClient`, list attached devices (`GET /list`). | +| 2 | [`DeviceInfoExample`](src/com/github/danielpaulus/goios/examples/DeviceInfoExample.java) | Read a device's info (`GET /device/{udid}/info`). | +| 3 | [`ListAppsExample`](src/com/github/danielpaulus/goios/examples/ListAppsExample.java) | List installed apps (`GET /device/{udid}/apps/`). | +| 4 | [`ScreenshotExample`](src/com/github/danielpaulus/goios/examples/ScreenshotExample.java) | Capture a PNG screenshot to `./screenshot.png`. | +| 5 | [`StreamSyslogExample`](src/com/github/danielpaulus/goios/examples/StreamSyslogExample.java) | Stream syslog over SSE (`SseReader`), stop after ~20 events or ~5 s. | +| 6 | [`UiAutomationExample`](src/com/github/danielpaulus/goios/examples/UiAutomationExample.java) | **Optional.** UI tap + type via WebDriverAgent; only when `RUN_UI=1`. | + +Examples 2–6 need a device: when none is attached they print `SKIP` and return +normally, so the suite still passes on a device-less daemon. + +## 1. Start the daemon + +The examples talk to a running go-ios REST daemon. Start one with an API key (or +with `--disable-auth`, in which case any non-empty `GO_IOS_API_KEY` works): + +```bash +# From the go-ios repo root; --api-key can be any secret you choose. +# By default the daemon binds an ephemeral loopback port and writes a discovery +# file at ~/.go-ios/rest-api.json; the examples auto-discover it. +ios api --api-key "$GO_IOS_API_KEY" + +# To pin a fixed port instead: +# ios api --api-key "$GO_IOS_API_KEY" --addr :8080 # then GO_IOS_BASE_URL=http://localhost:8080 +``` + +## 2. Configure the environment + +| Variable | Required | Default | Meaning | +| -------- | -------- | ------- | ------- | +| `GO_IOS_API_KEY` | **yes** | — | Bearer token sent on every request. Missing → the example prints help and exits 1. | +| `GO_IOS_BASE_URL` | no | auto-discovered (`~/.go-ios/rest-api.json`) | Daemon origin (the SDK appends `/api/v1`). Unset → discover the local daemon. | +| `GO_IOS_UDID` | no | first attached device | Target device udid. | +| `RUN_UI` | no | unset | Set to `1` to also run the UI-automation example. | + +```bash +export GO_IOS_API_KEY=dev +# GO_IOS_BASE_URL is optional; unset, the local daemon is auto-discovered. +# export GO_IOS_BASE_URL=http://localhost:8080 # only to pin a fixed/remote daemon +# export GO_IOS_UDID=00008110-0011... # optional +``` + +## 3. Compile and run + +No Maven required — [`run.sh`](run.sh) mirrors [`../scripts/verify.sh`](../scripts/verify.sh): +it downloads the dependency jars once into `../.tools/lib/` (gitignored), +compiles the SDK (committed generated client + hand-written facade) and the +examples with `javac --release 17`, then runs `RunAllExamples`. + +```bash +# From sdks/packages/java/ +bash examples/run.sh # compile + run all examples (the pre-release check) +RUN_UI=1 bash examples/run.sh # also run the optional UI example +bash examples/run.sh --compile-only # compile only; no daemon needed +``` + +Requires **JDK 17+**. `run.sh` exits non-zero if any core example (1–5) throws, +making it suitable as a CI / pre-release gate. + +### Running a single example + +After a compile (`bash examples/run.sh --compile-only`), run any one directly: + +```bash +# The classpath is: examples classes, SDK classes, and the downloaded jars. +CP="examples/target/classes:target/classes:$(printf '%s:' .tools/lib/*.jar)" +java -cp "$CP" com.github.danielpaulus.goios.examples.ScreenshotExample +``` diff --git a/sdks/packages/java/examples/RunAllExamples.java b/sdks/packages/java/examples/RunAllExamples.java new file mode 100644 index 000000000..aac431e36 --- /dev/null +++ b/sdks/packages/java/examples/RunAllExamples.java @@ -0,0 +1,81 @@ +import com.github.danielpaulus.goios.examples.DeviceInfoExample; +import com.github.danielpaulus.goios.examples.Env; +import com.github.danielpaulus.goios.examples.ListAppsExample; +import com.github.danielpaulus.goios.examples.ListDevicesExample; +import com.github.danielpaulus.goios.examples.ScreenshotExample; +import com.github.danielpaulus.goios.examples.StreamSyslogExample; +import com.github.danielpaulus.goios.examples.UiAutomationExample; + +/** + * Runs the go-ios Java SDK examples end-to-end as a single program. This doubles + * as a pre-release smoke test: it exercises the real public API against a + * live daemon and fails loudly (non-zero exit) if any core example throws. + * + *

Order and semantics: + *

    + *
  1. {@code ListDevicesExample}
  2. + *
  3. {@code DeviceInfoExample}
  4. + *
  5. {@code ListAppsExample}
  6. + *
  7. {@code ScreenshotExample}
  8. + *
  9. {@code StreamSyslogExample}
  10. + *
  11. {@code UiAutomationExample} — only when {@code RUN_UI=1}
  12. + *
+ * + *

Steps 1–5 must complete without throwing. Steps that need a device print a + * {@code SKIP} line and return normally when no device is attached, so the suite + * still passes against a device-less daemon (a genuine transport/auth failure + * still throws and fails the run). The UI example runs only when {@code RUN_UI=1} + * and never fails the suite for an environmental reason. + * + *

{@code Env.requireApiKey()} short-circuits with a helpful message and exit + * code {@code 1} if {@code GO_IOS_API_KEY} is unset, mirroring each standalone + * example. + */ +public final class RunAllExamples { + + private RunAllExamples() { + } + + @FunctionalInterface + private interface Example { + void run() throws Exception; + } + + public static void main(String[] args) { + // Fail fast (exit 1) with a helpful message before running anything. + Env.requireApiKey(); + + System.out.println("== go-ios Java SDK examples =="); + String baseUrl = Env.baseUrl(); + System.out.println("baseUrl = " + (baseUrl != null ? baseUrl : "(auto-discovered local daemon)")); + System.out.println(); + + // Core examples (1-5). Any exception here fails the whole run. + runOrExit("1. ListDevicesExample", () -> ListDevicesExample.main(args)); + runOrExit("2. DeviceInfoExample", () -> DeviceInfoExample.main(args)); + runOrExit("3. ListAppsExample", () -> ListAppsExample.main(args)); + runOrExit("4. ScreenshotExample", () -> ScreenshotExample.main(args)); + runOrExit("5. StreamSyslogExample", () -> StreamSyslogExample.main(args)); + + // Optional UI example (6). It self-skips unless RUN_UI=1; a failure there + // should still surface, so we run it through the same guard. + runOrExit("6. UiAutomationExample", () -> UiAutomationExample.main(args)); + + System.out.println(); + System.out.println("All examples completed successfully."); + } + + /** Run one example, printing a header; on any exception print it and exit non-zero. */ + private static void runOrExit(String title, Example example) { + System.out.println("--- " + title + " ---"); + try { + example.run(); + } catch (Throwable t) { + System.err.println(); + System.err.println("FAILED: " + title); + t.printStackTrace(); + System.exit(1); + } + System.out.println(); + } +} diff --git a/sdks/packages/java/examples/run.sh b/sdks/packages/java/examples/run.sh new file mode 100755 index 000000000..5f7ddbbdb --- /dev/null +++ b/sdks/packages/java/examples/run.sh @@ -0,0 +1,84 @@ +#!/usr/bin/env bash +# Compile and run the go-ios Java SDK examples WITHOUT Maven, using javac and the +# same dependency classpath as scripts/verify.sh. This is the pre-release smoke +# test: it builds the SDK (committed generated client + hand-written facade), then +# compiles and runs the examples' RunAllExamples driver against a live daemon. +# +# Requirements: JDK 17+, and a running go-ios daemon reachable at $GO_IOS_BASE_URL +# (default http://localhost:8080) with $GO_IOS_API_KEY set. +# +# Usage: +# export GO_IOS_API_KEY=... # required +# export GO_IOS_BASE_URL=... # optional (default http://localhost:8080) +# export GO_IOS_UDID=... # optional (default: first attached device) +# export RUN_UI=1 # optional: also run the UI-automation example +# bash examples/run.sh +# +# Pass --compile-only to build the examples without launching them (used by CI / +# scripts/verify.sh-style compile checks where no daemon is available). +set -euo pipefail + +COMPILE_ONLY=0 +if [[ "${1:-}" == "--compile-only" ]]; then + COMPILE_ONLY=1 +fi + +# Package root (sdks/packages/java): parent of this examples/ directory. +HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +EX="${HERE}/examples" +LIB="${HERE}/.tools/lib" +M="https://repo1.maven.org/maven2" + +# Keep these versions in lock-step with scripts/verify.sh. +JACKSON="2.18.2" +HTTPCORE="4.4.16" +HTTPCLIENT="4.5.14" + +# Runtime dependencies of the SDK facade + generated client (no JUnit needed here). +deps=( + "com/fasterxml/jackson/core/jackson-databind/${JACKSON}/jackson-databind-${JACKSON}.jar" + "com/fasterxml/jackson/core/jackson-core/${JACKSON}/jackson-core-${JACKSON}.jar" + "com/fasterxml/jackson/core/jackson-annotations/${JACKSON}/jackson-annotations-${JACKSON}.jar" + "com/fasterxml/jackson/datatype/jackson-datatype-jsr310/${JACKSON}/jackson-datatype-jsr310-${JACKSON}.jar" + "org/apache/httpcomponents/httpmime/${HTTPCLIENT}/httpmime-${HTTPCLIENT}.jar" + "org/apache/httpcomponents/httpclient/${HTTPCLIENT}/httpclient-${HTTPCLIENT}.jar" + "org/apache/httpcomponents/httpcore/${HTTPCORE}/httpcore-${HTTPCORE}.jar" + "jakarta/annotation/jakarta.annotation-api/3.0.0/jakarta.annotation-api-3.0.0.jar" +) + +mkdir -p "${LIB}" +for d in "${deps[@]}"; do + f="${LIB}/$(basename "$d")" + if [[ ! -f "$f" ]]; then + echo "Downloading $(basename "$d")..." + curl -sSL -o "$f" "${M}/${d}" + fi +done + +CP="$(printf '%s:' "${LIB}"/*.jar)" + +echo "Compiling generated client + facade (javac --release 17)..." +rm -rf "${HERE}/target/classes" +mkdir -p "${HERE}/target/classes" +mkdir -p "${HERE}/.tools" +find "${HERE}/generated/src/main/java" "${HERE}/src/main/java" -name '*.java' \ + > "${HERE}/.tools/sources.txt" +javac --release 17 -cp "${CP}" -d "${HERE}/target/classes" @"${HERE}/.tools/sources.txt" + +echo "Compiling examples (javac --release 17)..." +rm -rf "${EX}/target/classes" +mkdir -p "${EX}/target/classes" +# RunAllExamples.java lives at the examples/ root; the example classes live under +# examples/src/. Compile both trees against the SDK classes we just built. +find "${EX}/src" -name '*.java' > "${HERE}/.tools/example-sources.txt" +echo "${EX}/RunAllExamples.java" >> "${HERE}/.tools/example-sources.txt" +javac --release 17 -cp "${CP}${HERE}/target/classes" -d "${EX}/target/classes" \ + @"${HERE}/.tools/example-sources.txt" + +if [[ "${COMPILE_ONLY}" == "1" ]]; then + echo "Compile-only: examples compiled successfully." + exit 0 +fi + +echo "Running RunAllExamples..." +java -cp "${EX}/target/classes:${HERE}/target/classes:${CP}" RunAllExamples diff --git a/sdks/packages/java/examples/src/com/github/danielpaulus/goios/examples/DeviceInfoExample.java b/sdks/packages/java/examples/src/com/github/danielpaulus/goios/examples/DeviceInfoExample.java new file mode 100644 index 000000000..5960fa6e4 --- /dev/null +++ b/sdks/packages/java/examples/src/com/github/danielpaulus/goios/examples/DeviceInfoExample.java @@ -0,0 +1,43 @@ +package com.github.danielpaulus.goios.examples; + +import com.github.danielpaulus.goios.Device; +import com.github.danielpaulus.goios.IosClient; + +/** + * Example 2 — fetch device info for the target device. + * + *

Resolves a device (either {@code GO_IOS_UDID} or the first attached + * device), then reads its lockdown + instruments values via {@code GET /info}. + * The facade returns {@code info()} as a loosely-typed {@code Object} (a decoded + * JSON map) because the surface is large and device-dependent; this example + * simply prints it. + * + *

When no device is attached it prints {@code SKIP} and returns normally so + * the pre-release runner does not fail on a device-less daemon. + */ +public final class DeviceInfoExample { + + private DeviceInfoExample() { + } + + public static void main(String[] args) { + Env.requireApiKey(); + + try (IosClient client = Env.client()) { + String udid = Env.resolveUdid(client); + if (udid == null) { + System.out.println("SKIP DeviceInfoExample: no device attached."); + return; + } + + System.out.println("Fetching info for device " + udid + " ..."); + + // Device is a lightweight handle scoped to one udid. + Device device = client.device(udid); + + // GET /device/{udid}/info + Object info = device.info(); + System.out.println(info); + } + } +} diff --git a/sdks/packages/java/examples/src/com/github/danielpaulus/goios/examples/Env.java b/sdks/packages/java/examples/src/com/github/danielpaulus/goios/examples/Env.java new file mode 100644 index 000000000..984337feb --- /dev/null +++ b/sdks/packages/java/examples/src/com/github/danielpaulus/goios/examples/Env.java @@ -0,0 +1,118 @@ +package com.github.danielpaulus.goios.examples; + +import com.github.danielpaulus.goios.Devices; +import com.github.danielpaulus.goios.IosClient; +import com.github.danielpaulus.goios.generated.model.DeviceEntry; + +import java.util.List; + +/** + * Shared environment / configuration helper for the examples. + * + *

Every example is configured purely through environment variables so it can + * be run against any go-ios daemon without editing code: + * + *

    + *
  • {@code GO_IOS_BASE_URL} — base URL of the daemon. The SDK appends + * {@code /api/v1} automatically, so pass just the origin. Optional — when + * unset the examples pass no baseUrl, so the SDK auto-discovers the local + * daemon via {@code ~/.go-ios/rest-api.json}. Set it only to target a + * pinned or remote daemon.
  • + *
  • {@code GO_IOS_API_KEY} — bearer token. The daemon refuses to start + * without an API key unless launched with {@code --disable-auth}. Every + * example treats a missing key as a fatal misconfiguration and exits with + * a helpful message (a daemon started with {@code --disable-auth} still + * accepts a bogus key, so set it to any non-empty value in that case).
  • + *
  • {@code GO_IOS_UDID} — optional. The device to target. When unset, the + * examples fall back to the first device reported by {@code GET /list}.
  • + *
+ * + *

This class is intentionally tiny and dependency-free so the example + * "programs" below can stay focused on demonstrating one SDK feature each. + */ +public final class Env { + + private Env() { + } + + /** + * The configured base URL, or {@code null} to let the SDK auto-discover the + * local daemon ({@code ~/.go-ios/rest-api.json}). When {@code GO_IOS_BASE_URL} + * is unset we return {@code null} so the builder falls through to discovery — + * we no longer hardcode a default port. + */ + public static String baseUrl() { + String v = System.getenv("GO_IOS_BASE_URL"); + return (v == null || v.isBlank()) ? null : v; + } + + /** The configured API key, or {@code null} when unset. */ + public static String apiKey() { + String v = System.getenv("GO_IOS_API_KEY"); + return (v == null || v.isBlank()) ? null : v; + } + + /** The explicitly configured udid, or {@code null} to auto-select. */ + public static String udid() { + String v = System.getenv("GO_IOS_UDID"); + return (v == null || v.isBlank()) ? null : v; + } + + /** + * Enforce that {@code GO_IOS_API_KEY} is set, printing a helpful message and + * calling {@link System#exit(int)} with status {@code 1} when it is not. + * Each example calls this first so a missing key fails fast and clearly + * rather than surfacing as an opaque {@code 401} later. + */ + public static void requireApiKey() { + if (apiKey() == null) { + System.err.println("ERROR: GO_IOS_API_KEY is not set."); + System.err.println(); + System.err.println("The go-ios daemon requires a bearer token on every /api/v1 route."); + System.err.println("Export it before running the examples, for example:"); + System.err.println(); + System.err.println(" export GO_IOS_API_KEY=\"$(cat ~/.go-ios-api-key)\""); + System.err.println(); + System.err.println("If your daemon was started with --disable-auth, any non-empty"); + System.err.println("value works: export GO_IOS_API_KEY=dev"); + System.exit(1); + } + } + + /** + * Build an {@link IosClient} from the environment. The caller owns the + * returned client and must {@link IosClient#close() close} it (ideally via + * try-with-resources). + */ + public static IosClient client() { + // Only set baseUrl when GO_IOS_BASE_URL is provided; leaving it unset lets + // the builder fall through to local-daemon discovery. + IosClient.Builder builder = IosClient.builder().apiKey(apiKey()); + String url = baseUrl(); + if (url != null) { + builder.baseUrl(url); + } + return builder.build(); + } + + /** + * Resolve the target device udid: {@code GO_IOS_UDID} when set, otherwise the + * first device from {@code GET /list}. Returns {@code null} when no device is + * attached — callers should treat that as a "SKIP" rather than a failure so + * the suite still passes on a daemon with no devices. + */ + public static String resolveUdid(IosClient client) { + String explicit = udid(); + if (explicit != null) { + return explicit; + } + List devices = client.devices().list(); + for (DeviceEntry d : devices) { + String u = Devices.udid(d); + if (u != null) { + return u; + } + } + return null; + } +} diff --git a/sdks/packages/java/examples/src/com/github/danielpaulus/goios/examples/ListAppsExample.java b/sdks/packages/java/examples/src/com/github/danielpaulus/goios/examples/ListAppsExample.java new file mode 100644 index 000000000..da40946c2 --- /dev/null +++ b/sdks/packages/java/examples/src/com/github/danielpaulus/goios/examples/ListAppsExample.java @@ -0,0 +1,47 @@ +package com.github.danielpaulus.goios.examples; + +import com.github.danielpaulus.goios.Device; +import com.github.danielpaulus.goios.IosClient; +import com.github.danielpaulus.goios.generated.model.AppInfo; + +import java.util.List; + +/** + * Example 3 — list installed apps on the target device. + * + *

Reads the installed application list via {@code GET + * /device/{udid}/apps/}, which returns strongly-typed {@link AppInfo} records. + * We print each app's bundle identifier, display name and version. + * + *

Skips gracefully when no device is attached. + */ +public final class ListAppsExample { + + private ListAppsExample() { + } + + public static void main(String[] args) { + Env.requireApiKey(); + + try (IosClient client = Env.client()) { + String udid = Env.resolveUdid(client); + if (udid == null) { + System.out.println("SKIP ListAppsExample: no device attached."); + return; + } + + Device device = client.device(udid); + System.out.println("Listing installed apps on " + udid + " ..."); + + // GET /device/{udid}/apps/ + List apps = device.apps().list(); + System.out.println("Found " + apps.size() + " app(s):"); + for (AppInfo app : apps) { + System.out.printf(" - %s (%s %s)%n", + app.getCfBundleIdentifier(), + app.getCfBundleName(), + app.getCfBundleShortVersionString()); + } + } + } +} diff --git a/sdks/packages/java/examples/src/com/github/danielpaulus/goios/examples/ListDevicesExample.java b/sdks/packages/java/examples/src/com/github/danielpaulus/goios/examples/ListDevicesExample.java new file mode 100644 index 000000000..32f6b79bd --- /dev/null +++ b/sdks/packages/java/examples/src/com/github/danielpaulus/goios/examples/ListDevicesExample.java @@ -0,0 +1,59 @@ +package com.github.danielpaulus.goios.examples; + +import com.github.danielpaulus.goios.Devices; +import com.github.danielpaulus.goios.IosClient; +import com.github.danielpaulus.goios.generated.model.DeviceEntry; +import com.github.danielpaulus.goios.generated.model.DeviceProperties; + +import java.util.List; + +/** + * Example 1 — list the attached devices. + * + *

The smallest useful program against the daemon: build an {@link IosClient} + * from the environment and enumerate every device the daemon can see via + * {@code GET /list}. This is also the fleet-level entry point used by the other + * examples to auto-select a device when {@code GO_IOS_UDID} is unset. + * + *

Run: + *

{@code
+ *   export GO_IOS_BASE_URL=http://localhost:8080   # optional (this is the default)
+ *   export GO_IOS_API_KEY=...                       # required
+ *   java -cp  com.github.danielpaulus.goios.examples.ListDevicesExample
+ * }
+ */ +public final class ListDevicesExample { + + private ListDevicesExample() { + } + + public static void main(String[] args) { + // Fail fast with a helpful message if the token is missing. + Env.requireApiKey(); + + // try-with-resources guarantees the underlying HTTP client is released. + try (IosClient client = Env.client()) { + String baseUrl = Env.baseUrl(); + System.out.println("Listing devices from " + + (baseUrl != null ? baseUrl : "(auto-discovered local daemon)") + " ..."); + + // GET /list -> the typed device envelope, unwrapped to a List. + List devices = client.devices().list(); + + if (devices.isEmpty()) { + System.out.println("No devices attached."); + return; + } + + System.out.println("Found " + devices.size() + " device(s):"); + for (DeviceEntry d : devices) { + // Devices.udid(d) is a null-safe accessor for properties.serialNumber. + String udid = Devices.udid(d); + DeviceProperties props = d.getProperties(); + String connType = props == null ? "?" : String.valueOf(props.getConnectionType()); + System.out.printf(" - udid=%s deviceID=%s connection=%s%n", + udid, d.getDeviceID(), connType); + } + } + } +} diff --git a/sdks/packages/java/examples/src/com/github/danielpaulus/goios/examples/ScreenshotExample.java b/sdks/packages/java/examples/src/com/github/danielpaulus/goios/examples/ScreenshotExample.java new file mode 100644 index 000000000..f4fcc2e1d --- /dev/null +++ b/sdks/packages/java/examples/src/com/github/danielpaulus/goios/examples/ScreenshotExample.java @@ -0,0 +1,47 @@ +package com.github.danielpaulus.goios.examples; + +import com.github.danielpaulus.goios.Device; +import com.github.danielpaulus.goios.IosClient; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; + +/** + * Example 4 — capture a PNG screenshot and write it to disk. + * + *

{@code device.screenshot()} performs {@code GET + * /device/{udid}/screenshot} and returns the raw {@code image/png} bytes. We + * write them to {@code ./screenshot.png} and print the file size. + * + *

Skips gracefully when no device is attached. + */ +public final class ScreenshotExample { + + /** Where the captured screenshot is written, relative to the working directory. */ + private static final Path OUTPUT = Path.of("screenshot.png"); + + private ScreenshotExample() { + } + + public static void main(String[] args) throws IOException { + Env.requireApiKey(); + + try (IosClient client = Env.client()) { + String udid = Env.resolveUdid(client); + if (udid == null) { + System.out.println("SKIP ScreenshotExample: no device attached."); + return; + } + + Device device = client.device(udid); + System.out.println("Capturing screenshot from " + udid + " ..."); + + // GET /device/{udid}/screenshot -> raw PNG bytes. + byte[] png = device.screenshot(); + + Files.write(OUTPUT, png); + System.out.printf("Wrote %d bytes to %s%n", png.length, OUTPUT.toAbsolutePath()); + } + } +} diff --git a/sdks/packages/java/examples/src/com/github/danielpaulus/goios/examples/StreamSyslogExample.java b/sdks/packages/java/examples/src/com/github/danielpaulus/goios/examples/StreamSyslogExample.java new file mode 100644 index 000000000..82ecea01f --- /dev/null +++ b/sdks/packages/java/examples/src/com/github/danielpaulus/goios/examples/StreamSyslogExample.java @@ -0,0 +1,70 @@ +package com.github.danielpaulus.goios.examples; + +import com.github.danielpaulus.goios.Device; +import com.github.danielpaulus.goios.IosClient; +import com.github.danielpaulus.goios.stream.SseEvent; +import com.github.danielpaulus.goios.stream.SseReader; +import com.github.danielpaulus.goios.stream.SyslogEvent; + +/** + * Example 5 — stream the device syslog over Server-Sent Events. + * + *

{@code device.syslog()} opens {@code GET /device/{udid}/syslog} as an + * {@link SseReader}, which is both an {@code Iterable} and an + * {@code AutoCloseable}. We iterate the typed events, printing each decoded + * {@link SyslogEvent}, and stop after roughly {@value #MAX_EVENTS} events or + * {@value #MAX_MILLIS} ms — whichever comes first — so the example terminates on + * its own. Closing the reader (via try-with-resources) cancels the underlying + * HTTP stream immediately. + * + *

Heartbeats are parsed and skipped by default, so the loop only sees real + * payload events. Any unrecognized event name would arrive as an + * {@code UnknownEvent} rather than being dropped. + * + *

Skips gracefully when no device is attached. + */ +public final class StreamSyslogExample { + + private static final int MAX_EVENTS = 20; + private static final long MAX_MILLIS = 5_000; + + private StreamSyslogExample() { + } + + public static void main(String[] args) { + Env.requireApiKey(); + + try (IosClient client = Env.client()) { + String udid = Env.resolveUdid(client); + if (udid == null) { + System.out.println("SKIP StreamSyslogExample: no device attached."); + return; + } + + Device device = client.device(udid); + System.out.printf("Streaming syslog from %s (up to %d events or %d ms) ...%n", + udid, MAX_EVENTS, MAX_MILLIS); + + long deadline = System.currentTimeMillis() + MAX_MILLIS; + int count = 0; + + // try-with-resources guarantees the stream is cancelled when we break out. + try (SseReader syslog = device.syslog()) { + for (SseEvent ev : syslog) { + // Pattern-match to the typed event to reach the decoded payload. + if (ev instanceof SyslogEvent s) { + System.out.println(" " + s.payload().getMessage()); + } else { + System.out.println(" [" + ev.eventName() + "]"); + } + count++; + if (count >= MAX_EVENTS || System.currentTimeMillis() >= deadline) { + break; // leaving the loop closes the reader and aborts the stream + } + } + } + + System.out.println("Received " + count + " syslog event(s)."); + } + } +} diff --git a/sdks/packages/java/examples/src/com/github/danielpaulus/goios/examples/UiAutomationExample.java b/sdks/packages/java/examples/src/com/github/danielpaulus/goios/examples/UiAutomationExample.java new file mode 100644 index 000000000..47f6adbe9 --- /dev/null +++ b/sdks/packages/java/examples/src/com/github/danielpaulus/goios/examples/UiAutomationExample.java @@ -0,0 +1,68 @@ +package com.github.danielpaulus.goios.examples; + +import com.github.danielpaulus.goios.Device; +import com.github.danielpaulus.goios.IosClient; + +/** + * Example 6 (OPTIONAL) — drive the UI via the WebDriverAgent backend. + * + *

The {@code /ui/*} routes require a running UI-automation backend. By + * default that is WebDriverAgent (WDA): you must have WDA installed and + * running on the device and reachable by the daemon. In the common setup you + * start (and port-forward) WDA yourself and point the daemon at it — for + * example via {@code ios runwda} plus {@code ios forward 8100 8100}, then pass + * that forwarded URL to the daemon. Because that prerequisite is environmental, + * this example is skipped unless {@code RUN_UI=1}, and even then it skips + * (rather than fails) when the backend is unreachable, so it never breaks the + * pre-release smoke test. + * + *

What it demonstrates: a {@code tap} at a coordinate followed by a + * {@code type} of some text — the two most common UI primitives. Both go + * through {@link com.github.danielpaulus.goios.Ui}; the convenience overloads + * used here rely on the daemon's default backend and timeouts. To target a + * specific forwarded WDA endpoint or the DeviceKit backend instead, pass a + * {@link com.github.danielpaulus.goios.Ui.Options} (backend / wdaUrl / timeout). + */ +public final class UiAutomationExample { + + private UiAutomationExample() { + } + + public static void main(String[] args) { + Env.requireApiKey(); + + if (!"1".equals(System.getenv("RUN_UI"))) { + System.out.println("SKIP UiAutomationExample: set RUN_UI=1 to run " + + "(requires a running/forwarded WebDriverAgent backend)."); + return; + } + + try (IosClient client = Env.client()) { + String udid = Env.resolveUdid(client); + if (udid == null) { + System.out.println("SKIP UiAutomationExample: no device attached."); + return; + } + + Device device = client.device(udid); + System.out.println("Driving UI on " + udid + " via the default (WDA) backend ..."); + + try { + // POST /device/{udid}/ui/tap — tap near the top-left of the screen. + device.ui().tap(100, 200); + + // POST /device/{udid}/ui/type — type into the focused field. + device.ui().type("hello from go-ios"); + + System.out.println("UI tap + type succeeded."); + } catch (RuntimeException e) { + // The backend being unreachable (no WDA / not forwarded) surfaces as an + // exception. Treat it as a SKIP so the optional example never fails the + // suite for an environmental reason. + System.out.println("SKIP UiAutomationExample: UI backend unreachable (" + + e.getMessage() + ")."); + System.out.println("Ensure WebDriverAgent is running and forwarded, then retry with RUN_UI=1."); + } + } + } +} diff --git a/sdks/packages/java/generated/.gitignore b/sdks/packages/java/generated/.gitignore new file mode 100644 index 000000000..a530464af --- /dev/null +++ b/sdks/packages/java/generated/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/sdks/packages/java/generated/.openapi-generator-ignore b/sdks/packages/java/generated/.openapi-generator-ignore new file mode 100644 index 000000000..7484ee590 --- /dev/null +++ b/sdks/packages/java/generated/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/sdks/packages/java/generated/.openapi-generator/FILES b/sdks/packages/java/generated/.openapi-generator/FILES new file mode 100644 index 000000000..a297c4d71 --- /dev/null +++ b/sdks/packages/java/generated/.openapi-generator/FILES @@ -0,0 +1,109 @@ +.github/workflows/maven.yml +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/com/github/danielpaulus/goios/generated/api/DefaultApi.java +src/main/java/com/github/danielpaulus/goios/generated/invoker/ApiClient.java +src/main/java/com/github/danielpaulus/goios/generated/invoker/ApiException.java +src/main/java/com/github/danielpaulus/goios/generated/invoker/ApiResponse.java +src/main/java/com/github/danielpaulus/goios/generated/invoker/Configuration.java +src/main/java/com/github/danielpaulus/goios/generated/invoker/JSON.java +src/main/java/com/github/danielpaulus/goios/generated/invoker/Pair.java +src/main/java/com/github/danielpaulus/goios/generated/invoker/RFC3339DateFormat.java +src/main/java/com/github/danielpaulus/goios/generated/invoker/ServerConfiguration.java +src/main/java/com/github/danielpaulus/goios/generated/invoker/ServerVariable.java +src/main/java/com/github/danielpaulus/goios/generated/model/AXEnabledRequest.java +src/main/java/com/github/danielpaulus/goios/generated/model/AbstractOpenApiSchema.java +src/main/java/com/github/danielpaulus/goios/generated/model/AgentShutdown.java +src/main/java/com/github/danielpaulus/goios/generated/model/AppInfo.java +src/main/java/com/github/danielpaulus/goios/generated/model/AppStateNotification.java +src/main/java/com/github/danielpaulus/goios/generated/model/AssistiveTouchState.java +src/main/java/com/github/danielpaulus/goios/generated/model/AttachDetachEvent.java +src/main/java/com/github/danielpaulus/goios/generated/model/BatteryInfo.java +src/main/java/com/github/danielpaulus/goios/generated/model/BatteryRegistry.java +src/main/java/com/github/danielpaulus/goios/generated/model/CpuUsageSample.java +src/main/java/com/github/danielpaulus/goios/generated/model/CrashListing.java +src/main/java/com/github/danielpaulus/goios/generated/model/DevModeRequest.java +src/main/java/com/github/danielpaulus/goios/generated/model/DevModeState.java +src/main/java/com/github/danielpaulus/goios/generated/model/DeviceDate.java +src/main/java/com/github/danielpaulus/goios/generated/model/DeviceEntry.java +src/main/java/com/github/danielpaulus/goios/generated/model/DeviceList.java +src/main/java/com/github/danielpaulus/goios/generated/model/DeviceName.java +src/main/java/com/github/danielpaulus/goios/generated/model/DeviceProperties.java +src/main/java/com/github/danielpaulus/goios/generated/model/DevicesGetJob404Response.java +src/main/java/com/github/danielpaulus/goios/generated/model/DiskSpaceInfo.java +src/main/java/com/github/danielpaulus/goios/generated/model/EnabledRequest.java +src/main/java/com/github/danielpaulus/goios/generated/model/FileDomain.java +src/main/java/com/github/danielpaulus/goios/generated/model/FileEntry.java +src/main/java/com/github/danielpaulus/goios/generated/model/FileListing.java +src/main/java/com/github/danielpaulus/goios/generated/model/FilePushResult.java +src/main/java/com/github/danielpaulus/goios/generated/model/ForwardRequest.java +src/main/java/com/github/danielpaulus/goios/generated/model/FsyncListing.java +src/main/java/com/github/danielpaulus/goios/generated/model/FsyncMessage.java +src/main/java/com/github/danielpaulus/goios/generated/model/FsyncPushResult.java +src/main/java/com/github/danielpaulus/goios/generated/model/FsyncTreeEntry.java +src/main/java/com/github/danielpaulus/goios/generated/model/FsyncTreeListing.java +src/main/java/com/github/danielpaulus/goios/generated/model/GenericResponse.java +src/main/java/com/github/danielpaulus/goios/generated/model/Job.java +src/main/java/com/github/danielpaulus/goios/generated/model/JobLogEvents.java +src/main/java/com/github/danielpaulus/goios/generated/model/JobLogLine.java +src/main/java/com/github/danielpaulus/goios/generated/model/JobStatus.java +src/main/java/com/github/danielpaulus/goios/generated/model/LanguageConfiguration.java +src/main/java/com/github/danielpaulus/goios/generated/model/ListenEvents.java +src/main/java/com/github/danielpaulus/goios/generated/model/MemLimitRequest.java +src/main/java/com/github/danielpaulus/goios/generated/model/MemLimitResult.java +src/main/java/com/github/danielpaulus/goios/generated/model/MountedImages.java +src/main/java/com/github/danielpaulus/goios/generated/model/NetworkInfo.java +src/main/java/com/github/danielpaulus/goios/generated/model/NotificationEvents.java +src/main/java/com/github/danielpaulus/goios/generated/model/OsTraceEntry.java +src/main/java/com/github/danielpaulus/goios/generated/model/OsTraceEvents.java +src/main/java/com/github/danielpaulus/goios/generated/model/PasteboardContent.java +src/main/java/com/github/danielpaulus/goios/generated/model/PrepareResult.java +src/main/java/com/github/danielpaulus/goios/generated/model/PrepareSkipOptions.java +src/main/java/com/github/danielpaulus/goios/generated/model/ProcessInfo.java +src/main/java/com/github/danielpaulus/goios/generated/model/Profile.java +src/main/java/com/github/danielpaulus/goios/generated/model/ProfileType.java +src/main/java/com/github/danielpaulus/goios/generated/model/ProvisioningResult.java +src/main/java/com/github/danielpaulus/goios/generated/model/RsdServiceEntry.java +src/main/java/com/github/danielpaulus/goios/generated/model/RunTestRequest.java +src/main/java/com/github/danielpaulus/goios/generated/model/SetLanguageRequest.java +src/main/java/com/github/danielpaulus/goios/generated/model/StatusOk.java +src/main/java/com/github/danielpaulus/goios/generated/model/SupervisionCert.java +src/main/java/com/github/danielpaulus/goios/generated/model/SyslogEvents.java +src/main/java/com/github/danielpaulus/goios/generated/model/SyslogMessage.java +src/main/java/com/github/danielpaulus/goios/generated/model/SysmontapEvents.java +src/main/java/com/github/danielpaulus/goios/generated/model/TimeFormatRequest.java +src/main/java/com/github/danielpaulus/goios/generated/model/TimeFormatState.java +src/main/java/com/github/danielpaulus/goios/generated/model/Tunnel.java +src/main/java/com/github/danielpaulus/goios/generated/model/TunnelStopped.java +src/main/java/com/github/danielpaulus/goios/generated/model/UIAPIRequest.java +src/main/java/com/github/danielpaulus/goios/generated/model/UIAppRequest.java +src/main/java/com/github/danielpaulus/goios/generated/model/UIButtonRequest.java +src/main/java/com/github/danielpaulus/goios/generated/model/UILongPressRequest.java +src/main/java/com/github/danielpaulus/goios/generated/model/UIOrientationRequest.java +src/main/java/com/github/danielpaulus/goios/generated/model/UISwipeRequest.java +src/main/java/com/github/danielpaulus/goios/generated/model/UITapRequest.java +src/main/java/com/github/danielpaulus/goios/generated/model/UITypeRequest.java +src/main/java/com/github/danielpaulus/goios/generated/model/UnlockToken.java +src/main/java/com/github/danielpaulus/goios/generated/model/VoiceOverState.java +src/main/java/com/github/danielpaulus/goios/generated/model/WdaConfig.java +src/main/java/com/github/danielpaulus/goios/generated/model/WdaSession.java +src/main/java/com/github/danielpaulus/goios/generated/model/WebInspectorEvalRequest.java +src/main/java/com/github/danielpaulus/goios/generated/model/WebInspectorEvalResult.java +src/main/java/com/github/danielpaulus/goios/generated/model/WebInspectorLaunchRequest.java +src/main/java/com/github/danielpaulus/goios/generated/model/WebInspectorLaunchResult.java +src/main/java/com/github/danielpaulus/goios/generated/model/WifiRequest.java +src/main/java/com/github/danielpaulus/goios/generated/model/ZoomTouchState.java diff --git a/sdks/packages/java/generated/.openapi-generator/VERSION b/sdks/packages/java/generated/.openapi-generator/VERSION new file mode 100644 index 000000000..b23eb2752 --- /dev/null +++ b/sdks/packages/java/generated/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.11.0 diff --git a/sdks/packages/java/generated/api/openapi.yaml b/sdks/packages/java/generated/api/openapi.yaml new file mode 100644 index 000000000..503949515 --- /dev/null +++ b/sdks/packages/java/generated/api/openapi.yaml @@ -0,0 +1,9527 @@ +openapi: 3.1.0 +info: + description: |- + go-ios REST API. + + This is the *ideal* contract for the go-ios REST server. It is authored + spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms + to this document (there is no backward-compatibility constraint yet). + + ## Authentication + + Every route under `/api/v1` requires a bearer token: + `Authorization: Bearer `. The server refuses to start unless + either an API key is configured or it is launched with `--disable-auth`. + + When the server is started with `--disable-auth`, authentication is **not** + enforced and the `Authorization` header may be omitted. The Swagger UI + (`/swagger/*`) is always unauthenticated and lives outside `/api/v1`, so it is + not modeled here. + + ## Device routing + + Device-scoped routes live under `/device/{udid}`. A middleware resolves the + udid: an unknown udid yields `404`, an empty udid yields `422`. The + `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request + per device). + + ## Streaming + + Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, + `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent + Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + license: + name: MIT + url: https://opensource.org/license/mit + title: go-ios REST API + version: 0.1.0 +servers: +- description: Default go-ios REST server + url: http://localhost:60105 +security: +- BearerAuth: [] +paths: + /api/v1/device/{udid}/activate: + post: + description: Activate the device (complete Setup Assistant / activation). + operationId: Devices_activate + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Activate device + x-accepts: + - application/json + /api/v1/device/{udid}/apps/: + get: + description: List installed applications. Each entry is an open Info.plist map. + operationId: Devices_listApps + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/AppInfo' + type: array + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: List apps + x-accepts: + - application/json + /api/v1/device/{udid}/apps/install: + post: + description: |- + Install an application from an uploaded `.ipa`/`.app` archive. + The multipart `file` part must be 1 byte–200 MB. + operationId: Devices_installApp + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + multipart/form-data: + encoding: + file: + contentType: '*/*' + style: form + schema: + $ref: '#/components/schemas/Devices_installApp_request' + description: Multipart body carrying the app archive to install. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Install app + x-content-type: multipart/form-data + x-accepts: + - application/json + /api/v1/device/{udid}/apps/kill: + post: + description: Kill a running application by bundle id. + operationId: Devices_killApp + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Bundle id of the app to kill. + explode: false + in: query + name: bundleID + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Kill app + x-accepts: + - application/json + /api/v1/device/{udid}/apps/launch: + post: + description: Launch an application by bundle id. + operationId: Devices_launchApp + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Bundle id of the app to launch. + explode: false + in: query + name: bundleID + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Launch app + x-accepts: + - application/json + /api/v1/device/{udid}/apps/uninstall: + post: + description: Uninstall an application by bundle id. + operationId: Devices_uninstallApp + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Bundle id of the app to uninstall. + explode: false + in: query + name: bundleID + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Uninstall app + x-accepts: + - application/json + /api/v1/device/{udid}/assistivetouch: + get: + description: "Get AssistiveTouch state (CLI: `ios assistivetouch get`)." + operationId: Devices_getAssistiveTouch + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/AssistiveTouchState' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Get AssistiveTouch + x-accepts: + - application/json + put: + description: "Enable/disable AssistiveTouch (CLI: `ios assistivetouch enable|disable`)." + operationId: Devices_setAssistiveTouch + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EnabledRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/AssistiveTouchState' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Set AssistiveTouch + x-content-type: application/json + x-accepts: + - application/json + /api/v1/device/{udid}/ax: + get: + description: |- + Get a snapshot of the currently focused accessibility element + (CLI: `ios ax`). + operationId: Accessibility_getAxSnapshot + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/AXElement' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Get accessibility element snapshot + x-accepts: + - application/json + /api/v1/device/{udid}/ax/audit: + post: + description: |- + Run the accessibility audit against the focused app and return the issues + found (CLI: `ios ax audit`). Bounded by `timeout` (seconds, default 60). + operationId: Accessibility_runAxAudit + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Audit timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/AXAuditIssue' + type: array + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Run accessibility audit + x-accepts: + - application/json + /api/v1/device/{udid}/battery: + get: + description: "Get battery diagnostics (CLI: `ios batterycheck`)." + operationId: Devices_getBattery + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/BatteryInfo' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Get battery info + x-accepts: + - application/json + /api/v1/device/{udid}/battery/registry: + get: + description: |- + Get the battery IORegistry stats (Temperature, Voltage, CurrentCapacity, + ...) via the diagnostics relay (CLI: `ios diagnostics ioregistry`). + operationId: DiagnosticsNet_getBatteryRegistry + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/BatteryRegistry' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Get battery IORegistry + x-accepts: + - application/json + /api/v1/device/{udid}/cloudconfig: + get: + description: |- + Get the device cloud configuration (supervision status, skip-setup options, + organization info). + operationId: Fsync_getCloudConfig + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/CloudConfig' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Get device cloud configuration + x-accepts: + - application/json + /api/v1/device/{udid}/conditions: + get: + description: List available condition inducer profile types. + operationId: Devices_listConditions + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/ProfileType' + type: array + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: List conditions + x-accepts: + - application/json + /api/v1/device/{udid}/crashes: + delete: + description: "Delete crash reports (CLI: `ios crash rm`)." + operationId: Devices_removeCrashes + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Working directory on the device. + explode: false + in: query + name: cwd + required: true + schema: + type: string + style: form + - description: Glob pattern of reports to delete. + explode: false + in: query + name: pattern + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Delete crash reports + x-accepts: + - application/json + get: + description: "List crash reports (CLI: `ios crash ls`)." + operationId: Devices_listCrashes + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Optional glob pattern to filter reports. + explode: false + in: query + name: pattern + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/CrashListing' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: List crash reports + x-accepts: + - application/json + /api/v1/device/{udid}/date: + get: + description: "Get the device clock (CLI: `ios date`)." + operationId: Devices_getDeviceDate + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDate' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Get device date + x-accepts: + - application/json + /api/v1/device/{udid}/devicename: + get: + description: "Get the device name (CLI: `ios devicename`)." + operationId: Devices_getDeviceName + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceName' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Get device name + x-accepts: + - application/json + /api/v1/device/{udid}/devmode: + get: + description: "Get developer mode state (CLI: `ios devmode get`)." + operationId: Devices_getDevMode + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DevModeState' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Get developer mode + x-accepts: + - application/json + post: + description: "Enable or reveal developer mode (CLI: `ios devmode enable|reveal`)." + operationId: Devices_setDevMode + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DevModeRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Set developer mode + x-content-type: application/json + x-accepts: + - application/json + /api/v1/device/{udid}/diagnostics: + get: + description: "List all IORegistry/diagnostic values (CLI: `ios diagnostics list`)." + operationId: Devices_getDiagnostics + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Diagnostics' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: List diagnostics + x-accepts: + - application/json + /api/v1/device/{udid}/disable-condition: + post: + description: Disable the currently active condition inducer profile. + operationId: Devices_disableCondition + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Disable condition + x-accepts: + - application/json + /api/v1/device/{udid}/diskspace: + get: + description: |- + Get filesystem info for the device (total/free/used bytes, block size) + via AFC (CLI: `ios diskspace`). + operationId: DiagnosticsNet_getDiskSpace + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DiskSpaceInfo' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Get disk space info + x-accepts: + - application/json + /api/v1/device/{udid}/enable-condition: + put: + description: Enable a condition inducer profile. + operationId: Devices_enableCondition + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Identifier of the condition profile type. + explode: false + in: query + name: profileTypeID + required: true + schema: + type: string + style: form + - description: Identifier of the specific profile to activate. + explode: false + in: query + name: profileID + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Enable condition + x-accepts: + - application/json + /api/v1/device/{udid}/erase: + post: + description: |- + Erase all content and settings (CLI: `ios erase`). Destructive: + requires `confirm=true`. + operationId: Devices_erase + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Must be `true` to proceed with the destructive erase. + explode: false + in: query + name: confirm + required: true + schema: + type: boolean + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Erase device + x-accepts: + - application/json + /api/v1/device/{udid}/files: + get: + description: "List a device directory (CLI: `ios file ls`)." + operationId: Devices_listFiles + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "File service domain: `app`, `app-group`, `crash` or `temp`." + explode: false + in: query + name: domain + required: true + schema: + $ref: '#/components/schemas/FileDomain' + style: form + - description: Bundle/group id for the `app`/`app-group` domains. + explode: false + in: query + name: identifier + required: false + schema: + type: string + style: form + - description: Directory path to list (defaults to `.`). + explode: false + in: query + name: path + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/FileListing' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: List files + x-accepts: + - application/json + /api/v1/device/{udid}/files/pull: + get: + description: |- + Download a file from the device, streamed as the response body + (CLI: `ios file pull`). + operationId: Devices_pullFile + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "File service domain: `app`, `app-group`, `crash` or `temp`." + explode: false + in: query + name: domain + required: true + schema: + $ref: '#/components/schemas/FileDomain' + style: form + - description: Bundle/group id for the `app`/`app-group` domains. + explode: false + in: query + name: identifier + required: false + schema: + type: string + style: form + - description: Remote file path on the device. + explode: false + in: query + name: remote + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/octet-stream: + schema: {} + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Pull file + x-accepts: + - application/json + - application/octet-stream + /api/v1/device/{udid}/files/push: + post: + description: |- + Upload the request body to a device path (CLI: `ios file push`). A + `Content-Length` header is required. + operationId: Devices_pushFile + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "File service domain: `app`, `app-group`, `crash` or `temp`." + explode: false + in: query + name: domain + required: true + schema: + $ref: '#/components/schemas/FileDomain' + style: form + - description: Bundle/group id for the `app`/`app-group` domains. + explode: false + in: query + name: identifier + required: false + schema: + type: string + style: form + - description: Destination path on the device. + explode: false + in: query + name: remote + required: true + schema: + type: string + style: form + requestBody: + content: + application/octet-stream: + schema: {} + description: Raw file bytes to upload. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/FilePushResult' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Push file + x-content-type: application/octet-stream + x-accepts: + - application/json + /api/v1/device/{udid}/fsync/ls: + get: + description: "List a device directory over AFC (CLI: `ios fsync ls`)." + operationId: Fsync_fsyncLs + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: App bundle id to scope to its container (else the media dir). + explode: false + in: query + name: bundleID + required: false + schema: + type: string + style: form + - description: Device-side path (rejects `..` elements). + explode: false + in: query + name: path + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/FsyncListing' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: List a directory over AFC + x-accepts: + - application/json + /api/v1/device/{udid}/fsync/mkdir: + post: + description: "Create a directory over AFC (CLI: `ios fsync mkdir`)." + operationId: Fsync_fsyncMkdir + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: App bundle id to scope to its container (else the media dir). + explode: false + in: query + name: bundleID + required: false + schema: + type: string + style: form + - description: Directory path to create (required). + explode: false + in: query + name: path + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/FsyncMessage' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Create a directory over AFC + x-accepts: + - application/json + /api/v1/device/{udid}/fsync/pull: + get: + description: |- + Download a file from the device over AFC (CLI: `ios fsync pull`). Returns + the raw file bytes. `path` is required. + operationId: Fsync_fsyncPull + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: App bundle id to scope to its container (else the media dir). + explode: false + in: query + name: bundleID + required: false + schema: + type: string + style: form + - description: Remote file path on the device (required). + explode: false + in: query + name: path + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/octet-stream: + schema: {} + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Download a file over AFC + x-accepts: + - application/json + - application/octet-stream + /api/v1/device/{udid}/fsync/push: + post: + description: |- + Upload a file to the device over AFC (CLI: `ios fsync push`). Accepts either + raw bytes (application/octet-stream) or a multipart form with a `file` + field. `path` is required. Bounded server-side; oversized uploads get `413`. + operationId: Fsync_fsyncPush + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: App bundle id to scope to its container (else the media dir). + explode: false + in: query + name: bundleID + required: false + schema: + type: string + style: form + - description: Destination path on the device (required). + explode: false + in: query + name: path + required: true + schema: + type: string + style: form + requestBody: + content: + application/octet-stream: + schema: {} + description: Raw file bytes to upload (application/octet-stream). + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/FsyncPushResult' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "413": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 413 — the uploaded body exceeded the server's size cap. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Upload a file over AFC + x-content-type: application/octet-stream + x-accepts: + - application/json + /api/v1/device/{udid}/fsync/rm: + delete: + description: |- + Remove a file or directory over AFC (CLI: `ios fsync rm`). Pass + `recursive=true` to delete a non-empty directory. + operationId: Fsync_fsyncRm + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: App bundle id to scope to its container (else the media dir). + explode: false + in: query + name: bundleID + required: false + schema: + type: string + style: form + - description: Path to remove (required). + explode: false + in: query + name: path + required: true + schema: + type: string + style: form + - description: Remove directory contents recursively. + explode: false + in: query + name: recursive + required: false + schema: + type: boolean + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/FsyncMessage' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Remove a file or directory over AFC + x-accepts: + - application/json + /api/v1/device/{udid}/fsync/tree: + get: + description: "Recursively list a device directory over AFC (CLI: `ios fsync\ + \ tree`)." + operationId: Fsync_fsyncTree + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: App bundle id to scope to its container (else the media dir). + explode: false + in: query + name: bundleID + required: false + schema: + type: string + style: form + - description: Device-side path (rejects `..` elements). + explode: false + in: query + name: path + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/FsyncTreeListing' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Recursively list a directory over AFC + x-accepts: + - application/json + /api/v1/device/{udid}/httpproxy: + delete: + description: "Clear the global HTTP proxy (CLI: `ios httpproxy remove`)." + operationId: Devices_removeHttpProxy + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Remove HTTP proxy + x-accepts: + - application/json + put: + description: |- + Configure a global HTTP proxy (CLI: `ios httpproxy`). Supervised: send + multipart form-data with `host`, `port`, a `p12` supervisor identity and + optional `user`/`pass`/`password` fields. + operationId: Devices_setHttpProxy + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + multipart/form-data: + encoding: + p12: + contentType: '*/*' + style: form + schema: + $ref: '#/components/schemas/Devices_setHttpProxy_request' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Set HTTP proxy (supervised) + x-content-type: multipart/form-data + x-accepts: + - application/json + /api/v1/device/{udid}/icon-layout: + get: + description: "Get the SpringBoard icon layout (CLI: `ios get-icon-layout`)." + operationId: Devices_getIconLayout + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/IconLayout' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Get icon layout + x-accepts: + - application/json + put: + description: |- + Restore a SpringBoard icon layout (CLI: `ios set-icon-layout`). Body is the + layout JSON as returned by GET. + operationId: Devices_setIconLayout + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IconLayout' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Set icon layout + x-content-type: application/json + x-accepts: + - application/json + /api/v1/device/{udid}/image: + delete: + description: "Unmount the developer disk image (CLI: `ios image unmount`)." + operationId: Devices_unmountImage + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Unmount developer image + x-accepts: + - application/json + get: + description: List the hex signatures of Developer Disk Images mounted on the + device. + operationId: Devices_listImages + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + items: + type: string + type: array + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: List mounted developer images + x-accepts: + - application/json + put: + description: |- + Mount a Developer Disk Image. + + Either let the server auto-resolve and download the correct image + (`auto=true`, optionally with `basedir`), or stream the image bytes as the + raw request body (up to 2 GiB). + operationId: Devices_mountImage + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Auto-resolve and download the matching DDI for the device. + explode: false + in: query + name: auto + required: false + schema: + type: boolean + style: form + - description: Base directory the server uses to cache/lookup DDIs when `auto=true`. + explode: false + in: query + name: basedir + required: false + schema: + type: string + style: form + requestBody: + content: + application/octet-stream: + schema: {} + description: |- + Raw Developer Disk Image bytes (used when not auto-resolving). + Content up to 2 GiB. + required: false + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Mount a developer image + x-content-type: application/octet-stream + x-accepts: + - application/json + /api/v1/device/{udid}/image/list: + get: + description: "List mounted developer image signatures (CLI: `ios image list`)." + operationId: Devices_listMountedImages + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MountedImages' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: List mounted images + x-accepts: + - application/json + /api/v1/device/{udid}/info: + get: + description: |- + Get lockdown values plus `instruments:*` keys for the device. + Returns an open dictionary of heterogeneous values. + operationId: Devices_getInfo + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceInfo' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Get device info + x-accepts: + - application/json + /api/v1/device/{udid}/ip: + get: + description: |- + Resolve the device's network addresses (MAC/IPv4/IPv6) by sniffing pcapd + (CLI: `ios ip`). + operationId: DiagnosticsNet_getDeviceIp + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/NetworkInfo' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Get device IP / network info + x-accepts: + - application/json + /api/v1/device/{udid}/jobs: + get: + description: List jobs for a device. + operationId: Devices_listJobs + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/Job' + type: array + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: List jobs + x-accepts: + - application/json + /api/v1/device/{udid}/jobs/forward: + post: + description: "Start a TCP port forward host→device as an async job (CLI: `ios\ + \ forward`)." + operationId: Devices_startForward + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ForwardRequest' + required: true + responses: + "202": + content: + application/json: + schema: + $ref: '#/components/schemas/Job' + description: "The request has been accepted for processing, but processing\ + \ has not yet completed." + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Start port forward (job) + x-content-type: application/json + x-accepts: + - application/json + /api/v1/device/{udid}/jobs/runtest: + post: + description: |- + Start an XCUITest/unit-test run as an async job (CLI: `ios runtest`). + Returns `202` with the created job. + operationId: Devices_startRunTest + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RunTestRequest' + required: true + responses: + "202": + content: + application/json: + schema: + $ref: '#/components/schemas/Job' + description: "The request has been accepted for processing, but processing\ + \ has not yet completed." + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Start test run (job) + x-content-type: application/json + x-accepts: + - application/json + /api/v1/device/{udid}/jobs/runwda: + post: + description: |- + Start the WebDriverAgent runner as an async job (CLI: `ios runwda`). Body + fields are optional and default to the standard WDA bundle id and config. + operationId: Devices_startRunWda + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RunTestRequest' + required: false + responses: + "202": + content: + application/json: + schema: + $ref: '#/components/schemas/Job' + description: "The request has been accepted for processing, but processing\ + \ has not yet completed." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Start WDA runner (job) + x-content-type: application/json + x-accepts: + - application/json + /api/v1/device/{udid}/jobs/{id}: + delete: + description: |- + Stop a running job, or purge an already-terminal one from the registry + (CLI: Ctrl-C on the equivalent command). + operationId: Devices_stopJob + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: The job id. + explode: false + in: path + name: id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Devices_getJob_404_response' + description: 404 — the requested resource (e.g. a job) was not found for + this device. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Stop or delete job + x-accepts: + - application/json + get: + description: Get a job's status. Returns `404` for an unknown job on this device. + operationId: Devices_getJob + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: The job id. + explode: false + in: path + name: id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Job' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Devices_getJob_404_response' + description: 404 — the requested resource (e.g. a job) was not found for + this device. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Get job + x-accepts: + - application/json + /api/v1/device/{udid}/jobs/{id}/logs: + get: + description: |- + Stream a job's log output as Server-Sent Events: the buffered history first, + then live lines until the job ends or the client disconnects. + operationId: Devices_streamJobLogs + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: The job id. + explode: false + in: path + name: id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + text/event-stream: + schema: + type: string + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Devices_getJob_404_response' + description: 404 — the requested resource (e.g. a job) was not found for + this device. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Stream job logs (SSE) + x-sse-events: + schema: JobLogEvents + events: + log: JobLogLine + heartbeat: Heartbeat + x-accepts: + - application/json + - text/event-stream + /api/v1/device/{udid}/lang: + get: + description: "Get the device language/locale configuration (CLI: `ios lang`)." + operationId: Devices_getLanguage + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/LanguageConfiguration' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Get language + x-accepts: + - application/json + put: + description: |- + Set the device language and/or locale (CLI: `ios lang --setlang --setlocale`). + Returns the resulting configuration. + operationId: Devices_setLanguage + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SetLanguageRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/LanguageConfiguration' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Set language + x-content-type: application/json + x-accepts: + - application/json + /api/v1/device/{udid}/listen: + get: + description: Stream device attach/detach events as Server-Sent Events. + operationId: Devices_streamListen + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + text/event-stream: + schema: + type: string + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Stream device attach/detach (SSE) + x-sse-events: + schema: ListenEvents + events: + attachdetach: AttachDetachEvent + heartbeat: Heartbeat + x-accepts: + - application/json + - text/event-stream + /api/v1/device/{udid}/lockdown: + get: + description: |- + Get lockdown values (CLI: `ios lockdown get`). Without `domain` the full set + is returned; with `domain` the values are scoped to that lockdown domain. + operationId: Devices_getLockdownValues + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Optional lockdown domain to scope the returned values. + explode: false + in: query + name: domain + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/LockdownValues' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Get lockdown values + x-accepts: + - application/json + /api/v1/device/{udid}/mdm/clear-passcode: + post: + description: |- + Clear the device passcode (CLI: `ios mdm clear-passcode`). Requires the + base64 unlock token as an additional `token` form field. + operationId: Devices_mdmClearPasscode + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + multipart/form-data: + encoding: + p12: + contentType: '*/*' + style: form + schema: + $ref: '#/components/schemas/Devices_mdmClearPasscode_request' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/StatusOk' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Clear passcode (supervised) + x-content-type: multipart/form-data + x-accepts: + - application/json + /api/v1/device/{udid}/mdm/clear-screen-time-password: + post: + description: "Clear the Screen Time password (CLI: `ios mdm clear-screen-time-password`)." + operationId: Devices_mdmClearScreenTimePassword + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + multipart/form-data: + encoding: + p12: + contentType: '*/*' + style: form + schema: + $ref: '#/components/schemas/Devices_mdmClearScreenTimePassword_request' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/StatusOk' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Clear Screen Time password (supervised) + x-content-type: multipart/form-data + x-accepts: + - application/json + /api/v1/device/{udid}/mdm/fetch-unlock-token: + post: + description: |- + Fetch the escrow unlock token, base64-encoded (CLI: + `ios mdm fetch-unlock-token`). + operationId: Devices_mdmFetchUnlockToken + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + multipart/form-data: + encoding: + p12: + contentType: '*/*' + style: form + schema: + $ref: '#/components/schemas/Devices_mdmClearScreenTimePassword_request' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UnlockToken' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Fetch unlock token (supervised) + x-content-type: multipart/form-data + x-accepts: + - application/json + /api/v1/device/{udid}/mdm/security-info: + post: + description: "Get device security info (CLI: `ios mdm security-info`)." + operationId: Devices_mdmSecurityInfo + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + multipart/form-data: + encoding: + p12: + contentType: '*/*' + style: form + schema: + $ref: '#/components/schemas/Devices_mdmClearScreenTimePassword_request' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SecurityInfo' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Get MDM security info (supervised) + x-content-type: multipart/form-data + x-accepts: + - application/json + /api/v1/device/{udid}/memlimitoff: + post: + description: |- + Waive the memory limit for a process (CLI: `ios memlimitoff`). The process + name may be given via the `process` query param or the JSON body. + operationId: Devices_memLimitOff + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Process name whose memory limit should be waived. + explode: false + in: query + name: process + required: false + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MemLimitRequest' + required: false + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MemLimitResult' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Waive memory limit + x-content-type: application/json + x-accepts: + - application/json + /api/v1/device/{udid}/mobilegestalt: + get: + description: |- + Query one or more MobileGestalt keys (CLI: `ios mobilegestalt ...`). + Pass repeated `key` query params. + operationId: Devices_getMobileGestalt + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: One or more MobileGestalt keys to query. + explode: false + in: query + name: key + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MobileGestalt' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Query MobileGestalt + x-accepts: + - application/json + /api/v1/device/{udid}/notifications: + get: + description: Stream application state-change notifications as Server-Sent Events. + operationId: Devices_streamNotifications + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + text/event-stream: + schema: + type: string + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Stream app-state notifications (SSE) + x-sse-events: + schema: NotificationEvents + events: + appstate: AppStateNotification + heartbeat: Heartbeat + x-accepts: + - application/json + - text/event-stream + /api/v1/device/{udid}/ostrace: + get: + description: |- + Stream structured os_log trace entries as Server-Sent Events. + All filters are optional and combine with AND semantics. + operationId: Devices_streamOsTrace + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Only include entries from this process id. + explode: false + in: query + name: pid + required: false + schema: + format: int32 + type: integer + style: form + - description: "Minimum log level to include (e.g. `info`, `debug`, `error`)." + explode: false + in: query + name: level + required: false + schema: + type: string + style: form + - description: Only include entries from this subsystem. + explode: false + in: query + name: subsystem + required: false + schema: + type: string + style: form + - description: Only include entries whose message matches this substring/pattern. + explode: false + in: query + name: match + required: false + schema: + type: string + style: form + - description: Exclude entries whose message matches this substring/pattern. + explode: false + in: query + name: exclude + required: false + schema: + type: string + style: form + responses: + "200": + content: + text/event-stream: + schema: + type: string + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Stream os_log trace (SSE) + x-sse-events: + schema: OsTraceEvents + events: + ostrace: OsTraceEntry + heartbeat: Heartbeat + x-accepts: + - application/json + - text/event-stream + /api/v1/device/{udid}/pair: + post: + description: |- + Pair with the device. + + For a supervised pairing (`supervised=true`) upload the supervision + identity as `p12file` (multipart) and supply the passphrase in the + `Supervision-Password` header. + + Returns `423` when the device is locked and pairing cannot proceed. + operationId: Devices_pair + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Whether this is a supervised pairing. + explode: false + in: query + name: supervised + required: true + schema: + type: boolean + style: form + - description: Supervision identity passphrase (required when supervised). + explode: false + in: header + name: Supervision-Password + required: false + schema: + type: string + style: simple + requestBody: + content: + multipart/form-data: + encoding: + p12file: + contentType: '*/*' + style: form + schema: + $ref: '#/components/schemas/Devices_pair_request' + description: |- + Multipart body carrying the supervision identity (`.p12`) when + `supervised=true`. Omit for unsupervised pairing. + required: false + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "423": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 423 — device is locked; pairing cannot proceed. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Pair device + x-content-type: multipart/form-data + x-accepts: + - application/json + /api/v1/device/{udid}/pasteboard: + get: + description: "Get the pasteboard (clipboard) text (CLI: `ios pasteboard get`)." + operationId: Devices_getPasteboard + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PasteboardContent' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Get pasteboard + x-accepts: + - application/json + put: + description: "Set the pasteboard text from the raw request body (CLI: `ios pasteboard\ + \ set`)." + operationId: Devices_setPasteboard + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + text/plain: + schema: + type: string + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Set pasteboard + x-content-type: text/plain + x-accepts: + - application/json + /api/v1/device/{udid}/pcap: + get: + description: |- + Stream a live packet capture from the device as a libpcap byte stream + (pipeable into wireshark/tshark). Runs until `timeout` (seconds) elapses, + the default timeout is reached, or the client disconnects. + operationId: Streams_pcap + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Capture duration in seconds (default 60, max 3600)." + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + responses: + "200": + content: + application/vnd.tcpdump.pcap: + schema: {} + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Stream a live pcap capture (binary) + x-accepts: + - application/json + - application/vnd.tcpdump.pcap + /api/v1/device/{udid}/prepare: + post: + description: |- + Run the device preparation/provisioning flow (CLI: `ios prepare`). Send + multipart/form-data. To supervise the device include a `cert` file + (DER/PEM/P12 supervision identity) and optional `p12password`; without a + cert the device is prepared without supervision. + operationId: Prepare_prepareDevice + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + multipart/form-data: + encoding: + cert: + contentType: '*/*' + style: form + skip: + contentType: text/plain + style: form + schema: + $ref: '#/components/schemas/Prepare_prepareDevice_request' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PrepareResult' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Prepare (and optionally supervise) a device + x-content-type: multipart/form-data + x-accepts: + - application/json + /api/v1/device/{udid}/processes: + get: + description: "List running processes (CLI: `ios ps [--apps]`)." + operationId: Devices_getProcesses + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Only return application processes. + explode: false + in: query + name: apps + required: false + schema: + type: boolean + style: form + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/ProcessInfo' + type: array + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: List processes + x-accepts: + - application/json + /api/v1/device/{udid}/profiles: + get: + description: List installed configuration profiles. Returns an open dictionary. + operationId: Devices_getProfiles + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InstalledProfiles' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: List configuration profiles + x-accepts: + - application/json + post: + description: |- + Install a configuration profile (CLI: `ios profile add`). Send the profile as + the raw request body, or as multipart with a `profile` file plus an optional + `p12` supervisor identity and `password` for a supervised install. + operationId: Devices_addProfile + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + multipart/form-data: + encoding: + profile: + contentType: '*/*' + style: form + p12: + contentType: '*/*' + style: form + schema: + $ref: '#/components/schemas/Devices_addProfile_request' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Install profile + x-content-type: multipart/form-data + x-accepts: + - application/json + /api/v1/device/{udid}/profiles/{name}: + delete: + description: "Remove a configuration profile by identifier (CLI: `ios profile\ + \ remove`)." + operationId: Devices_removeProfile + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: The profile identifier to remove. + explode: false + in: path + name: name + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Remove profile + x-accepts: + - application/json + /api/v1/device/{udid}/reboot: + post: + description: "Reboot the device (CLI: `ios reboot`)." + operationId: Devices_reboot + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Reboot device + x-accepts: + - application/json + /api/v1/device/{udid}/resetaccessibility: + post: + description: Reset accessibility settings on the device. + operationId: Devices_resetAccessibility + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Reset accessibility + x-accepts: + - application/json + /api/v1/device/{udid}/resetlocation: + post: + description: Reset the simulated location back to the device's real GPS location. + operationId: Devices_resetLocation + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Reset simulated location + x-accepts: + - application/json + /api/v1/device/{udid}/rsd: + get: + description: |- + Get the device's RSD (Remote Service Discovery) service list + (CLI: `ios rsd ls`). Requires a running tunnel (iOS 17+); devices without + RSD return `400`. + operationId: DiagnosticsNet_getRsdServices + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RsdServices' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Get RSD service list + x-accepts: + - application/json + /api/v1/device/{udid}/screenshot: + get: + description: Capture a screenshot. Returns raw PNG bytes (`image/png`). + operationId: Devices_screenshot + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + image/png: + schema: {} + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Capture screenshot + x-accepts: + - application/json + - image/png + /api/v1/device/{udid}/screenshot/stream: + get: + description: |- + Serve an MJPEG (multipart/x-mixed-replace) stream of device screenshots + captured via the instruments screenshot service. Streams until the client + disconnects or the source fails. + operationId: Streams_screenshotStream + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Optional JPEG quality (1–100, default 80)." + explode: false + in: query + name: quality + required: false + schema: + format: int32 + type: integer + style: form + responses: + "200": + content: + image/jpeg: + schema: {} + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Stream screenshots as MJPEG (binary) + x-accepts: + - application/json + - image/jpeg + /api/v1/device/{udid}/setlocation: + put: + description: |- + Simulate a GPS location on the device. + + NOTE: the longitude parameter was historically misspelled `longtitude` on + the wire. This spec fixes it to `longitude`; the go-ios server accepts + `longitude` (and may keep `longtitude` as a deprecated alias). + operationId: Devices_setLocation + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Latitude in decimal degrees. + explode: false + in: query + name: latitude + required: true + schema: + type: string + style: form + - description: Longitude in decimal degrees. + explode: false + in: query + name: longitude + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Set simulated location + x-accepts: + - application/json + /api/v1/device/{udid}/setlocation/gpx: + put: + description: |- + Simulate live location tracking from an uploaded GPX file + (CLI: `ios setlocationgpx`). Send multipart/form-data with a `gpx` file. + operationId: Accessibility_setLocationGpx + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + multipart/form-data: + encoding: + gpx: + contentType: '*/*' + style: form + schema: + $ref: '#/components/schemas/Accessibility_setLocationGpx_request' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Simulate location from a GPX file + x-content-type: multipart/form-data + x-accepts: + - application/json + /api/v1/device/{udid}/shutdown: + post: + description: "Shut down the device (CLI: `ios shutdown`)." + operationId: Devices_shutdown + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Shut down device + x-accepts: + - application/json + /api/v1/device/{udid}/syslog: + get: + description: Stream device syslog lines as Server-Sent Events. + operationId: Devices_streamSyslog + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + text/event-stream: + schema: + type: string + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Stream syslog (SSE) + x-sse-events: + schema: SyslogEvents + events: + syslog: SyslogMessage + heartbeat: Heartbeat + x-accepts: + - application/json + - text/event-stream + /api/v1/device/{udid}/sysmontap: + get: + description: "Stream CPU-usage samples as Server-Sent Events (CLI: `ios sysmontap`)." + operationId: Devices_streamSysmontap + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + text/event-stream: + schema: + type: string + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Stream CPU usage (SSE) + x-sse-events: + schema: SysmontapEvents + events: + sample: CpuUsageSample + heartbeat: Heartbeat + x-accepts: + - application/json + - text/event-stream + /api/v1/device/{udid}/timeformat: + get: + description: "Get the 24-hour clock state (CLI: `ios timeformat get`)." + operationId: Devices_getTimeFormat + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/TimeFormatState' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Get time format + x-accepts: + - application/json + put: + description: "Set 24-hour / 12-hour clock (CLI: `ios timeformat 24h|12h`)." + operationId: Devices_setTimeFormat + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TimeFormatRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/TimeFormatState' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Set time format + x-content-type: application/json + x-accepts: + - application/json + /api/v1/device/{udid}/ui/api: + post: + description: |- + Raw passthrough to the backend. For WDA supply `method`/`path`/`body`; for + DeviceKit supply `rpcMethod`/`rpcParams`. The backend response is forwarded + verbatim. + operationId: UI_uiApi + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Backend to target: `wda` (default) or `devicekit`." + explode: false + in: query + name: backend + required: false + schema: + type: string + style: form + - description: Forwarded backend base URL (defaults per backend). + explode: false + in: query + name: wdaUrl + required: false + schema: + type: string + style: form + - description: Per-request HTTP timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UIAPIRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UIResponse' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + "501": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 501 — the selected UI-automation backend does not support this + operation. + "502": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Raw backend passthrough + x-content-type: application/json + x-accepts: + - application/json + /api/v1/device/{udid}/ui/app/foreground: + post: + description: |- + Bring the backgrounded app to the foreground. Only the devicekit backend + supports this; WDA returns `501`. The request body is ignored. + operationId: UI_uiAppForeground + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Backend to target: `wda` (default) or `devicekit`." + explode: false + in: query + name: backend + required: false + schema: + type: string + style: form + - description: Forwarded backend base URL (defaults per backend). + explode: false + in: query + name: wdaUrl + required: false + schema: + type: string + style: form + - description: Per-request HTTP timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UIResponse' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + "501": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 501 — the selected UI-automation backend does not support this + operation. + "502": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Foreground app (UI backend) + x-accepts: + - application/json + /api/v1/device/{udid}/ui/app/launch: + post: + description: Launch the app identified by `bundleId`. + operationId: UI_uiAppLaunch + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Backend to target: `wda` (default) or `devicekit`." + explode: false + in: query + name: backend + required: false + schema: + type: string + style: form + - description: Forwarded backend base URL (defaults per backend). + explode: false + in: query + name: wdaUrl + required: false + schema: + type: string + style: form + - description: Per-request HTTP timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UIAppRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UIResponse' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + "501": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 501 — the selected UI-automation backend does not support this + operation. + "502": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Launch app (UI backend) + x-content-type: application/json + x-accepts: + - application/json + /api/v1/device/{udid}/ui/app/terminate: + post: + description: Terminate the app identified by `bundleId`. + operationId: UI_uiAppTerminate + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Backend to target: `wda` (default) or `devicekit`." + explode: false + in: query + name: backend + required: false + schema: + type: string + style: form + - description: Forwarded backend base URL (defaults per backend). + explode: false + in: query + name: wdaUrl + required: false + schema: + type: string + style: form + - description: Per-request HTTP timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UIAppRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UIResponse' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + "501": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 501 — the selected UI-automation backend does not support this + operation. + "502": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Terminate app (UI backend) + x-content-type: application/json + x-accepts: + - application/json + /api/v1/device/{udid}/ui/button: + post: + description: Press a hardware button by name (WDA supports only `home`). + operationId: UI_uiButton + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Backend to target: `wda` (default) or `devicekit`." + explode: false + in: query + name: backend + required: false + schema: + type: string + style: form + - description: Forwarded backend base URL (defaults per backend). + explode: false + in: query + name: wdaUrl + required: false + schema: + type: string + style: form + - description: Per-request HTTP timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UIButtonRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UIResponse' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + "501": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 501 — the selected UI-automation backend does not support this + operation. + "502": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Press hardware button + x-content-type: application/json + x-accepts: + - application/json + /api/v1/device/{udid}/ui/longpress: + post: + description: "Press and hold at (x,y)." + operationId: UI_uiLongPress + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Backend to target: `wda` (default) or `devicekit`." + explode: false + in: query + name: backend + required: false + schema: + type: string + style: form + - description: Forwarded backend base URL (defaults per backend). + explode: false + in: query + name: wdaUrl + required: false + schema: + type: string + style: form + - description: Per-request HTTP timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UILongPressRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UIResponse' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + "501": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 501 — the selected UI-automation backend does not support this + operation. + "502": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Long press + x-content-type: application/json + x-accepts: + - application/json + /api/v1/device/{udid}/ui/orientation: + get: + description: Get the current device orientation payload. + operationId: UI_uiGetOrientation + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Backend to target: `wda` (default) or `devicekit`." + explode: false + in: query + name: backend + required: false + schema: + type: string + style: form + - description: Forwarded backend base URL (defaults per backend). + explode: false + in: query + name: wdaUrl + required: false + schema: + type: string + style: form + - description: Per-request HTTP timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UIResponse' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + "501": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 501 — the selected UI-automation backend does not support this + operation. + "502": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Get orientation + x-accepts: + - application/json + put: + description: Set the device orientation. + operationId: UI_uiSetOrientation + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Backend to target: `wda` (default) or `devicekit`." + explode: false + in: query + name: backend + required: false + schema: + type: string + style: form + - description: Forwarded backend base URL (defaults per backend). + explode: false + in: query + name: wdaUrl + required: false + schema: + type: string + style: form + - description: Per-request HTTP timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UIOrientationRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UIResponse' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + "501": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 501 — the selected UI-automation backend does not support this + operation. + "502": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Set orientation + x-content-type: application/json + x-accepts: + - application/json + /api/v1/device/{udid}/ui/screenshot: + get: + description: Capture the screen and return raw PNG bytes. + operationId: UI_uiScreenshot + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Backend to target: `wda` (default) or `devicekit`." + explode: false + in: query + name: backend + required: false + schema: + type: string + style: form + - description: Forwarded backend base URL (defaults per backend). + explode: false + in: query + name: wdaUrl + required: false + schema: + type: string + style: form + - description: Per-request HTTP timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + responses: + "200": + content: + image/png: + schema: {} + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + "501": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 501 — the selected UI-automation backend does not support this + operation. + "502": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: UI screenshot (PNG) + x-accepts: + - application/json + - image/png + /api/v1/device/{udid}/ui/size: + get: + description: "Return the device window/screen size payload (typically {width,height})." + operationId: UI_uiWindowSize + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Backend to target: `wda` (default) or `devicekit`." + explode: false + in: query + name: backend + required: false + schema: + type: string + style: form + - description: Forwarded backend base URL (defaults per backend). + explode: false + in: query + name: wdaUrl + required: false + schema: + type: string + style: form + - description: Per-request HTTP timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UIResponse' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + "501": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 501 — the selected UI-automation backend does not support this + operation. + "502": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: UI window size + x-accepts: + - application/json + /api/v1/device/{udid}/ui/source: + get: + description: Return the current view hierarchy (XML for WDA; backend Content-Type + preserved). + operationId: UI_uiSource + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Backend to target: `wda` (default) or `devicekit`." + explode: false + in: query + name: backend + required: false + schema: + type: string + style: form + - description: Forwarded backend base URL (defaults per backend). + explode: false + in: query + name: wdaUrl + required: false + schema: + type: string + style: form + - description: Per-request HTTP timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + responses: + "200": + content: + application/xml: + schema: {} + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + "501": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 501 — the selected UI-automation backend does not support this + operation. + "502": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: UI source hierarchy + x-accepts: + - application/json + - application/xml + /api/v1/device/{udid}/ui/status: + get: + description: Return the backend status/health payload (WDA /status or DeviceKit + /health). + operationId: UI_uiStatus + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Backend to target: `wda` (default) or `devicekit`." + explode: false + in: query + name: backend + required: false + schema: + type: string + style: form + - description: Forwarded backend base URL (defaults per backend). + explode: false + in: query + name: wdaUrl + required: false + schema: + type: string + style: form + - description: Per-request HTTP timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UIResponse' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + "501": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 501 — the selected UI-automation backend does not support this + operation. + "502": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: UI backend status + x-accepts: + - application/json + /api/v1/device/{udid}/ui/stream: + get: + description: |- + Open a live UI video stream against a forwarded WDA/DeviceKit backend and + pipe it straight through to the client. Default codec is MJPEG + (multipart/x-mixed-replace); `codec=h264` returns an H.264 elementary + stream (requires the devicekit backend). Streams until the client + disconnects or the backend ends. + + Requires a running, forwarded WDA/DeviceKit backend (see the UI routes). + operationId: Streams_uiStream + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Backend to target: `wda` (default) or `devicekit`." + explode: false + in: query + name: backend + required: false + schema: + type: string + style: form + - description: Forwarded backend base URL (defaults per backend). + explode: false + in: query + name: wdaUrl + required: false + schema: + type: string + style: form + - description: Per-request HTTP timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + - description: "Video codec: `mjpeg` (default) or `h264` (devicekit backend\ + \ only)." + explode: false + in: query + name: codec + required: false + schema: + type: string + style: form + - description: Target frames per second (backend-dependent). + explode: false + in: query + name: fps + required: false + schema: + type: string + style: form + - description: JPEG quality for the mjpeg codec. + explode: false + in: query + name: quality + required: false + schema: + type: string + style: form + - description: Scale factor (backend-dependent). + explode: false + in: query + name: scale + required: false + schema: + type: string + style: form + - description: Target bitrate for the h264 codec. + explode: false + in: query + name: bitrate + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/octet-stream: + schema: {} + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + "501": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 501 — the selected UI-automation backend does not support this + operation. + "502": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Stream UI video (binary) + x-accepts: + - application/json + - application/octet-stream + /api/v1/device/{udid}/ui/swipe: + post: + description: "Drag from (x1,y1) to (x2,y2)." + operationId: UI_uiSwipe + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Backend to target: `wda` (default) or `devicekit`." + explode: false + in: query + name: backend + required: false + schema: + type: string + style: form + - description: Forwarded backend base URL (defaults per backend). + explode: false + in: query + name: wdaUrl + required: false + schema: + type: string + style: form + - description: Per-request HTTP timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UISwipeRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UIResponse' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + "501": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 501 — the selected UI-automation backend does not support this + operation. + "502": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Swipe + x-content-type: application/json + x-accepts: + - application/json + /api/v1/device/{udid}/ui/tap: + post: + description: Tap at absolute coordinates. + operationId: UI_uiTap + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Backend to target: `wda` (default) or `devicekit`." + explode: false + in: query + name: backend + required: false + schema: + type: string + style: form + - description: Forwarded backend base URL (defaults per backend). + explode: false + in: query + name: wdaUrl + required: false + schema: + type: string + style: form + - description: Per-request HTTP timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UITapRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UIResponse' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + "501": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 501 — the selected UI-automation backend does not support this + operation. + "502": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Tap + x-content-type: application/json + x-accepts: + - application/json + /api/v1/device/{udid}/ui/type: + post: + description: Send text as keyboard input. + operationId: UI_uiType + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: "Backend to target: `wda` (default) or `devicekit`." + explode: false + in: query + name: backend + required: false + schema: + type: string + style: form + - description: Forwarded backend base URL (defaults per backend). + explode: false + in: query + name: wdaUrl + required: false + schema: + type: string + style: form + - description: Per-request HTTP timeout in seconds (default 60). + explode: false + in: query + name: timeout + required: false + schema: + format: int32 + type: integer + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UITypeRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UIResponse' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + "501": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 501 — the selected UI-automation backend does not support this + operation. + "502": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Type text + x-content-type: application/json + x-accepts: + - application/json + /api/v1/device/{udid}/voiceover: + get: + description: "Get VoiceOver enabled state (CLI: `ios voiceover get`)." + operationId: Accessibility_getVoiceOver + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/VoiceOverState' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Get VoiceOver state + x-accepts: + - application/json + put: + description: |- + Enable/disable VoiceOver (CLI: `ios voiceover enable|disable`). The desired + state comes from the JSON body or the `enabled` query param. + operationId: Accessibility_setVoiceOver + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Desired state (alternative to the request body). + explode: false + in: query + name: enabled + required: false + schema: + type: boolean + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AXEnabledRequest' + required: false + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/VoiceOverState' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Set VoiceOver state + x-content-type: application/json + x-accepts: + - application/json + /api/v1/device/{udid}/wallpaper: + get: + description: "Get the home-screen wallpaper as PNG (CLI: `ios get-wallpaper`)." + operationId: Devices_getWallpaper + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + image/png: + schema: {} + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Get wallpaper + x-accepts: + - application/json + - image/png + put: + description: |- + Set the wallpaper (CLI: `ios set-wallpaper`). Supervised: upload the image + and a `.p12` supervisor identity as multipart form-data. + operationId: Devices_setWallpaper + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + multipart/form-data: + encoding: + image: + contentType: '*/*' + style: form + p12: + contentType: '*/*' + style: form + schema: + $ref: '#/components/schemas/Devices_setWallpaper_request' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Set wallpaper (supervised) + x-content-type: multipart/form-data + x-accepts: + - application/json + /api/v1/device/{udid}/wda/session: + post: + description: Start a WebDriverAgent (XCUITest) session. + operationId: Devices_createWdaSession + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WdaConfig' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/WdaSession' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Start WDA session + x-content-type: application/json + x-accepts: + - application/json + /api/v1/device/{udid}/wda/session/{sessionId}: + delete: + description: Stop a running WebDriverAgent session. + operationId: Devices_deleteWdaSession + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: The WDA session id. + explode: false + in: path + name: sessionId + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/WdaSession' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Devices_getJob_404_response' + description: 404 — WDA session id not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Stop WDA session + x-accepts: + - application/json + get: + description: Get a running WebDriverAgent session. Returns `404` for an unknown + session. + operationId: Devices_getWdaSession + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: The WDA session id. + explode: false + in: path + name: sessionId + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/WdaSession' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Devices_getJob_404_response' + description: 404 — WDA session id not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Get WDA session + x-accepts: + - application/json + /api/v1/device/{udid}/webinspector/eval: + post: + description: |- + Evaluate JavaScript in an inspectable page and return the result + (CLI: `ios webinspector eval`). `404` when no matching page exists. + operationId: WebInspector_webInspectorEval + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WebInspectorEvalRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/WebInspectorEvalResult' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Devices_getJob_404_response' + description: 404 — the requested resource (e.g. a job) was not found for + this device. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "424": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: |- + 424 — a device-side prerequisite is missing. Used by the WebInspector routes + when Web Inspector / Remote Automation is not enabled on the device. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Evaluate JavaScript in a page + x-content-type: application/json + x-accepts: + - application/json + /api/v1/device/{udid}/webinspector/launch: + post: + description: |- + Open a URL in a new inspectable page via a remote automation session + (CLI: `ios webinspector launch `). `url` may be a query param or in + the body; `bundleId` defaults to Safari. + operationId: WebInspector_webInspectorLaunch + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: URL to open (alternative to the request body). + explode: false + in: query + name: url + required: false + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WebInspectorLaunchRequest' + required: false + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/WebInspectorLaunchResult' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "424": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: |- + 424 — a device-side prerequisite is missing. Used by the WebInspector routes + when Web Inspector / Remote Automation is not enabled on the device. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Open a URL in a new inspectable page + x-content-type: application/json + x-accepts: + - application/json + /api/v1/device/{udid}/webinspector/pages: + get: + description: "List inspectable pages reported by the device (CLI: `ios webinspector\ + \ list`)." + operationId: WebInspector_webInspectorPages + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/WebInspectorPage' + type: array + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "424": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: |- + 424 — a device-side prerequisite is missing. Used by the WebInspector routes + when Web Inspector / Remote Automation is not enabled on the device. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: List inspectable pages + x-accepts: + - application/json + /api/v1/device/{udid}/wifi: + delete: + description: "Remove a provisioned wifi network (CLI: `ios wifi --remove`)." + operationId: Devices_removeWifi + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: SSID of the network to remove. + explode: false + in: query + name: ssid + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Remove wifi + x-accepts: + - application/json + put: + description: "Provision a wifi network (CLI: `ios wifi`)." + operationId: Devices_setWifi + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WifiRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Provision wifi + x-content-type: application/json + x-accepts: + - application/json + /api/v1/device/{udid}/zoom: + get: + description: "Get ZoomTouch enabled state (CLI: `ios zoomtouch get`)." + operationId: Accessibility_getZoomTouch + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ZoomTouchState' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Get ZoomTouch state + x-accepts: + - application/json + put: + description: |- + Enable/disable ZoomTouch (CLI: `ios zoomtouch enable|disable`). The desired + state comes from the JSON body or the `enabled` query param. + operationId: Accessibility_setZoomTouch + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + - description: Desired state (alternative to the request body). + explode: false + in: query + name: enabled + required: false + schema: + type: boolean + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AXEnabledRequest' + required: false + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ZoomTouchState' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 404 — device (udid) not found. + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 422 — empty/invalid udid. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Set ZoomTouch state + x-content-type: application/json + x-accepts: + - application/json + /api/v1/list: + get: + description: List all attached / reachable devices. + operationId: listDevices + parameters: [] + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceList' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: List devices + x-accepts: + - application/json + /api/v1/prepare/create-cert: + post: + description: |- + Generate a self-signed supervision identity (CLI: `ios prepare create-cert`) + and return the DER (base64) and PEM for both the certificate and private key. + Host-scoped (device-free). + operationId: prepareCreateCert + parameters: [] + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SupervisionCert' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Generate a supervision certificate + x-accepts: + - application/json + /api/v1/prepare/skip-options: + get: + description: |- + List all setup-pane skip options usable when preparing a device + (CLI: `ios prepare printskip`). Static, device-free list. + operationId: getPrepareSkipOptions + parameters: [] + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PrepareSkipOptions' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: List setup skip options + x-accepts: + - application/json + /api/v1/sign/app: + post: + description: |- + Resign an uploaded app/IPA with an uploaded P12 identity and provisioning + profile, returning the signed IPA. Synchronous. Host-scoped. + operationId: signApp + parameters: [] + requestBody: + content: + multipart/form-data: + encoding: + ipa: + contentType: '*/*' + style: form + p12file: + contentType: '*/*' + style: form + profile: + contentType: '*/*' + style: form + schema: + $ref: '#/components/schemas/signApp_request' + required: true + responses: + "200": + content: + application/octet-stream: + schema: {} + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + summary: Resign an app/IPA + x-content-type: multipart/form-data + x-accepts: + - application/json + - application/octet-stream + /api/v1/sign/certificate: + post: + description: |- + Create one App Store Connect signing certificate and return its P12 + (certificate + private key) as a downloadable `application/x-pkcs12` file. The + P12 password is echoed in the `X-P12-Password` response header and the + certificate resource id in `X-Certificate-Id`. Host-scoped (device-free). + operationId: signCertificate + parameters: [] + requestBody: + content: + multipart/form-data: + encoding: + asc-private-key: + contentType: '*/*' + style: form + schema: + $ref: '#/components/schemas/signCertificate_request' + required: true + responses: + "200": + content: + application/x-pkcs12: + schema: {} + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + "502": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Create a signing certificate + x-content-type: multipart/form-data + x-accepts: + - application/json + - application/x-pkcs12 + /api/v1/sign/provision: + post: + description: |- + Create a bundle id, development certificate and provisioning profile via App + Store Connect and return both artifacts base64-encoded in a JSON envelope. + The target device udid is supplied as a form field. Host-scoped. + operationId: signProvision + parameters: [] + requestBody: + content: + multipart/form-data: + encoding: + asc-private-key: + contentType: '*/*' + style: form + schema: + $ref: '#/components/schemas/signProvision_request' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ProvisioningResult' + description: The request has succeeded. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: "400 — malformed request (missing required query/body, bad\ + \ payload)." + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 500 — internal error while talking to the device. + "502": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Create a provisioning profile + P12 + x-content-type: multipart/form-data + x-accepts: + - application/json + /api/v1/tunnel-agent/shutdown: + post: + description: "Shut down the tunnel agent (CLI: `ios tunnel stopagent`)." + operationId: shutdownTunnelAgent + parameters: [] + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/AgentShutdown' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "502": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Shut down tunnel agent + x-accepts: + - application/json + /api/v1/tunnels: + get: + description: "List running device tunnels (CLI: `ios tunnel ls`)." + operationId: listTunnels + parameters: [] + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/Tunnel' + type: array + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "502": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: List tunnels + x-accepts: + - application/json + /api/v1/tunnels/{udid}: + delete: + description: "Stop the tunnel for a device (CLI: `ios tunnel stop --udid`)." + operationId: stopTunnel + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/TunnelStopped' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "502": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Stop tunnel + x-accepts: + - application/json + /api/v1/tunnels/{udid}/refresh: + post: + description: |- + Restart the tunnel for a device and wait for it to come up + (CLI: `ios tunnel refresh`). + operationId: refreshTunnel + parameters: + - explode: false + in: path + name: udid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Tunnel' + description: The request has succeeded. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 401 — missing/invalid bearer token (when auth is enabled). + "502": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericResponse' + description: 502 — the tunnel agent could not be reached or returned an + error. + summary: Refresh tunnel + x-accepts: + - application/json +components: + schemas: + AXAuditIssue: + description: |- + One accessibility audit issue (`accessibility.AXAuditIssue`) from + `POST /device/{udid}/ax/audit`. Open map — shape depends on the audit type. + type: object + AXElement: + description: |- + `GET /device/{udid}/ax` — a snapshot of the currently focused accessibility + element. Open map (backend-defined element attributes). + type: object + AXEnabledRequest: + description: |- + Body for the accessibility toggle PUTs (`/voiceover`, `/zoom`). The desired + state may also be supplied as an `enabled` query param; a parseable body wins. + example: + enabled: true + properties: + enabled: + type: boolean + required: + - enabled + AgentShutdown: + description: '`POST /tunnel-agent/shutdown` — acknowledgement.' + example: + status: status + properties: + status: + description: Always `agent shutdown requested`. + type: string + required: + - status + AppInfo: + description: |- + Installed application metadata. This is an open map: keys come straight from + the app's Info.plist. Common keys are surfaced for discoverability but any + additional keys may be present. + example: + Path: Path + CFBundleShortVersionString: CFBundleShortVersionString + UIFileSharingEnabled: true + CFBundleIdentifier: CFBundleIdentifier + CFBundleName: CFBundleName + CFBundleExecutable: CFBundleExecutable + properties: + CFBundleIdentifier: + type: string + CFBundleExecutable: + type: string + CFBundleName: + type: string + CFBundleShortVersionString: + type: string + Path: + type: string + UIFileSharingEnabled: + type: boolean + AppStateNotification: + description: An app foreground/background/lifecycle state change. + properties: + bundleId: + description: Bundle id of the app whose state changed. + type: string + state: + description: |- + New application state. + Typical values: `foreground`, `background`, `suspended`, `terminated`, + `unknown`. + type: string + timestamp: + description: Unix epoch milliseconds when the change was observed. + format: int64 + type: integer + required: + - bundleId + - state + AssistiveTouchState: + description: "`GET /device/{udid}/assistivetouch` — AssistiveTouch state." + example: + AssistiveTouchEnabled: true + properties: + AssistiveTouchEnabled: + type: boolean + required: + - AssistiveTouchEnabled + AttachDetachEvent: + description: A device was attached to or detached from the host. + properties: + event: + description: |- + Event kind. + `attached` when a device connects, `detached` when it disconnects, + `paired` when a pairing record appears. + type: string + deviceID: + description: usbmuxd device id. + format: int32 + type: integer + udid: + description: "The device udid (serial number), when known." + type: string + properties: + $ref: '#/components/schemas/DeviceProperties' + required: + - event + BatteryInfo: + description: |- + `GET /device/{udid}/battery` — battery diagnostics (`ios.BatteryInfo`). + Open map; commonly-present keys are surfaced for discoverability. + example: + FullyCharged: true + Temperature: 6 + IsCharging: true + CurrentCapacity: 0 + ExternalConnected: true + properties: + CurrentCapacity: + format: int32 + type: integer + ExternalConnected: + type: boolean + FullyCharged: + type: boolean + IsCharging: + type: boolean + Temperature: + format: int32 + type: integer + BatteryRegistry: + description: |- + `GET /device/{udid}/battery/registry` — battery IORegistry stats + (`diagnostics.IORegistry`). Open map; common keys surfaced. + example: + FullyCharged: true + Temperature: 0 + Voltage: 6 + InstantAmperage: 5 + IsCharging: true + CurrentCapacity: 1 + properties: + Temperature: + format: int32 + type: integer + Voltage: + format: int32 + type: integer + CurrentCapacity: + format: int32 + type: integer + InstantAmperage: + format: int64 + type: integer + IsCharging: + type: boolean + FullyCharged: + type: boolean + CloudConfig: + description: |- + `GET /device/{udid}/cloudconfig` — the device cloud configuration + (`mcinstall` GetCloudConfiguration): supervision status, skip-setup options + and organization info. Open map. + type: object + CpuUsageSample: + description: A single sysmontap CPU-usage sample. Open map; sampler keys vary + by OS. + properties: + CPU_TotalLoad: + description: Total CPU load across all cores (0–100). + format: double + type: number + SystemLoad: + description: System (kernel) CPU load. + format: double + type: number + UserLoad: + description: User CPU load. + format: double + type: number + CrashListing: + description: "`GET /device/{udid}/crashes` — crash report names." + example: + count: 0 + files: + - files + - files + properties: + files: + items: + type: string + type: array + count: + format: int32 + type: integer + required: + - count + - files + DevModeRequest: + description: "`POST /device/{udid}/devmode` request." + example: + action: action + enablePostRestart: true + properties: + action: + description: "`enable` to turn developer mode on, `reveal` to expose the\ + \ settings menu." + type: string + enablePostRestart: + description: "When enabling, also arm developer mode to persist across the\ + \ next reboot." + type: boolean + required: + - action + DevModeState: + description: "`GET /device/{udid}/devmode` — developer mode state." + example: + DeveloperModeEnabled: true + properties: + DeveloperModeEnabled: + type: boolean + required: + - DeveloperModeEnabled + DeviceDate: + description: "`GET /device/{udid}/date`." + example: + TimeIntervalSince1970: 0.8008281904610115 + formatedDate: formatedDate + properties: + formatedDate: + description: Human-readable RFC850 date on the device. + type: string + TimeIntervalSince1970: + description: Device clock as Unix epoch seconds. + format: double + type: number + required: + - TimeIntervalSince1970 + - formatedDate + DeviceEntry: + description: A single device as returned by `GET /list`. + example: + address: address + messageType: messageType + userspaceTUNPort: 2 + userspaceTUN: true + userspaceTUNHost: userspaceTUNHost + deviceID: 0 + properties: + serialNumber: serialNumber + productID: 5 + locationID: 5 + connectionSpeed: 6 + connectionType: connectionType + deviceID: 1 + properties: + deviceID: + format: int32 + type: integer + messageType: + type: string + properties: + $ref: '#/components/schemas/DeviceProperties' + address: + description: Network address for a device reached over the network / tunnel. + type: string + userspaceTUN: + description: True if reachable via the userspace TUN tunnel. + type: boolean + userspaceTUNHost: + type: string + userspaceTUNPort: + format: int32 + type: integer + required: + - deviceID + - properties + DeviceInfo: + description: |- + `GET /device/{udid}/info` — lockdown values plus `instruments:*` keys. + Open dictionary; values are heterogeneous. + type: object + DeviceList: + description: Response of `GET /list`. + example: + deviceList: + - address: address + messageType: messageType + userspaceTUNPort: 2 + userspaceTUN: true + userspaceTUNHost: userspaceTUNHost + deviceID: 0 + properties: + serialNumber: serialNumber + productID: 5 + locationID: 5 + connectionSpeed: 6 + connectionType: connectionType + deviceID: 1 + - address: address + messageType: messageType + userspaceTUNPort: 2 + userspaceTUN: true + userspaceTUNHost: userspaceTUNHost + deviceID: 0 + properties: + serialNumber: serialNumber + productID: 5 + locationID: 5 + connectionSpeed: 6 + connectionType: connectionType + deviceID: 1 + properties: + deviceList: + items: + $ref: '#/components/schemas/DeviceEntry' + type: array + required: + - deviceList + DeviceName: + description: "`GET /device/{udid}/devicename`." + example: + devicename: devicename + properties: + devicename: + type: string + required: + - devicename + DeviceProperties: + description: Low-level device properties reported by usbmuxd / lockdown. + example: + serialNumber: serialNumber + productID: 5 + locationID: 5 + connectionSpeed: 6 + connectionType: connectionType + deviceID: 1 + properties: + connectionSpeed: + format: int32 + type: integer + connectionType: + type: string + deviceID: + format: int32 + type: integer + locationID: + format: int32 + type: integer + productID: + format: int32 + type: integer + serialNumber: + description: The device udid (serial number). This is what device-scoped + routes key on. + type: string + required: + - serialNumber + Diagnostics: + description: "`GET /device/{udid}/diagnostics` — all IORegistry/diagnostic values.\ + \ Open map." + type: object + DiskSpaceInfo: + description: |- + `GET /device/{udid}/diskspace` — AFC filesystem info (`afc.DeviceInfo`). + Total/free/used bytes and block size. Open map; common keys surfaced. + example: + Model: Model + FSBlockSize: 1 + FSFreeBytes: 6 + FSTotalBytes: 0 + properties: + FSTotalBytes: + description: Total filesystem capacity in bytes. + format: int64 + type: integer + FSFreeBytes: + description: Free filesystem space in bytes. + format: int64 + type: integer + FSBlockSize: + description: Filesystem block size in bytes. + format: int64 + type: integer + Model: + description: AFC model identifier reported by the device. + type: string + EnabledRequest: + description: Request body for the `enabled`-toggle settings endpoints. + example: + enabled: true + properties: + enabled: + type: boolean + required: + - enabled + FileDomain: + anyOf: + - type: string + - enum: + - app + - app-group + - crash + - temp + type: string + description: Domain of the on-device file service. + FileEntry: + description: A single entry in a device directory listing. + example: + path: path + size: 0 + name: name + isDir: true + properties: + name: + type: string + path: + type: string + isDir: + type: boolean + size: + format: int64 + type: integer + FileListing: + description: "`GET /device/{udid}/files` — directory listing." + example: + path: path + count: 6 + files: + - path: path + size: 0 + name: name + isDir: true + - path: path + size: 0 + name: name + isDir: true + properties: + path: + type: string + files: + items: + $ref: '#/components/schemas/FileEntry' + type: array + count: + format: int32 + type: integer + required: + - count + - files + - path + FilePushResult: + description: "`POST /device/{udid}/files/push` — acknowledgement." + example: + size: 0 + remote: remote + properties: + remote: + type: string + size: + format: int64 + type: integer + required: + - remote + - size + ForwardRequest: + description: "`POST /device/{udid}/jobs/forward` request." + example: + hostPort: 0 + targetPort: 6 + properties: + hostPort: + description: Local (host) TCP port to listen on. + format: uint16 + type: integer + targetPort: + description: Device TCP port to forward to. + format: uint16 + type: integer + required: + - hostPort + - targetPort + FsyncListing: + description: "`GET /device/{udid}/fsync/ls` — a directory listing over AFC." + example: + path: path + count: 0 + files: + - files + - files + properties: + path: + description: The listed (cleaned) device path. + type: string + files: + description: File/directory names in the listed directory. + items: + type: string + type: array + count: + description: Number of entries. + format: int32 + type: integer + required: + - count + - files + - path + FsyncMessage: + description: |- + `POST /device/{udid}/fsync/mkdir` and `DELETE /device/{udid}/fsync/rm` — + simple message + path acknowledgement. + example: + path: path + message: message + properties: + message: + description: "Human-readable result message (e.g. `created`, `removed`)." + type: string + path: + description: The (cleaned) device path acted on. + type: string + required: + - message + - path + FsyncPushResult: + description: "`POST /device/{udid}/fsync/push` — result of an upload over AFC." + example: + path: path + size: 0 + properties: + path: + description: Destination device path written. + type: string + size: + description: Number of bytes written. + format: int64 + type: integer + required: + - path + - size + FsyncTreeEntry: + description: "One entry returned by the recursive `GET /device/{udid}/fsync/tree`\ + \ walk." + example: + path: path + size: 0 + name: name + isDir: true + properties: + path: + description: Full device-side path of this entry. + type: string + name: + description: Base name of the entry. + type: string + isDir: + description: Whether the entry is a directory. + type: boolean + size: + description: Size in bytes. + format: int64 + type: integer + required: + - isDir + - name + - path + - size + FsyncTreeListing: + description: "`GET /device/{udid}/fsync/tree` — a recursive directory walk over\ + \ AFC." + example: + path: path + entries: + - path: path + size: 0 + name: name + isDir: true + - path: path + size: 0 + name: name + isDir: true + count: 6 + properties: + path: + description: The root (cleaned) device path. + type: string + entries: + description: Flattened list of entries in the subtree. + items: + $ref: '#/components/schemas/FsyncTreeEntry' + type: array + count: + description: Number of entries. + format: int32 + type: integer + required: + - count + - entries + - path + GenericResponse: + description: |- + The dominant response envelope used across the API. Success responses set + `message`; error responses set `error`. Streaming/middleware paths that emit + `gin.H{"error"|"message"}` are compatible with this shape. + example: + message: message + error: error + properties: + message: + description: Human-readable success or status message. + type: string + error: + description: Human-readable error message. Present on failures. + type: string + Heartbeat: + description: Periodic keep-alive frame emitted on every stream. Payload is empty. + type: object + IconLayout: + description: "`GET /device/{udid}/icon-layout` — SpringBoard icon layout. Open\ + \ structure." + type: object + InstalledProfiles: + description: |- + `GET /device/{udid}/profiles` — installed configuration profiles. + Open dictionary; values are heterogeneous. + type: object + Job: + description: |- + A long-running operation started via the REST API (test run, WDA runner, + port forward). Mirrors the server's `jobView`. + example: + result: "" + kind: kind + startedAt: 2000-01-23T04:56:07.000+00:00 + id: id + udid: udid + error: error + status: JobStatus + finishedAt: 2000-01-23T04:56:07.000+00:00 + properties: + id: + description: "Opaque job id, e.g. `runtest-3`." + type: string + kind: + description: "Job kind: `runtest`, `runwda` or `forward`." + type: string + udid: + description: The device udid the job runs on. + type: string + status: + $ref: '#/components/schemas/JobStatus' + startedAt: + description: When the job started (ISO-8601). + format: date-time + type: string + finishedAt: + description: When the job reached a terminal state (absent while running). + format: date-time + type: string + error: + description: Error message when `status` is `failed`. + type: string + result: {} + required: + - id + - kind + - startedAt + - status + - udid + JobLogEvents: + anyOf: + - $ref: '#/components/schemas/JobLogLine' + - $ref: '#/components/schemas/Heartbeat' + JobLogLine: + description: A single line of a job's log output. + properties: + line: + description: The raw log line (already newline-terminated in the buffer). + type: string + required: + - line + JobStatus: + anyOf: + - type: string + - enum: + - running + - succeeded + - failed + - stopped + type: string + description: Job lifecycle state. + LanguageConfiguration: + description: |- + Language/locale configuration (`ios.LanguageConfiguration`), returned by + `GET/PUT /device/{udid}/lang`. + example: + Locale: Locale + SupportedLanguages: + - SupportedLanguages + - SupportedLanguages + Language: Language + SupportedLocales: + - SupportedLocales + - SupportedLocales + properties: + Language: + type: string + Locale: + type: string + SupportedLocales: + description: Supported locales advertised by the device. + items: + type: string + type: array + SupportedLanguages: + description: Supported UI languages advertised by the device. + items: + type: string + type: array + ListenEvents: + anyOf: + - $ref: '#/components/schemas/AttachDetachEvent' + - $ref: '#/components/schemas/Heartbeat' + LockdownValues: + description: "`GET /device/{udid}/lockdown` — all lockdown values. Open map." + type: object + MemLimitRequest: + description: "`POST /device/{udid}/memlimitoff` request." + example: + process: process + properties: + process: + description: Process name whose memory limit should be waived. + type: string + required: + - process + MemLimitResult: + description: "`POST /device/{udid}/memlimitoff` response." + example: + process: process + pid: 0 + disabled: true + properties: + process: + type: string + pid: + format: int32 + type: integer + disabled: + type: boolean + required: + - disabled + - pid + - process + MobileGestalt: + description: "`GET /device/{udid}/mobilegestalt` — queried MobileGestalt keys.\ + \ Open map." + type: object + MountedImages: + description: "`GET /device/{udid}/image/list` — mounted DDI signatures." + example: + count: 0 + signatures: + - signatures + - signatures + properties: + signatures: + description: Hex-encoded image signatures. + items: + type: string + type: array + count: + format: int32 + type: integer + required: + - count + - signatures + NetworkInfo: + description: |- + `GET /device/{udid}/ip` — device network info discovered over pcapd + (`pcap.NetworkInfo`). + example: + IPv6: IPv6 + IPv4: IPv4 + MacAddress: MacAddress + properties: + MacAddress: + description: Hardware (MAC) address. + type: string + IPv4: + description: "IPv4 address, when discovered." + type: string + IPv6: + description: "IPv6 address, when discovered." + type: string + NotificationEvents: + anyOf: + - $ref: '#/components/schemas/AppStateNotification' + - $ref: '#/components/schemas/Heartbeat' + OsTraceEntry: + description: A structured os_log trace entry. + properties: + pid: + description: Process id that emitted the entry. + format: int32 + type: integer + processName: + description: Emitting process/executable name. + type: string + level: + description: "Log level, e.g. `default`, `info`, `debug`, `error`, `fault`." + type: string + subsystem: + description: Subsystem string (e.g. `com.apple.network`). + type: string + category: + description: Category within the subsystem. + type: string + message: + description: The formatted log message. + type: string + timestamp: + description: "Unix epoch milliseconds when the entry was emitted, if known." + format: int64 + type: integer + required: + - message + OsTraceEvents: + anyOf: + - $ref: '#/components/schemas/OsTraceEntry' + - $ref: '#/components/schemas/Heartbeat' + PasteboardContent: + description: "`GET /device/{udid}/pasteboard` — clipboard contents." + example: + text: text + present: true + properties: + present: + description: Whether any text was present on the pasteboard. + type: boolean + text: + description: The clipboard text (empty when `present` is false). + type: string + required: + - present + - text + PrepareResult: + description: "`POST /device/{udid}/prepare` — device preparation acknowledgement." + example: + supervised: true + status: status + properties: + status: + description: Always `prepared`. + type: string + supervised: + description: Whether the device was supervised (a supervision cert was supplied). + type: boolean + required: + - status + - supervised + PrepareSkipOptions: + description: |- + `GET /prepare/skip-options` — the static list of setup-pane skip options + usable when preparing a device. Host-scoped (device-free). + example: + options: + - options + - options + count: 0 + properties: + options: + description: All available skip-option identifiers. + items: + type: string + type: array + count: + description: Number of options. + format: int32 + type: integer + required: + - count + - options + ProcessInfo: + description: |- + A running process entry (`instruments.ProcessInfo`) from + `GET /device/{udid}/processes`. + example: + name: name + pid: 0 + isApplication: true + startDate: 2000-01-23T04:56:07.000+00:00 + realAppName: realAppName + properties: + pid: + format: int32 + type: integer + name: + type: string + realAppName: + type: string + isApplication: + type: boolean + startDate: + description: "Process start time, ISO-8601." + format: date-time + type: string + required: + - name + - pid + Profile: + description: A single condition profile within a `ProfileType`. + example: + identifier: identifier + name: name + description: description + properties: + description: + type: string + identifier: + type: string + name: + type: string + required: + - identifier + - name + ProfileType: + description: "A condition inducer profile type (e.g. thermal, network) with\ + \ its variants." + example: + isInternal: true + identifier: identifier + activeProfile: activeProfile + name: name + profiles: + - identifier: identifier + name: name + description: description + - identifier: identifier + name: name + description: description + isDestructive: true + profilesSorted: true + isActive: true + properties: + activeProfile: + type: string + identifier: + type: string + profilesSorted: + type: boolean + isActive: + type: boolean + name: + type: string + isDestructive: + type: boolean + isInternal: + type: boolean + profiles: + items: + $ref: '#/components/schemas/Profile' + type: array + required: + - identifier + - name + - profiles + ProvisioningResult: + description: |- + `POST /sign/provision` — provisioning assets envelope. The mobileprovision + (and optionally the P12) are base64-encoded so one JSON response can carry + both binary artifacts. Host-scoped (device-free). + example: + p12Password: p12Password + certificateId: certificateId + bundleId: bundleId + mobileprovisionBase64: mobileprovisionBase64 + p12Base64: p12Base64 + properties: + bundleId: + description: The app bundle identifier registered with App Store Connect. + type: string + certificateId: + description: The signing certificate resource id. + type: string + mobileprovisionBase64: + description: "The `.mobileprovision`, base64-encoded." + type: string + p12Base64: + description: "The generated `.p12`, base64-encoded (absent when reusing\ + \ a certificate)." + type: string + p12Password: + description: "The password protecting `p12Base64`, echoed back (client-supplied)." + type: string + required: + - bundleId + - certificateId + - mobileprovisionBase64 + RsdServiceEntry: + description: A single RSD (Remote Service Discovery) service entry. + properties: + Port: + description: TCP port the service is reachable on over the tunnel. + format: int32 + type: integer + ProtocolType: + description: Wire protocol (e.g. `tcp`). + type: string + RsdServices: + description: |- + `GET /device/{udid}/rsd` — the device's Remote Service Discovery service list + keyed by service name. Requires a running tunnel (iOS 17+); devices without + RSD return `400`. + type: object + RunTestRequest: + description: "`POST /device/{udid}/jobs/runtest` (and `runwda`) request." + example: + args: + - args + - args + xctestConfig: xctestConfig + testsToSkip: + - testsToSkip + - testsToSkip + xctest: true + testRunnerBundleId: testRunnerBundleId + bundleId: bundleId + env: "{}" + testsToRun: + - testsToRun + - testsToRun + properties: + bundleId: + description: Bundle id of the app under test. + type: string + testRunnerBundleId: + description: Bundle id of the test runner. Defaults to `bundleId` if omitted. + type: string + xctestConfig: + description: Name of the `.xctestconfiguration`. + type: string + env: + description: Extra environment variables for the test runner. + type: object + args: + description: Extra process arguments for the test runner. + items: + type: string + type: array + testsToRun: + description: Only run these tests (`Class/method` identifiers). + items: + type: string + type: array + testsToSkip: + description: Skip these tests. + items: + type: string + type: array + xctest: + description: Run as a plain XCTest (vs XCUITest). + type: boolean + SecurityInfo: + description: "`POST /device/{udid}/mdm/security-info` — device security info.\ + \ Open map." + type: object + SetLanguageRequest: + description: "`PUT /device/{udid}/lang` request." + example: + language: language + locale: locale + properties: + language: + type: string + locale: + type: string + StatusOk: + description: "Simple `{ \"status\": \"ok\" }` acknowledgement used by MDM clear\ + \ operations." + example: + status: status + properties: + status: + type: string + required: + - status + SupervisionCert: + description: |- + `POST /prepare/create-cert` — a generated self-signed supervision identity, + returned as DER (base64) and PEM for both the certificate and private key. + Host-scoped (device-free). + example: + privateKeyDerBase64: privateKeyDerBase64 + privateKeyPem: privateKeyPem + certPem: certPem + certDerBase64: certDerBase64 + properties: + certDerBase64: + description: "Certificate in DER form, base64-encoded." + type: string + certPem: + description: Certificate in PEM form. + type: string + privateKeyDerBase64: + description: "Private key in DER form, base64-encoded." + type: string + privateKeyPem: + description: Private key in PEM form. + type: string + required: + - certDerBase64 + - certPem + - privateKeyDerBase64 + - privateKeyPem + SyslogEvents: + anyOf: + - $ref: '#/components/schemas/SyslogMessage' + - $ref: '#/components/schemas/Heartbeat' + SyslogMessage: + description: A single syslog line from the device. + properties: + message: + description: The raw log message text. + type: string + timestamp: + description: "Unix epoch milliseconds when the line was emitted, if known." + format: int64 + type: integer + required: + - message + SysmontapEvents: + anyOf: + - $ref: '#/components/schemas/CpuUsageSample' + - $ref: '#/components/schemas/Heartbeat' + TimeFormatRequest: + description: "`PUT /device/{udid}/timeformat` request." + example: + uses24Hour: true + properties: + uses24Hour: + type: boolean + required: + - uses24Hour + TimeFormatState: + description: "`GET /device/{udid}/timeformat` — 24-hour clock state." + example: + Uses24HourClock: true + properties: + Uses24HourClock: + type: boolean + required: + - Uses24HourClock + Tunnel: + description: |- + A running device tunnel as reported by the tunnel agent + (`GET /tunnels`, `POST /tunnels/{udid}/refresh`). Mirrors `tunnel.Tunnel`. + example: + Udid: Udid + Address: Address + UserspaceTUN: true + RsdPort: 0 + UserspaceTUNPort: 6 + properties: + Udid: + description: The device udid this tunnel serves. + type: string + Address: + description: Tunnel address (IPv6) reachable for RemoteXPC/RSD. + type: string + RsdPort: + description: RemoteServiceDiscovery port on the tunnel. + format: int32 + type: integer + UserspaceTUN: + description: Whether this tunnel is a userspace TUN. + type: boolean + UserspaceTUNPort: + description: "Userspace TUN port, when `UserspaceTUN` is true." + format: int32 + type: integer + required: + - Address + - RsdPort + - Udid + TunnelStopped: + description: "`DELETE /tunnels/{udid}` — acknowledgement that the tunnel was\ + \ stopped." + example: + udid: udid + status: status + properties: + udid: + type: string + status: + description: Always `stopped`. + type: string + required: + - status + - udid + UIAPIRequest: + description: |- + `POST /device/{udid}/ui/api` request — raw passthrough to the backend + (`uidriver.APIRequest`). For WDA supply `method`/`path`/`body`; for DeviceKit + supply `rpcMethod`/`rpcParams`. + example: + path: path + method: method + rpcMethod: rpcMethod + body: body + rpcParams: "" + properties: + method: + description: HTTP method for a WDA passthrough (defaults to GET). + type: string + path: + description: HTTP path for a WDA passthrough (required for the wda backend). + type: string + body: + description: Raw HTTP request body for a WDA passthrough (base64 bytes on + the wire). + type: string + rpcMethod: + description: JSON-RPC method name for a DeviceKit passthrough. + type: string + rpcParams: {} + UIAppRequest: + description: "`POST /device/{udid}/ui/app/{launch,terminate}` request." + example: + bundleId: bundleId + properties: + bundleId: + type: string + required: + - bundleId + UIButtonRequest: + description: "`POST /device/{udid}/ui/button` request — hardware button by name." + example: + name: name + properties: + name: + description: "Button name (e.g. `home`, `volumeup`). WDA supports only `home`." + type: string + required: + - name + UILongPressRequest: + description: "`POST /device/{udid}/ui/longpress` request — press and hold at\ + \ (x,y)." + example: + duration: 1.4658129805029452 + x: 0 + "y": 6 + properties: + x: + format: int32 + type: integer + "y": + format: int32 + type: integer + duration: + description: Hold duration in seconds. + format: double + type: number + required: + - x + - "y" + UIOrientationRequest: + description: "`PUT /device/{udid}/ui/orientation` request." + example: + orientation: orientation + properties: + orientation: + description: "Target orientation (e.g. `PORTRAIT`, `LANDSCAPE`)." + type: string + required: + - orientation + UIResponse: + description: |- + A backend passthrough response. The body and content-type are forwarded from + WDA/DeviceKit verbatim, so the shape is backend-defined (open map). + type: object + UISwipeRequest: + description: "`POST /device/{udid}/ui/swipe` request — drag from (x1,y1) to\ + \ (x2,y2)." + example: + duration: 5.637376656633329 + y1: 6 + x1: 0 + y2: 5 + x2: 1 + properties: + x1: + format: int32 + type: integer + y1: + format: int32 + type: integer + x2: + format: int32 + type: integer + y2: + format: int32 + type: integer + duration: + description: Gesture duration in seconds. + format: double + type: number + required: + - x1 + - x2 + - y1 + - y2 + UITapRequest: + description: "`POST /device/{udid}/ui/tap` request — absolute coordinates." + example: + x: 0 + "y": 6 + properties: + x: + format: int32 + type: integer + "y": + format: int32 + type: integer + required: + - x + - "y" + UITypeRequest: + description: "`POST /device/{udid}/ui/type` request — keyboard input." + example: + text: text + properties: + text: + type: string + required: + - text + UnlockToken: + description: "`POST /device/{udid}/mdm/fetch-unlock-token` — base64 escrow unlock\ + \ token." + example: + token: token + properties: + token: + description: Base64-encoded escrow unlock token. + type: string + required: + - token + VoiceOverState: + description: "`GET|PUT /device/{udid}/voiceover` — VoiceOver enabled state." + example: + VoiceOverEnabled: true + properties: + VoiceOverEnabled: + type: boolean + required: + - VoiceOverEnabled + WdaConfig: + description: Configuration for launching a WebDriverAgent (XCUITest) runner + session. + example: + args: + - args + - args + xcTestConfig: xcTestConfig + testBundleId: testBundleId + bundleId: bundleId + env: "{}" + properties: + bundleId: + description: Bundle id of the WDA runner host app (e.g. `com.facebook.WebDriverAgentRunner.xctrunner`). + type: string + testBundleId: + description: Bundle id of the XCTest test bundle. + type: string + xcTestConfig: + description: Path/name of the `.xctestconfiguration` to use. + type: string + args: + description: Extra process arguments passed to the runner. + items: + type: string + type: array + env: + description: Extra environment variables passed to the runner. + type: object + required: + - bundleId + - testBundleId + - xcTestConfig + WdaSession: + description: A running WebDriverAgent session. + example: + sessionId: sessionId + udid: udid + config: + args: + - args + - args + xcTestConfig: xcTestConfig + testBundleId: testBundleId + bundleId: bundleId + env: "{}" + properties: + config: + $ref: '#/components/schemas/WdaConfig' + sessionId: + description: Opaque session identifier. + type: string + udid: + description: The device udid the session runs on. + type: string + required: + - config + - sessionId + - udid + WebInspectorEvalRequest: + description: "`POST /device/{udid}/webinspector/eval` request body." + example: + bundleId: bundleId + page: page + script: script + properties: + page: + description: |- + Inspectable page key. When empty the first matching web/javascript page + (optionally scoped by `bundleId`) is used. + type: string + bundleId: + description: Optional bundle id to scope page selection. + type: string + script: + description: JavaScript source to evaluate. Required. + type: string + required: + - script + WebInspectorEvalResult: + description: "`POST /device/{udid}/webinspector/eval` — evaluation result." + example: + result: "" + page: page + properties: + page: + description: The page key the script ran in. + type: string + result: {} + required: + - page + - result + WebInspectorLaunchRequest: + description: "`POST /device/{udid}/webinspector/launch` request body." + example: + bundleId: bundleId + url: url + properties: + url: + description: URL to open. May alternatively be supplied as the `url` query + param. + type: string + bundleId: + description: Bundle id to open the URL in. Defaults to Safari. + type: string + WebInspectorLaunchResult: + description: "`POST /device/{udid}/webinspector/launch` — result of opening\ + \ a URL." + example: + bundleId: bundleId + title: title + url: url + properties: + bundleId: + description: Bundle id the page was opened in. + type: string + url: + description: The resolved current URL after navigation. + type: string + title: + description: The page title after navigation. + type: string + required: + - bundleId + - title + - url + WebInspectorPage: + description: |- + One inspectable page (`webinspector.ApplicationPage`) from + `GET /device/{udid}/webinspector/pages`. Open map — carries the application + and page descriptors as the device reports them. + type: object + WifiRequest: + description: "`PUT /device/{udid}/wifi` request." + example: + encType: encType + password: password + ssid: ssid + properties: + ssid: + type: string + password: + type: string + encType: + description: "Encryption type, e.g. `WPA2`, `WPA`, `WEP`, `None`." + type: string + required: + - ssid + ZoomTouchState: + description: "`GET|PUT /device/{udid}/zoom` — ZoomTouch enabled state." + example: + ZoomTouchEnabled: true + properties: + ZoomTouchEnabled: + type: boolean + required: + - ZoomTouchEnabled + Devices_installApp_request: + properties: + file: {} + required: + - file + Devices_setHttpProxy_request: + properties: + host: + description: Proxy host. + type: string + port: + description: Proxy port. + type: string + p12: {} + user: + description: Proxy username. + type: string + pass: + description: Proxy password. + type: string + password: + description: Passphrase for the `.p12` identity. + type: string + required: + - host + - p12 + - port + Devices_getJob_404_response: + anyOf: + - $ref: '#/components/schemas/GenericResponse' + - $ref: '#/components/schemas/GenericResponse' + Devices_mdmClearPasscode_request: + properties: + p12: {} + password: + description: Passphrase for the `.p12` identity. + type: string + token: + description: Base64-encoded escrow unlock token. + type: string + required: + - p12 + - token + Devices_mdmClearScreenTimePassword_request: + properties: + p12: {} + password: + description: Passphrase for the `.p12` identity. + type: string + required: + - p12 + Devices_pair_request: + properties: + p12file: {} + required: + - p12file + Prepare_prepareDevice_request: + properties: + cert: {} + p12password: + description: P12 password (when `cert` is a P12). + type: string + skip: + description: Setup panes to skip (see /prepare/skip-options). Repeatable. + items: + type: string + type: array + orgname: + description: Supervision organization name. + type: string + locale: + description: Device locale (default en_US). + type: string + lang: + description: Device language (default en). + type: string + Devices_addProfile_request: + properties: + profile: {} + p12: {} + password: + description: Passphrase for the `.p12` identity. + type: string + required: + - profile + Accessibility_setLocationGpx_request: + properties: + gpx: {} + required: + - gpx + Devices_setWallpaper_request: + properties: + image: {} + p12: {} + password: + description: Passphrase for the `.p12` identity. + type: string + screen: + description: "Target screen (`home`, `lock`, `both`)." + type: string + required: + - image + - p12 + signApp_request: + properties: + ipa: {} + p12file: {} + profile: {} + p12password: + description: P12 password. + type: string + bundleid: + description: Override bundle id. + type: string + required: + - ipa + - p12file + - profile + signCertificate_request: + properties: + asc-private-key: {} + asc-key-id: + description: App Store Connect key id. + type: string + asc-issuer-id: + description: App Store Connect issuer id. + type: string + revoke-existing: + description: Revoke existing iOS Development certificates first. + type: string + p12password: + description: Password to protect the generated P12. + type: string + required: + - asc-issuer-id + - asc-key-id + - asc-private-key + signProvision_request: + properties: + asc-private-key: {} + asc-key-id: + description: App Store Connect key id. + type: string + asc-issuer-id: + description: App Store Connect issuer id. + type: string + bundleid: + description: App bundle identifier. + type: string + udid: + description: Target device udid to register against the profile. + type: string + bundlename: + description: Bundle display name. + type: string + profilename: + description: Provisioning profile name. + type: string + devicename: + description: Device display name. + type: string + certificate-id: + description: Reuse an existing certificate (no new P12 is generated). + type: string + revoke-existing: + description: Revoke existing certificates first. + type: string + p12password: + description: Password to protect the generated P12. + type: string + required: + - asc-issuer-id + - asc-key-id + - asc-private-key + - bundleid + - udid + securitySchemes: + BearerAuth: + scheme: Bearer + type: http + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/api/DefaultApi.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/api/DefaultApi.java new file mode 100644 index 000000000..97374834b --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/api/DefaultApi.java @@ -0,0 +1,12760 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.github.danielpaulus.goios.generated.api; + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +import com.github.danielpaulus.goios.generated.invoker.ApiException; +import com.github.danielpaulus.goios.generated.invoker.ApiResponse; +import com.github.danielpaulus.goios.generated.invoker.Pair; + +import com.github.danielpaulus.goios.generated.model.AXEnabledRequest; +import com.github.danielpaulus.goios.generated.model.AgentShutdown; +import com.github.danielpaulus.goios.generated.model.AppInfo; +import com.github.danielpaulus.goios.generated.model.AssistiveTouchState; +import com.github.danielpaulus.goios.generated.model.BatteryInfo; +import com.github.danielpaulus.goios.generated.model.BatteryRegistry; +import com.github.danielpaulus.goios.generated.model.CrashListing; +import com.github.danielpaulus.goios.generated.model.DevModeRequest; +import com.github.danielpaulus.goios.generated.model.DevModeState; +import com.github.danielpaulus.goios.generated.model.DeviceDate; +import com.github.danielpaulus.goios.generated.model.DeviceList; +import com.github.danielpaulus.goios.generated.model.DeviceName; +import com.github.danielpaulus.goios.generated.model.DevicesGetJob404Response; +import com.github.danielpaulus.goios.generated.model.DiskSpaceInfo; +import com.github.danielpaulus.goios.generated.model.EnabledRequest; +import com.github.danielpaulus.goios.generated.model.FileDomain; +import com.github.danielpaulus.goios.generated.model.FileListing; +import com.github.danielpaulus.goios.generated.model.FilePushResult; +import com.github.danielpaulus.goios.generated.model.ForwardRequest; +import com.github.danielpaulus.goios.generated.model.FsyncListing; +import com.github.danielpaulus.goios.generated.model.FsyncMessage; +import com.github.danielpaulus.goios.generated.model.FsyncPushResult; +import com.github.danielpaulus.goios.generated.model.FsyncTreeListing; +import com.github.danielpaulus.goios.generated.model.GenericResponse; +import com.github.danielpaulus.goios.generated.model.Job; +import com.github.danielpaulus.goios.generated.model.LanguageConfiguration; +import com.github.danielpaulus.goios.generated.model.MemLimitRequest; +import com.github.danielpaulus.goios.generated.model.MemLimitResult; +import com.github.danielpaulus.goios.generated.model.MountedImages; +import com.github.danielpaulus.goios.generated.model.NetworkInfo; +import com.github.danielpaulus.goios.generated.model.PasteboardContent; +import com.github.danielpaulus.goios.generated.model.PrepareResult; +import com.github.danielpaulus.goios.generated.model.PrepareSkipOptions; +import com.github.danielpaulus.goios.generated.model.ProcessInfo; +import com.github.danielpaulus.goios.generated.model.ProfileType; +import com.github.danielpaulus.goios.generated.model.ProvisioningResult; +import com.github.danielpaulus.goios.generated.model.RunTestRequest; +import com.github.danielpaulus.goios.generated.model.SetLanguageRequest; +import com.github.danielpaulus.goios.generated.model.StatusOk; +import com.github.danielpaulus.goios.generated.model.SupervisionCert; +import com.github.danielpaulus.goios.generated.model.TimeFormatRequest; +import com.github.danielpaulus.goios.generated.model.TimeFormatState; +import com.github.danielpaulus.goios.generated.model.Tunnel; +import com.github.danielpaulus.goios.generated.model.TunnelStopped; +import com.github.danielpaulus.goios.generated.model.UIAPIRequest; +import com.github.danielpaulus.goios.generated.model.UIAppRequest; +import com.github.danielpaulus.goios.generated.model.UIButtonRequest; +import com.github.danielpaulus.goios.generated.model.UILongPressRequest; +import com.github.danielpaulus.goios.generated.model.UIOrientationRequest; +import com.github.danielpaulus.goios.generated.model.UISwipeRequest; +import com.github.danielpaulus.goios.generated.model.UITapRequest; +import com.github.danielpaulus.goios.generated.model.UITypeRequest; +import com.github.danielpaulus.goios.generated.model.UnlockToken; +import com.github.danielpaulus.goios.generated.model.VoiceOverState; +import com.github.danielpaulus.goios.generated.model.WdaConfig; +import com.github.danielpaulus.goios.generated.model.WdaSession; +import com.github.danielpaulus.goios.generated.model.WebInspectorEvalRequest; +import com.github.danielpaulus.goios.generated.model.WebInspectorEvalResult; +import com.github.danielpaulus.goios.generated.model.WebInspectorLaunchRequest; +import com.github.danielpaulus.goios.generated.model.WebInspectorLaunchResult; +import com.github.danielpaulus.goios.generated.model.WifiRequest; +import com.github.danielpaulus.goios.generated.model.ZoomTouchState; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import org.apache.http.HttpEntity; +import org.apache.http.NameValuePair; +import org.apache.http.entity.mime.MultipartEntityBuilder; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.client.entity.UrlEncodedFormEntity; + +import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.net.http.HttpRequest; +import java.nio.channels.Channels; +import java.nio.channels.Pipe; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; + +import java.util.ArrayList; +import java.util.StringJoiner; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Consumer; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class DefaultApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public DefaultApi() { + this(new ApiClient()); + } + + public DefaultApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Get accessibility element snapshot + * Get a snapshot of the currently focused accessibility element (CLI: `ios ax`). + * @param udid (required) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object accessibilityGetAxSnapshot(String udid) throws ApiException { + ApiResponse localVarResponse = accessibilityGetAxSnapshotWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Get accessibility element snapshot + * Get a snapshot of the currently focused accessibility element (CLI: `ios ax`). + * @param udid (required) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse accessibilityGetAxSnapshotWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = accessibilityGetAxSnapshotRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("accessibilityGetAxSnapshot", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder accessibilityGetAxSnapshotRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling accessibilityGetAxSnapshot"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/ax" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get VoiceOver state + * Get VoiceOver enabled state (CLI: `ios voiceover get`). + * @param udid (required) + * @return VoiceOverState + * @throws ApiException if fails to make API call + */ + public VoiceOverState accessibilityGetVoiceOver(String udid) throws ApiException { + ApiResponse localVarResponse = accessibilityGetVoiceOverWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Get VoiceOver state + * Get VoiceOver enabled state (CLI: `ios voiceover get`). + * @param udid (required) + * @return ApiResponse<VoiceOverState> + * @throws ApiException if fails to make API call + */ + public ApiResponse accessibilityGetVoiceOverWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = accessibilityGetVoiceOverRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("accessibilityGetVoiceOver", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder accessibilityGetVoiceOverRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling accessibilityGetVoiceOver"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/voiceover" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get ZoomTouch state + * Get ZoomTouch enabled state (CLI: `ios zoomtouch get`). + * @param udid (required) + * @return ZoomTouchState + * @throws ApiException if fails to make API call + */ + public ZoomTouchState accessibilityGetZoomTouch(String udid) throws ApiException { + ApiResponse localVarResponse = accessibilityGetZoomTouchWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Get ZoomTouch state + * Get ZoomTouch enabled state (CLI: `ios zoomtouch get`). + * @param udid (required) + * @return ApiResponse<ZoomTouchState> + * @throws ApiException if fails to make API call + */ + public ApiResponse accessibilityGetZoomTouchWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = accessibilityGetZoomTouchRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("accessibilityGetZoomTouch", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder accessibilityGetZoomTouchRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling accessibilityGetZoomTouch"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/zoom" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Run accessibility audit + * Run the accessibility audit against the focused app and return the issues found (CLI: `ios ax audit`). Bounded by `timeout` (seconds, default 60). + * @param udid (required) + * @param timeout Audit timeout in seconds (default 60). (optional) + * @return List<Object> + * @throws ApiException if fails to make API call + */ + public List accessibilityRunAxAudit(String udid, Integer timeout) throws ApiException { + ApiResponse> localVarResponse = accessibilityRunAxAuditWithHttpInfo(udid, timeout); + return localVarResponse.getData(); + } + + /** + * Run accessibility audit + * Run the accessibility audit against the focused app and return the issues found (CLI: `ios ax audit`). Bounded by `timeout` (seconds, default 60). + * @param udid (required) + * @param timeout Audit timeout in seconds (default 60). (optional) + * @return ApiResponse<List<Object>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> accessibilityRunAxAuditWithHttpInfo(String udid, Integer timeout) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = accessibilityRunAxAuditRequestBuilder(udid, timeout); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("accessibilityRunAxAudit", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference>() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder accessibilityRunAxAuditRequestBuilder(String udid, Integer timeout) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling accessibilityRunAxAudit"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/ax/audit" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "timeout"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("timeout", timeout)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Simulate location from a GPX file + * Simulate live location tracking from an uploaded GPX file (CLI: `ios setlocationgpx`). Send multipart/form-data with a `gpx` file. + * @param udid (required) + * @param gpx (required) + * @return GenericResponse + * @throws ApiException if fails to make API call + */ + public GenericResponse accessibilitySetLocationGpx(String udid, Object gpx) throws ApiException { + ApiResponse localVarResponse = accessibilitySetLocationGpxWithHttpInfo(udid, gpx); + return localVarResponse.getData(); + } + + /** + * Simulate location from a GPX file + * Simulate live location tracking from an uploaded GPX file (CLI: `ios setlocationgpx`). Send multipart/form-data with a `gpx` file. + * @param udid (required) + * @param gpx (required) + * @return ApiResponse<GenericResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse accessibilitySetLocationGpxWithHttpInfo(String udid, Object gpx) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = accessibilitySetLocationGpxRequestBuilder(udid, gpx); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("accessibilitySetLocationGpx", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder accessibilitySetLocationGpxRequestBuilder(String udid, Object gpx) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling accessibilitySetLocationGpx"); + } + // verify the required parameter 'gpx' is set + if (gpx == null) { + throw new ApiException(400, "Missing the required parameter 'gpx' when calling accessibilitySetLocationGpx"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/setlocation/gpx" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + MultipartEntityBuilder multiPartBuilder = MultipartEntityBuilder.create(); + boolean hasFiles = false; + multiPartBuilder.addTextBody("gpx", gpx.toString()); + HttpEntity entity = multiPartBuilder.build(); + HttpRequest.BodyPublisher formDataPublisher; + if (hasFiles) { + Pipe pipe; + try { + pipe = Pipe.open(); + } catch (IOException e) { + throw new RuntimeException(e); + } + new Thread(() -> { + try (OutputStream outputStream = Channels.newOutputStream(pipe.sink())) { + entity.writeTo(outputStream); + } catch (IOException e) { + e.printStackTrace(); + } + }).start(); + formDataPublisher = HttpRequest.BodyPublishers.ofInputStream(() -> Channels.newInputStream(pipe.source())); + } else { + ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); + try { + entity.writeTo(formOutputStream); + } catch (IOException e) { + throw new RuntimeException(e); + } + formDataPublisher = HttpRequest.BodyPublishers + .ofInputStream(() -> new ByteArrayInputStream(formOutputStream.toByteArray())); + } + localVarRequestBuilder + .header("Content-Type", entity.getContentType().getValue()) + .method("PUT", formDataPublisher); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Set VoiceOver state + * Enable/disable VoiceOver (CLI: `ios voiceover enable|disable`). The desired state comes from the JSON body or the `enabled` query param. + * @param udid (required) + * @param enabled Desired state (alternative to the request body). (optional) + * @param axEnabledRequest (optional) + * @return VoiceOverState + * @throws ApiException if fails to make API call + */ + public VoiceOverState accessibilitySetVoiceOver(String udid, Boolean enabled, AXEnabledRequest axEnabledRequest) throws ApiException { + ApiResponse localVarResponse = accessibilitySetVoiceOverWithHttpInfo(udid, enabled, axEnabledRequest); + return localVarResponse.getData(); + } + + /** + * Set VoiceOver state + * Enable/disable VoiceOver (CLI: `ios voiceover enable|disable`). The desired state comes from the JSON body or the `enabled` query param. + * @param udid (required) + * @param enabled Desired state (alternative to the request body). (optional) + * @param axEnabledRequest (optional) + * @return ApiResponse<VoiceOverState> + * @throws ApiException if fails to make API call + */ + public ApiResponse accessibilitySetVoiceOverWithHttpInfo(String udid, Boolean enabled, AXEnabledRequest axEnabledRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = accessibilitySetVoiceOverRequestBuilder(udid, enabled, axEnabledRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("accessibilitySetVoiceOver", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder accessibilitySetVoiceOverRequestBuilder(String udid, Boolean enabled, AXEnabledRequest axEnabledRequest) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling accessibilitySetVoiceOver"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/voiceover" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "enabled"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enabled", enabled)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(axEnabledRequest); + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Set ZoomTouch state + * Enable/disable ZoomTouch (CLI: `ios zoomtouch enable|disable`). The desired state comes from the JSON body or the `enabled` query param. + * @param udid (required) + * @param enabled Desired state (alternative to the request body). (optional) + * @param axEnabledRequest (optional) + * @return ZoomTouchState + * @throws ApiException if fails to make API call + */ + public ZoomTouchState accessibilitySetZoomTouch(String udid, Boolean enabled, AXEnabledRequest axEnabledRequest) throws ApiException { + ApiResponse localVarResponse = accessibilitySetZoomTouchWithHttpInfo(udid, enabled, axEnabledRequest); + return localVarResponse.getData(); + } + + /** + * Set ZoomTouch state + * Enable/disable ZoomTouch (CLI: `ios zoomtouch enable|disable`). The desired state comes from the JSON body or the `enabled` query param. + * @param udid (required) + * @param enabled Desired state (alternative to the request body). (optional) + * @param axEnabledRequest (optional) + * @return ApiResponse<ZoomTouchState> + * @throws ApiException if fails to make API call + */ + public ApiResponse accessibilitySetZoomTouchWithHttpInfo(String udid, Boolean enabled, AXEnabledRequest axEnabledRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = accessibilitySetZoomTouchRequestBuilder(udid, enabled, axEnabledRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("accessibilitySetZoomTouch", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder accessibilitySetZoomTouchRequestBuilder(String udid, Boolean enabled, AXEnabledRequest axEnabledRequest) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling accessibilitySetZoomTouch"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/zoom" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "enabled"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enabled", enabled)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(axEnabledRequest); + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Activate device + * Activate the device (complete Setup Assistant / activation). + * @param udid (required) + * @return GenericResponse + * @throws ApiException if fails to make API call + */ + public GenericResponse devicesActivate(String udid) throws ApiException { + ApiResponse localVarResponse = devicesActivateWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Activate device + * Activate the device (complete Setup Assistant / activation). + * @param udid (required) + * @return ApiResponse<GenericResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesActivateWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesActivateRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesActivate", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesActivateRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesActivate"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/activate" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Install profile + * Install a configuration profile (CLI: `ios profile add`). Send the profile as the raw request body, or as multipart with a `profile` file plus an optional `p12` supervisor identity and `password` for a supervised install. + * @param udid (required) + * @param profile (required) + * @param p12 (optional) + * @param password Passphrase for the `.p12` identity. (optional) + * @return GenericResponse + * @throws ApiException if fails to make API call + */ + public GenericResponse devicesAddProfile(String udid, Object profile, Object p12, String password) throws ApiException { + ApiResponse localVarResponse = devicesAddProfileWithHttpInfo(udid, profile, p12, password); + return localVarResponse.getData(); + } + + /** + * Install profile + * Install a configuration profile (CLI: `ios profile add`). Send the profile as the raw request body, or as multipart with a `profile` file plus an optional `p12` supervisor identity and `password` for a supervised install. + * @param udid (required) + * @param profile (required) + * @param p12 (optional) + * @param password Passphrase for the `.p12` identity. (optional) + * @return ApiResponse<GenericResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesAddProfileWithHttpInfo(String udid, Object profile, Object p12, String password) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesAddProfileRequestBuilder(udid, profile, p12, password); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesAddProfile", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesAddProfileRequestBuilder(String udid, Object profile, Object p12, String password) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesAddProfile"); + } + // verify the required parameter 'profile' is set + if (profile == null) { + throw new ApiException(400, "Missing the required parameter 'profile' when calling devicesAddProfile"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/profiles" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + MultipartEntityBuilder multiPartBuilder = MultipartEntityBuilder.create(); + boolean hasFiles = false; + multiPartBuilder.addTextBody("profile", profile.toString()); + multiPartBuilder.addTextBody("p12", p12.toString()); + multiPartBuilder.addTextBody("password", password.toString()); + HttpEntity entity = multiPartBuilder.build(); + HttpRequest.BodyPublisher formDataPublisher; + if (hasFiles) { + Pipe pipe; + try { + pipe = Pipe.open(); + } catch (IOException e) { + throw new RuntimeException(e); + } + new Thread(() -> { + try (OutputStream outputStream = Channels.newOutputStream(pipe.sink())) { + entity.writeTo(outputStream); + } catch (IOException e) { + e.printStackTrace(); + } + }).start(); + formDataPublisher = HttpRequest.BodyPublishers.ofInputStream(() -> Channels.newInputStream(pipe.source())); + } else { + ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); + try { + entity.writeTo(formOutputStream); + } catch (IOException e) { + throw new RuntimeException(e); + } + formDataPublisher = HttpRequest.BodyPublishers + .ofInputStream(() -> new ByteArrayInputStream(formOutputStream.toByteArray())); + } + localVarRequestBuilder + .header("Content-Type", entity.getContentType().getValue()) + .method("POST", formDataPublisher); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Start WDA session + * Start a WebDriverAgent (XCUITest) session. + * @param udid (required) + * @param wdaConfig (required) + * @return WdaSession + * @throws ApiException if fails to make API call + */ + public WdaSession devicesCreateWdaSession(String udid, WdaConfig wdaConfig) throws ApiException { + ApiResponse localVarResponse = devicesCreateWdaSessionWithHttpInfo(udid, wdaConfig); + return localVarResponse.getData(); + } + + /** + * Start WDA session + * Start a WebDriverAgent (XCUITest) session. + * @param udid (required) + * @param wdaConfig (required) + * @return ApiResponse<WdaSession> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesCreateWdaSessionWithHttpInfo(String udid, WdaConfig wdaConfig) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesCreateWdaSessionRequestBuilder(udid, wdaConfig); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesCreateWdaSession", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesCreateWdaSessionRequestBuilder(String udid, WdaConfig wdaConfig) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesCreateWdaSession"); + } + // verify the required parameter 'wdaConfig' is set + if (wdaConfig == null) { + throw new ApiException(400, "Missing the required parameter 'wdaConfig' when calling devicesCreateWdaSession"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/wda/session" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(wdaConfig); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Stop WDA session + * Stop a running WebDriverAgent session. + * @param udid (required) + * @param sessionId The WDA session id. (required) + * @return WdaSession + * @throws ApiException if fails to make API call + */ + public WdaSession devicesDeleteWdaSession(String udid, String sessionId) throws ApiException { + ApiResponse localVarResponse = devicesDeleteWdaSessionWithHttpInfo(udid, sessionId); + return localVarResponse.getData(); + } + + /** + * Stop WDA session + * Stop a running WebDriverAgent session. + * @param udid (required) + * @param sessionId The WDA session id. (required) + * @return ApiResponse<WdaSession> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesDeleteWdaSessionWithHttpInfo(String udid, String sessionId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesDeleteWdaSessionRequestBuilder(udid, sessionId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesDeleteWdaSession", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesDeleteWdaSessionRequestBuilder(String udid, String sessionId) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesDeleteWdaSession"); + } + // verify the required parameter 'sessionId' is set + if (sessionId == null) { + throw new ApiException(400, "Missing the required parameter 'sessionId' when calling devicesDeleteWdaSession"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/wda/session/{sessionId}" + .replace("{udid}", ApiClient.urlEncode(udid.toString())) + .replace("{sessionId}", ApiClient.urlEncode(sessionId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Disable condition + * Disable the currently active condition inducer profile. + * @param udid (required) + * @return GenericResponse + * @throws ApiException if fails to make API call + */ + public GenericResponse devicesDisableCondition(String udid) throws ApiException { + ApiResponse localVarResponse = devicesDisableConditionWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Disable condition + * Disable the currently active condition inducer profile. + * @param udid (required) + * @return ApiResponse<GenericResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesDisableConditionWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesDisableConditionRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesDisableCondition", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesDisableConditionRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesDisableCondition"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/disable-condition" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Enable condition + * Enable a condition inducer profile. + * @param udid (required) + * @param profileTypeID Identifier of the condition profile type. (required) + * @param profileID Identifier of the specific profile to activate. (required) + * @return GenericResponse + * @throws ApiException if fails to make API call + */ + public GenericResponse devicesEnableCondition(String udid, String profileTypeID, String profileID) throws ApiException { + ApiResponse localVarResponse = devicesEnableConditionWithHttpInfo(udid, profileTypeID, profileID); + return localVarResponse.getData(); + } + + /** + * Enable condition + * Enable a condition inducer profile. + * @param udid (required) + * @param profileTypeID Identifier of the condition profile type. (required) + * @param profileID Identifier of the specific profile to activate. (required) + * @return ApiResponse<GenericResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesEnableConditionWithHttpInfo(String udid, String profileTypeID, String profileID) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesEnableConditionRequestBuilder(udid, profileTypeID, profileID); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesEnableCondition", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesEnableConditionRequestBuilder(String udid, String profileTypeID, String profileID) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesEnableCondition"); + } + // verify the required parameter 'profileTypeID' is set + if (profileTypeID == null) { + throw new ApiException(400, "Missing the required parameter 'profileTypeID' when calling devicesEnableCondition"); + } + // verify the required parameter 'profileID' is set + if (profileID == null) { + throw new ApiException(400, "Missing the required parameter 'profileID' when calling devicesEnableCondition"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/enable-condition" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "profileTypeID"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profileTypeID", profileTypeID)); + localVarQueryParameterBaseName = "profileID"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("profileID", profileID)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Erase device + * Erase all content and settings (CLI: `ios erase`). Destructive: requires `confirm=true`. + * @param udid (required) + * @param confirm Must be `true` to proceed with the destructive erase. (required) + * @return GenericResponse + * @throws ApiException if fails to make API call + */ + public GenericResponse devicesErase(String udid, Boolean confirm) throws ApiException { + ApiResponse localVarResponse = devicesEraseWithHttpInfo(udid, confirm); + return localVarResponse.getData(); + } + + /** + * Erase device + * Erase all content and settings (CLI: `ios erase`). Destructive: requires `confirm=true`. + * @param udid (required) + * @param confirm Must be `true` to proceed with the destructive erase. (required) + * @return ApiResponse<GenericResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesEraseWithHttpInfo(String udid, Boolean confirm) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesEraseRequestBuilder(udid, confirm); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesErase", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesEraseRequestBuilder(String udid, Boolean confirm) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesErase"); + } + // verify the required parameter 'confirm' is set + if (confirm == null) { + throw new ApiException(400, "Missing the required parameter 'confirm' when calling devicesErase"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/erase" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "confirm"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("confirm", confirm)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get AssistiveTouch + * Get AssistiveTouch state (CLI: `ios assistivetouch get`). + * @param udid (required) + * @return AssistiveTouchState + * @throws ApiException if fails to make API call + */ + public AssistiveTouchState devicesGetAssistiveTouch(String udid) throws ApiException { + ApiResponse localVarResponse = devicesGetAssistiveTouchWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Get AssistiveTouch + * Get AssistiveTouch state (CLI: `ios assistivetouch get`). + * @param udid (required) + * @return ApiResponse<AssistiveTouchState> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesGetAssistiveTouchWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesGetAssistiveTouchRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesGetAssistiveTouch", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesGetAssistiveTouchRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesGetAssistiveTouch"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/assistivetouch" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get battery info + * Get battery diagnostics (CLI: `ios batterycheck`). + * @param udid (required) + * @return BatteryInfo + * @throws ApiException if fails to make API call + */ + public BatteryInfo devicesGetBattery(String udid) throws ApiException { + ApiResponse localVarResponse = devicesGetBatteryWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Get battery info + * Get battery diagnostics (CLI: `ios batterycheck`). + * @param udid (required) + * @return ApiResponse<BatteryInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesGetBatteryWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesGetBatteryRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesGetBattery", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesGetBatteryRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesGetBattery"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/battery" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get developer mode + * Get developer mode state (CLI: `ios devmode get`). + * @param udid (required) + * @return DevModeState + * @throws ApiException if fails to make API call + */ + public DevModeState devicesGetDevMode(String udid) throws ApiException { + ApiResponse localVarResponse = devicesGetDevModeWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Get developer mode + * Get developer mode state (CLI: `ios devmode get`). + * @param udid (required) + * @return ApiResponse<DevModeState> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesGetDevModeWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesGetDevModeRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesGetDevMode", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesGetDevModeRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesGetDevMode"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/devmode" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get device date + * Get the device clock (CLI: `ios date`). + * @param udid (required) + * @return DeviceDate + * @throws ApiException if fails to make API call + */ + public DeviceDate devicesGetDeviceDate(String udid) throws ApiException { + ApiResponse localVarResponse = devicesGetDeviceDateWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Get device date + * Get the device clock (CLI: `ios date`). + * @param udid (required) + * @return ApiResponse<DeviceDate> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesGetDeviceDateWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesGetDeviceDateRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesGetDeviceDate", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesGetDeviceDateRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesGetDeviceDate"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/date" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get device name + * Get the device name (CLI: `ios devicename`). + * @param udid (required) + * @return DeviceName + * @throws ApiException if fails to make API call + */ + public DeviceName devicesGetDeviceName(String udid) throws ApiException { + ApiResponse localVarResponse = devicesGetDeviceNameWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Get device name + * Get the device name (CLI: `ios devicename`). + * @param udid (required) + * @return ApiResponse<DeviceName> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesGetDeviceNameWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesGetDeviceNameRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesGetDeviceName", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesGetDeviceNameRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesGetDeviceName"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/devicename" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List diagnostics + * List all IORegistry/diagnostic values (CLI: `ios diagnostics list`). + * @param udid (required) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object devicesGetDiagnostics(String udid) throws ApiException { + ApiResponse localVarResponse = devicesGetDiagnosticsWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * List diagnostics + * List all IORegistry/diagnostic values (CLI: `ios diagnostics list`). + * @param udid (required) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesGetDiagnosticsWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesGetDiagnosticsRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesGetDiagnostics", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesGetDiagnosticsRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesGetDiagnostics"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/diagnostics" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get icon layout + * Get the SpringBoard icon layout (CLI: `ios get-icon-layout`). + * @param udid (required) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object devicesGetIconLayout(String udid) throws ApiException { + ApiResponse localVarResponse = devicesGetIconLayoutWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Get icon layout + * Get the SpringBoard icon layout (CLI: `ios get-icon-layout`). + * @param udid (required) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesGetIconLayoutWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesGetIconLayoutRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesGetIconLayout", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesGetIconLayoutRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesGetIconLayout"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/icon-layout" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get device info + * Get lockdown values plus `instruments:*` keys for the device. Returns an open dictionary of heterogeneous values. + * @param udid (required) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object devicesGetInfo(String udid) throws ApiException { + ApiResponse localVarResponse = devicesGetInfoWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Get device info + * Get lockdown values plus `instruments:*` keys for the device. Returns an open dictionary of heterogeneous values. + * @param udid (required) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesGetInfoWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesGetInfoRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesGetInfo", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesGetInfoRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesGetInfo"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/info" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get job + * Get a job's status. Returns `404` for an unknown job on this device. + * @param udid (required) + * @param id The job id. (required) + * @return Job + * @throws ApiException if fails to make API call + */ + public Job devicesGetJob(String udid, String id) throws ApiException { + ApiResponse localVarResponse = devicesGetJobWithHttpInfo(udid, id); + return localVarResponse.getData(); + } + + /** + * Get job + * Get a job's status. Returns `404` for an unknown job on this device. + * @param udid (required) + * @param id The job id. (required) + * @return ApiResponse<Job> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesGetJobWithHttpInfo(String udid, String id) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesGetJobRequestBuilder(udid, id); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesGetJob", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesGetJobRequestBuilder(String udid, String id) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesGetJob"); + } + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling devicesGetJob"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/jobs/{id}" + .replace("{udid}", ApiClient.urlEncode(udid.toString())) + .replace("{id}", ApiClient.urlEncode(id.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get language + * Get the device language/locale configuration (CLI: `ios lang`). + * @param udid (required) + * @return LanguageConfiguration + * @throws ApiException if fails to make API call + */ + public LanguageConfiguration devicesGetLanguage(String udid) throws ApiException { + ApiResponse localVarResponse = devicesGetLanguageWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Get language + * Get the device language/locale configuration (CLI: `ios lang`). + * @param udid (required) + * @return ApiResponse<LanguageConfiguration> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesGetLanguageWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesGetLanguageRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesGetLanguage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesGetLanguageRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesGetLanguage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/lang" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get lockdown values + * Get lockdown values (CLI: `ios lockdown get`). Without `domain` the full set is returned; with `domain` the values are scoped to that lockdown domain. + * @param udid (required) + * @param domain Optional lockdown domain to scope the returned values. (optional) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object devicesGetLockdownValues(String udid, String domain) throws ApiException { + ApiResponse localVarResponse = devicesGetLockdownValuesWithHttpInfo(udid, domain); + return localVarResponse.getData(); + } + + /** + * Get lockdown values + * Get lockdown values (CLI: `ios lockdown get`). Without `domain` the full set is returned; with `domain` the values are scoped to that lockdown domain. + * @param udid (required) + * @param domain Optional lockdown domain to scope the returned values. (optional) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesGetLockdownValuesWithHttpInfo(String udid, String domain) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesGetLockdownValuesRequestBuilder(udid, domain); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesGetLockdownValues", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesGetLockdownValuesRequestBuilder(String udid, String domain) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesGetLockdownValues"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/lockdown" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "domain"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("domain", domain)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Query MobileGestalt + * Query one or more MobileGestalt keys (CLI: `ios mobilegestalt <key>...`). Pass repeated `key` query params. + * @param udid (required) + * @param key One or more MobileGestalt keys to query. (required) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object devicesGetMobileGestalt(String udid, List key) throws ApiException { + ApiResponse localVarResponse = devicesGetMobileGestaltWithHttpInfo(udid, key); + return localVarResponse.getData(); + } + + /** + * Query MobileGestalt + * Query one or more MobileGestalt keys (CLI: `ios mobilegestalt <key>...`). Pass repeated `key` query params. + * @param udid (required) + * @param key One or more MobileGestalt keys to query. (required) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesGetMobileGestaltWithHttpInfo(String udid, List key) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesGetMobileGestaltRequestBuilder(udid, key); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesGetMobileGestalt", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesGetMobileGestaltRequestBuilder(String udid, List key) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesGetMobileGestalt"); + } + // verify the required parameter 'key' is set + if (key == null) { + throw new ApiException(400, "Missing the required parameter 'key' when calling devicesGetMobileGestalt"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/mobilegestalt" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "key"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "key", key)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get pasteboard + * Get the pasteboard (clipboard) text (CLI: `ios pasteboard get`). + * @param udid (required) + * @return PasteboardContent + * @throws ApiException if fails to make API call + */ + public PasteboardContent devicesGetPasteboard(String udid) throws ApiException { + ApiResponse localVarResponse = devicesGetPasteboardWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Get pasteboard + * Get the pasteboard (clipboard) text (CLI: `ios pasteboard get`). + * @param udid (required) + * @return ApiResponse<PasteboardContent> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesGetPasteboardWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesGetPasteboardRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesGetPasteboard", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesGetPasteboardRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesGetPasteboard"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/pasteboard" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List processes + * List running processes (CLI: `ios ps [--apps]`). + * @param udid (required) + * @param apps Only return application processes. (optional) + * @return List<ProcessInfo> + * @throws ApiException if fails to make API call + */ + public List devicesGetProcesses(String udid, Boolean apps) throws ApiException { + ApiResponse> localVarResponse = devicesGetProcessesWithHttpInfo(udid, apps); + return localVarResponse.getData(); + } + + /** + * List processes + * List running processes (CLI: `ios ps [--apps]`). + * @param udid (required) + * @param apps Only return application processes. (optional) + * @return ApiResponse<List<ProcessInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> devicesGetProcessesWithHttpInfo(String udid, Boolean apps) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesGetProcessesRequestBuilder(udid, apps); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesGetProcesses", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference>() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesGetProcessesRequestBuilder(String udid, Boolean apps) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesGetProcesses"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/processes" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "apps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("apps", apps)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List configuration profiles + * List installed configuration profiles. Returns an open dictionary. + * @param udid (required) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object devicesGetProfiles(String udid) throws ApiException { + ApiResponse localVarResponse = devicesGetProfilesWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * List configuration profiles + * List installed configuration profiles. Returns an open dictionary. + * @param udid (required) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesGetProfilesWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesGetProfilesRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesGetProfiles", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesGetProfilesRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesGetProfiles"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/profiles" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get time format + * Get the 24-hour clock state (CLI: `ios timeformat get`). + * @param udid (required) + * @return TimeFormatState + * @throws ApiException if fails to make API call + */ + public TimeFormatState devicesGetTimeFormat(String udid) throws ApiException { + ApiResponse localVarResponse = devicesGetTimeFormatWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Get time format + * Get the 24-hour clock state (CLI: `ios timeformat get`). + * @param udid (required) + * @return ApiResponse<TimeFormatState> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesGetTimeFormatWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesGetTimeFormatRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesGetTimeFormat", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesGetTimeFormatRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesGetTimeFormat"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/timeformat" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get wallpaper + * Get the home-screen wallpaper as PNG (CLI: `ios get-wallpaper`). + * @param udid (required) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object devicesGetWallpaper(String udid) throws ApiException { + ApiResponse localVarResponse = devicesGetWallpaperWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Get wallpaper + * Get the home-screen wallpaper as PNG (CLI: `ios get-wallpaper`). + * @param udid (required) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesGetWallpaperWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesGetWallpaperRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesGetWallpaper", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesGetWallpaperRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesGetWallpaper"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/wallpaper" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "image/png, application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get WDA session + * Get a running WebDriverAgent session. Returns `404` for an unknown session. + * @param udid (required) + * @param sessionId The WDA session id. (required) + * @return WdaSession + * @throws ApiException if fails to make API call + */ + public WdaSession devicesGetWdaSession(String udid, String sessionId) throws ApiException { + ApiResponse localVarResponse = devicesGetWdaSessionWithHttpInfo(udid, sessionId); + return localVarResponse.getData(); + } + + /** + * Get WDA session + * Get a running WebDriverAgent session. Returns `404` for an unknown session. + * @param udid (required) + * @param sessionId The WDA session id. (required) + * @return ApiResponse<WdaSession> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesGetWdaSessionWithHttpInfo(String udid, String sessionId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesGetWdaSessionRequestBuilder(udid, sessionId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesGetWdaSession", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesGetWdaSessionRequestBuilder(String udid, String sessionId) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesGetWdaSession"); + } + // verify the required parameter 'sessionId' is set + if (sessionId == null) { + throw new ApiException(400, "Missing the required parameter 'sessionId' when calling devicesGetWdaSession"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/wda/session/{sessionId}" + .replace("{udid}", ApiClient.urlEncode(udid.toString())) + .replace("{sessionId}", ApiClient.urlEncode(sessionId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Install app + * Install an application from an uploaded `.ipa`/`.app` archive. The multipart `file` part must be 1 byte–200 MB. + * @param udid (required) + * @param _file (required) + * @return GenericResponse + * @throws ApiException if fails to make API call + */ + public GenericResponse devicesInstallApp(String udid, Object _file) throws ApiException { + ApiResponse localVarResponse = devicesInstallAppWithHttpInfo(udid, _file); + return localVarResponse.getData(); + } + + /** + * Install app + * Install an application from an uploaded `.ipa`/`.app` archive. The multipart `file` part must be 1 byte–200 MB. + * @param udid (required) + * @param _file (required) + * @return ApiResponse<GenericResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesInstallAppWithHttpInfo(String udid, Object _file) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesInstallAppRequestBuilder(udid, _file); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesInstallApp", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesInstallAppRequestBuilder(String udid, Object _file) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesInstallApp"); + } + // verify the required parameter '_file' is set + if (_file == null) { + throw new ApiException(400, "Missing the required parameter '_file' when calling devicesInstallApp"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/apps/install" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + MultipartEntityBuilder multiPartBuilder = MultipartEntityBuilder.create(); + boolean hasFiles = false; + multiPartBuilder.addTextBody("file", _file.toString()); + HttpEntity entity = multiPartBuilder.build(); + HttpRequest.BodyPublisher formDataPublisher; + if (hasFiles) { + Pipe pipe; + try { + pipe = Pipe.open(); + } catch (IOException e) { + throw new RuntimeException(e); + } + new Thread(() -> { + try (OutputStream outputStream = Channels.newOutputStream(pipe.sink())) { + entity.writeTo(outputStream); + } catch (IOException e) { + e.printStackTrace(); + } + }).start(); + formDataPublisher = HttpRequest.BodyPublishers.ofInputStream(() -> Channels.newInputStream(pipe.source())); + } else { + ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); + try { + entity.writeTo(formOutputStream); + } catch (IOException e) { + throw new RuntimeException(e); + } + formDataPublisher = HttpRequest.BodyPublishers + .ofInputStream(() -> new ByteArrayInputStream(formOutputStream.toByteArray())); + } + localVarRequestBuilder + .header("Content-Type", entity.getContentType().getValue()) + .method("POST", formDataPublisher); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Kill app + * Kill a running application by bundle id. + * @param udid (required) + * @param bundleID Bundle id of the app to kill. (required) + * @return GenericResponse + * @throws ApiException if fails to make API call + */ + public GenericResponse devicesKillApp(String udid, String bundleID) throws ApiException { + ApiResponse localVarResponse = devicesKillAppWithHttpInfo(udid, bundleID); + return localVarResponse.getData(); + } + + /** + * Kill app + * Kill a running application by bundle id. + * @param udid (required) + * @param bundleID Bundle id of the app to kill. (required) + * @return ApiResponse<GenericResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesKillAppWithHttpInfo(String udid, String bundleID) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesKillAppRequestBuilder(udid, bundleID); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesKillApp", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesKillAppRequestBuilder(String udid, String bundleID) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesKillApp"); + } + // verify the required parameter 'bundleID' is set + if (bundleID == null) { + throw new ApiException(400, "Missing the required parameter 'bundleID' when calling devicesKillApp"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/apps/kill" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "bundleID"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("bundleID", bundleID)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Launch app + * Launch an application by bundle id. + * @param udid (required) + * @param bundleID Bundle id of the app to launch. (required) + * @return GenericResponse + * @throws ApiException if fails to make API call + */ + public GenericResponse devicesLaunchApp(String udid, String bundleID) throws ApiException { + ApiResponse localVarResponse = devicesLaunchAppWithHttpInfo(udid, bundleID); + return localVarResponse.getData(); + } + + /** + * Launch app + * Launch an application by bundle id. + * @param udid (required) + * @param bundleID Bundle id of the app to launch. (required) + * @return ApiResponse<GenericResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesLaunchAppWithHttpInfo(String udid, String bundleID) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesLaunchAppRequestBuilder(udid, bundleID); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesLaunchApp", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesLaunchAppRequestBuilder(String udid, String bundleID) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesLaunchApp"); + } + // verify the required parameter 'bundleID' is set + if (bundleID == null) { + throw new ApiException(400, "Missing the required parameter 'bundleID' when calling devicesLaunchApp"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/apps/launch" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "bundleID"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("bundleID", bundleID)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List apps + * List installed applications. Each entry is an open Info.plist map. + * @param udid (required) + * @return List<AppInfo> + * @throws ApiException if fails to make API call + */ + public List devicesListApps(String udid) throws ApiException { + ApiResponse> localVarResponse = devicesListAppsWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * List apps + * List installed applications. Each entry is an open Info.plist map. + * @param udid (required) + * @return ApiResponse<List<AppInfo>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> devicesListAppsWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesListAppsRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesListApps", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference>() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesListAppsRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesListApps"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/apps/" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List conditions + * List available condition inducer profile types. + * @param udid (required) + * @return List<ProfileType> + * @throws ApiException if fails to make API call + */ + public List devicesListConditions(String udid) throws ApiException { + ApiResponse> localVarResponse = devicesListConditionsWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * List conditions + * List available condition inducer profile types. + * @param udid (required) + * @return ApiResponse<List<ProfileType>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> devicesListConditionsWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesListConditionsRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesListConditions", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference>() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesListConditionsRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesListConditions"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/conditions" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List crash reports + * List crash reports (CLI: `ios crash ls`). + * @param udid (required) + * @param pattern Optional glob pattern to filter reports. (optional) + * @return CrashListing + * @throws ApiException if fails to make API call + */ + public CrashListing devicesListCrashes(String udid, String pattern) throws ApiException { + ApiResponse localVarResponse = devicesListCrashesWithHttpInfo(udid, pattern); + return localVarResponse.getData(); + } + + /** + * List crash reports + * List crash reports (CLI: `ios crash ls`). + * @param udid (required) + * @param pattern Optional glob pattern to filter reports. (optional) + * @return ApiResponse<CrashListing> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesListCrashesWithHttpInfo(String udid, String pattern) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesListCrashesRequestBuilder(udid, pattern); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesListCrashes", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesListCrashesRequestBuilder(String udid, String pattern) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesListCrashes"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/crashes" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "pattern"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("pattern", pattern)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List files + * List a device directory (CLI: `ios file ls`). + * @param udid (required) + * @param domain File service domain: `app`, `app-group`, `crash` or `temp`. (required) + * @param identifier Bundle/group id for the `app`/`app-group` domains. (optional) + * @param path Directory path to list (defaults to `.`). (optional) + * @return FileListing + * @throws ApiException if fails to make API call + */ + public FileListing devicesListFiles(String udid, FileDomain domain, String identifier, String path) throws ApiException { + ApiResponse localVarResponse = devicesListFilesWithHttpInfo(udid, domain, identifier, path); + return localVarResponse.getData(); + } + + /** + * List files + * List a device directory (CLI: `ios file ls`). + * @param udid (required) + * @param domain File service domain: `app`, `app-group`, `crash` or `temp`. (required) + * @param identifier Bundle/group id for the `app`/`app-group` domains. (optional) + * @param path Directory path to list (defaults to `.`). (optional) + * @return ApiResponse<FileListing> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesListFilesWithHttpInfo(String udid, FileDomain domain, String identifier, String path) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesListFilesRequestBuilder(udid, domain, identifier, path); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesListFiles", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesListFilesRequestBuilder(String udid, FileDomain domain, String identifier, String path) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesListFiles"); + } + // verify the required parameter 'domain' is set + if (domain == null) { + throw new ApiException(400, "Missing the required parameter 'domain' when calling devicesListFiles"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/files" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "domain"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("domain", domain)); + localVarQueryParameterBaseName = "identifier"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("identifier", identifier)); + localVarQueryParameterBaseName = "path"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("path", path)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List mounted developer images + * List the hex signatures of Developer Disk Images mounted on the device. + * @param udid (required) + * @return List<String> + * @throws ApiException if fails to make API call + */ + public List devicesListImages(String udid) throws ApiException { + ApiResponse> localVarResponse = devicesListImagesWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * List mounted developer images + * List the hex signatures of Developer Disk Images mounted on the device. + * @param udid (required) + * @return ApiResponse<List<String>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> devicesListImagesWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesListImagesRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesListImages", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference>() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesListImagesRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesListImages"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/image" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List jobs + * List jobs for a device. + * @param udid (required) + * @return List<Job> + * @throws ApiException if fails to make API call + */ + public List devicesListJobs(String udid) throws ApiException { + ApiResponse> localVarResponse = devicesListJobsWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * List jobs + * List jobs for a device. + * @param udid (required) + * @return ApiResponse<List<Job>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> devicesListJobsWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesListJobsRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesListJobs", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference>() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesListJobsRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesListJobs"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/jobs" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List mounted images + * List mounted developer image signatures (CLI: `ios image list`). + * @param udid (required) + * @return MountedImages + * @throws ApiException if fails to make API call + */ + public MountedImages devicesListMountedImages(String udid) throws ApiException { + ApiResponse localVarResponse = devicesListMountedImagesWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * List mounted images + * List mounted developer image signatures (CLI: `ios image list`). + * @param udid (required) + * @return ApiResponse<MountedImages> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesListMountedImagesWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesListMountedImagesRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesListMountedImages", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesListMountedImagesRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesListMountedImages"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/image/list" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Clear passcode (supervised) + * Clear the device passcode (CLI: `ios mdm clear-passcode`). Requires the base64 unlock token as an additional `token` form field. + * @param udid (required) + * @param p12 (required) + * @param token Base64-encoded escrow unlock token. (required) + * @param password Passphrase for the `.p12` identity. (optional) + * @return StatusOk + * @throws ApiException if fails to make API call + */ + public StatusOk devicesMdmClearPasscode(String udid, Object p12, String token, String password) throws ApiException { + ApiResponse localVarResponse = devicesMdmClearPasscodeWithHttpInfo(udid, p12, token, password); + return localVarResponse.getData(); + } + + /** + * Clear passcode (supervised) + * Clear the device passcode (CLI: `ios mdm clear-passcode`). Requires the base64 unlock token as an additional `token` form field. + * @param udid (required) + * @param p12 (required) + * @param token Base64-encoded escrow unlock token. (required) + * @param password Passphrase for the `.p12` identity. (optional) + * @return ApiResponse<StatusOk> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesMdmClearPasscodeWithHttpInfo(String udid, Object p12, String token, String password) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesMdmClearPasscodeRequestBuilder(udid, p12, token, password); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesMdmClearPasscode", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesMdmClearPasscodeRequestBuilder(String udid, Object p12, String token, String password) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesMdmClearPasscode"); + } + // verify the required parameter 'p12' is set + if (p12 == null) { + throw new ApiException(400, "Missing the required parameter 'p12' when calling devicesMdmClearPasscode"); + } + // verify the required parameter 'token' is set + if (token == null) { + throw new ApiException(400, "Missing the required parameter 'token' when calling devicesMdmClearPasscode"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/mdm/clear-passcode" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + MultipartEntityBuilder multiPartBuilder = MultipartEntityBuilder.create(); + boolean hasFiles = false; + multiPartBuilder.addTextBody("p12", p12.toString()); + multiPartBuilder.addTextBody("password", password.toString()); + multiPartBuilder.addTextBody("token", token.toString()); + HttpEntity entity = multiPartBuilder.build(); + HttpRequest.BodyPublisher formDataPublisher; + if (hasFiles) { + Pipe pipe; + try { + pipe = Pipe.open(); + } catch (IOException e) { + throw new RuntimeException(e); + } + new Thread(() -> { + try (OutputStream outputStream = Channels.newOutputStream(pipe.sink())) { + entity.writeTo(outputStream); + } catch (IOException e) { + e.printStackTrace(); + } + }).start(); + formDataPublisher = HttpRequest.BodyPublishers.ofInputStream(() -> Channels.newInputStream(pipe.source())); + } else { + ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); + try { + entity.writeTo(formOutputStream); + } catch (IOException e) { + throw new RuntimeException(e); + } + formDataPublisher = HttpRequest.BodyPublishers + .ofInputStream(() -> new ByteArrayInputStream(formOutputStream.toByteArray())); + } + localVarRequestBuilder + .header("Content-Type", entity.getContentType().getValue()) + .method("POST", formDataPublisher); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Clear Screen Time password (supervised) + * Clear the Screen Time password (CLI: `ios mdm clear-screen-time-password`). + * @param udid (required) + * @param p12 (required) + * @param password Passphrase for the `.p12` identity. (optional) + * @return StatusOk + * @throws ApiException if fails to make API call + */ + public StatusOk devicesMdmClearScreenTimePassword(String udid, Object p12, String password) throws ApiException { + ApiResponse localVarResponse = devicesMdmClearScreenTimePasswordWithHttpInfo(udid, p12, password); + return localVarResponse.getData(); + } + + /** + * Clear Screen Time password (supervised) + * Clear the Screen Time password (CLI: `ios mdm clear-screen-time-password`). + * @param udid (required) + * @param p12 (required) + * @param password Passphrase for the `.p12` identity. (optional) + * @return ApiResponse<StatusOk> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesMdmClearScreenTimePasswordWithHttpInfo(String udid, Object p12, String password) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesMdmClearScreenTimePasswordRequestBuilder(udid, p12, password); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesMdmClearScreenTimePassword", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesMdmClearScreenTimePasswordRequestBuilder(String udid, Object p12, String password) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesMdmClearScreenTimePassword"); + } + // verify the required parameter 'p12' is set + if (p12 == null) { + throw new ApiException(400, "Missing the required parameter 'p12' when calling devicesMdmClearScreenTimePassword"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/mdm/clear-screen-time-password" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + MultipartEntityBuilder multiPartBuilder = MultipartEntityBuilder.create(); + boolean hasFiles = false; + multiPartBuilder.addTextBody("p12", p12.toString()); + multiPartBuilder.addTextBody("password", password.toString()); + HttpEntity entity = multiPartBuilder.build(); + HttpRequest.BodyPublisher formDataPublisher; + if (hasFiles) { + Pipe pipe; + try { + pipe = Pipe.open(); + } catch (IOException e) { + throw new RuntimeException(e); + } + new Thread(() -> { + try (OutputStream outputStream = Channels.newOutputStream(pipe.sink())) { + entity.writeTo(outputStream); + } catch (IOException e) { + e.printStackTrace(); + } + }).start(); + formDataPublisher = HttpRequest.BodyPublishers.ofInputStream(() -> Channels.newInputStream(pipe.source())); + } else { + ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); + try { + entity.writeTo(formOutputStream); + } catch (IOException e) { + throw new RuntimeException(e); + } + formDataPublisher = HttpRequest.BodyPublishers + .ofInputStream(() -> new ByteArrayInputStream(formOutputStream.toByteArray())); + } + localVarRequestBuilder + .header("Content-Type", entity.getContentType().getValue()) + .method("POST", formDataPublisher); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Fetch unlock token (supervised) + * Fetch the escrow unlock token, base64-encoded (CLI: `ios mdm fetch-unlock-token`). + * @param udid (required) + * @param p12 (required) + * @param password Passphrase for the `.p12` identity. (optional) + * @return UnlockToken + * @throws ApiException if fails to make API call + */ + public UnlockToken devicesMdmFetchUnlockToken(String udid, Object p12, String password) throws ApiException { + ApiResponse localVarResponse = devicesMdmFetchUnlockTokenWithHttpInfo(udid, p12, password); + return localVarResponse.getData(); + } + + /** + * Fetch unlock token (supervised) + * Fetch the escrow unlock token, base64-encoded (CLI: `ios mdm fetch-unlock-token`). + * @param udid (required) + * @param p12 (required) + * @param password Passphrase for the `.p12` identity. (optional) + * @return ApiResponse<UnlockToken> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesMdmFetchUnlockTokenWithHttpInfo(String udid, Object p12, String password) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesMdmFetchUnlockTokenRequestBuilder(udid, p12, password); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesMdmFetchUnlockToken", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesMdmFetchUnlockTokenRequestBuilder(String udid, Object p12, String password) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesMdmFetchUnlockToken"); + } + // verify the required parameter 'p12' is set + if (p12 == null) { + throw new ApiException(400, "Missing the required parameter 'p12' when calling devicesMdmFetchUnlockToken"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/mdm/fetch-unlock-token" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + MultipartEntityBuilder multiPartBuilder = MultipartEntityBuilder.create(); + boolean hasFiles = false; + multiPartBuilder.addTextBody("p12", p12.toString()); + multiPartBuilder.addTextBody("password", password.toString()); + HttpEntity entity = multiPartBuilder.build(); + HttpRequest.BodyPublisher formDataPublisher; + if (hasFiles) { + Pipe pipe; + try { + pipe = Pipe.open(); + } catch (IOException e) { + throw new RuntimeException(e); + } + new Thread(() -> { + try (OutputStream outputStream = Channels.newOutputStream(pipe.sink())) { + entity.writeTo(outputStream); + } catch (IOException e) { + e.printStackTrace(); + } + }).start(); + formDataPublisher = HttpRequest.BodyPublishers.ofInputStream(() -> Channels.newInputStream(pipe.source())); + } else { + ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); + try { + entity.writeTo(formOutputStream); + } catch (IOException e) { + throw new RuntimeException(e); + } + formDataPublisher = HttpRequest.BodyPublishers + .ofInputStream(() -> new ByteArrayInputStream(formOutputStream.toByteArray())); + } + localVarRequestBuilder + .header("Content-Type", entity.getContentType().getValue()) + .method("POST", formDataPublisher); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get MDM security info (supervised) + * Get device security info (CLI: `ios mdm security-info`). + * @param udid (required) + * @param p12 (required) + * @param password Passphrase for the `.p12` identity. (optional) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object devicesMdmSecurityInfo(String udid, Object p12, String password) throws ApiException { + ApiResponse localVarResponse = devicesMdmSecurityInfoWithHttpInfo(udid, p12, password); + return localVarResponse.getData(); + } + + /** + * Get MDM security info (supervised) + * Get device security info (CLI: `ios mdm security-info`). + * @param udid (required) + * @param p12 (required) + * @param password Passphrase for the `.p12` identity. (optional) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesMdmSecurityInfoWithHttpInfo(String udid, Object p12, String password) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesMdmSecurityInfoRequestBuilder(udid, p12, password); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesMdmSecurityInfo", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesMdmSecurityInfoRequestBuilder(String udid, Object p12, String password) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesMdmSecurityInfo"); + } + // verify the required parameter 'p12' is set + if (p12 == null) { + throw new ApiException(400, "Missing the required parameter 'p12' when calling devicesMdmSecurityInfo"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/mdm/security-info" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + MultipartEntityBuilder multiPartBuilder = MultipartEntityBuilder.create(); + boolean hasFiles = false; + multiPartBuilder.addTextBody("p12", p12.toString()); + multiPartBuilder.addTextBody("password", password.toString()); + HttpEntity entity = multiPartBuilder.build(); + HttpRequest.BodyPublisher formDataPublisher; + if (hasFiles) { + Pipe pipe; + try { + pipe = Pipe.open(); + } catch (IOException e) { + throw new RuntimeException(e); + } + new Thread(() -> { + try (OutputStream outputStream = Channels.newOutputStream(pipe.sink())) { + entity.writeTo(outputStream); + } catch (IOException e) { + e.printStackTrace(); + } + }).start(); + formDataPublisher = HttpRequest.BodyPublishers.ofInputStream(() -> Channels.newInputStream(pipe.source())); + } else { + ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); + try { + entity.writeTo(formOutputStream); + } catch (IOException e) { + throw new RuntimeException(e); + } + formDataPublisher = HttpRequest.BodyPublishers + .ofInputStream(() -> new ByteArrayInputStream(formOutputStream.toByteArray())); + } + localVarRequestBuilder + .header("Content-Type", entity.getContentType().getValue()) + .method("POST", formDataPublisher); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Waive memory limit + * Waive the memory limit for a process (CLI: `ios memlimitoff`). The process name may be given via the `process` query param or the JSON body. + * @param udid (required) + * @param process Process name whose memory limit should be waived. (optional) + * @param memLimitRequest (optional) + * @return MemLimitResult + * @throws ApiException if fails to make API call + */ + public MemLimitResult devicesMemLimitOff(String udid, String process, MemLimitRequest memLimitRequest) throws ApiException { + ApiResponse localVarResponse = devicesMemLimitOffWithHttpInfo(udid, process, memLimitRequest); + return localVarResponse.getData(); + } + + /** + * Waive memory limit + * Waive the memory limit for a process (CLI: `ios memlimitoff`). The process name may be given via the `process` query param or the JSON body. + * @param udid (required) + * @param process Process name whose memory limit should be waived. (optional) + * @param memLimitRequest (optional) + * @return ApiResponse<MemLimitResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesMemLimitOffWithHttpInfo(String udid, String process, MemLimitRequest memLimitRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesMemLimitOffRequestBuilder(udid, process, memLimitRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesMemLimitOff", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesMemLimitOffRequestBuilder(String udid, String process, MemLimitRequest memLimitRequest) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesMemLimitOff"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/memlimitoff" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "process"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("process", process)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(memLimitRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Mount a developer image + * Mount a Developer Disk Image. Either let the server auto-resolve and download the correct image (`auto=true`, optionally with `basedir`), or stream the image bytes as the raw request body (up to 2 GiB). + * @param udid (required) + * @param auto Auto-resolve and download the matching DDI for the device. (optional) + * @param basedir Base directory the server uses to cache/lookup DDIs when `auto=true`. (optional) + * @param body Raw Developer Disk Image bytes (used when not auto-resolving). Content up to 2 GiB. (optional) + * @return GenericResponse + * @throws ApiException if fails to make API call + */ + public GenericResponse devicesMountImage(String udid, Boolean auto, String basedir, Object body) throws ApiException { + ApiResponse localVarResponse = devicesMountImageWithHttpInfo(udid, auto, basedir, body); + return localVarResponse.getData(); + } + + /** + * Mount a developer image + * Mount a Developer Disk Image. Either let the server auto-resolve and download the correct image (`auto=true`, optionally with `basedir`), or stream the image bytes as the raw request body (up to 2 GiB). + * @param udid (required) + * @param auto Auto-resolve and download the matching DDI for the device. (optional) + * @param basedir Base directory the server uses to cache/lookup DDIs when `auto=true`. (optional) + * @param body Raw Developer Disk Image bytes (used when not auto-resolving). Content up to 2 GiB. (optional) + * @return ApiResponse<GenericResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesMountImageWithHttpInfo(String udid, Boolean auto, String basedir, Object body) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesMountImageRequestBuilder(udid, auto, basedir, body); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesMountImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesMountImageRequestBuilder(String udid, Boolean auto, String basedir, Object body) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesMountImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/image" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "auto"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("auto", auto)); + localVarQueryParameterBaseName = "basedir"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("basedir", basedir)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/octet-stream"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Pair device + * Pair with the device. For a supervised pairing (`supervised=true`) upload the supervision identity as `p12file` (multipart) and supply the passphrase in the `Supervision-Password` header. Returns `423` when the device is locked and pairing cannot proceed. + * @param udid (required) + * @param supervised Whether this is a supervised pairing. (required) + * @param p12file (required) + * @param supervisionPassword Supervision identity passphrase (required when supervised). (optional) + * @return GenericResponse + * @throws ApiException if fails to make API call + */ + public GenericResponse devicesPair(String udid, Boolean supervised, Object p12file, String supervisionPassword) throws ApiException { + ApiResponse localVarResponse = devicesPairWithHttpInfo(udid, supervised, p12file, supervisionPassword); + return localVarResponse.getData(); + } + + /** + * Pair device + * Pair with the device. For a supervised pairing (`supervised=true`) upload the supervision identity as `p12file` (multipart) and supply the passphrase in the `Supervision-Password` header. Returns `423` when the device is locked and pairing cannot proceed. + * @param udid (required) + * @param supervised Whether this is a supervised pairing. (required) + * @param p12file (required) + * @param supervisionPassword Supervision identity passphrase (required when supervised). (optional) + * @return ApiResponse<GenericResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesPairWithHttpInfo(String udid, Boolean supervised, Object p12file, String supervisionPassword) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesPairRequestBuilder(udid, supervised, p12file, supervisionPassword); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesPair", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesPairRequestBuilder(String udid, Boolean supervised, Object p12file, String supervisionPassword) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesPair"); + } + // verify the required parameter 'supervised' is set + if (supervised == null) { + throw new ApiException(400, "Missing the required parameter 'supervised' when calling devicesPair"); + } + // verify the required parameter 'p12file' is set + if (p12file == null) { + throw new ApiException(400, "Missing the required parameter 'p12file' when calling devicesPair"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/pair" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "supervised"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("supervised", supervised)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + if (supervisionPassword != null) { + localVarRequestBuilder.header("Supervision-Password", supervisionPassword.toString()); + } + localVarRequestBuilder.header("Accept", "application/json"); + + MultipartEntityBuilder multiPartBuilder = MultipartEntityBuilder.create(); + boolean hasFiles = false; + multiPartBuilder.addTextBody("p12file", p12file.toString()); + HttpEntity entity = multiPartBuilder.build(); + HttpRequest.BodyPublisher formDataPublisher; + if (hasFiles) { + Pipe pipe; + try { + pipe = Pipe.open(); + } catch (IOException e) { + throw new RuntimeException(e); + } + new Thread(() -> { + try (OutputStream outputStream = Channels.newOutputStream(pipe.sink())) { + entity.writeTo(outputStream); + } catch (IOException e) { + e.printStackTrace(); + } + }).start(); + formDataPublisher = HttpRequest.BodyPublishers.ofInputStream(() -> Channels.newInputStream(pipe.source())); + } else { + ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); + try { + entity.writeTo(formOutputStream); + } catch (IOException e) { + throw new RuntimeException(e); + } + formDataPublisher = HttpRequest.BodyPublishers + .ofInputStream(() -> new ByteArrayInputStream(formOutputStream.toByteArray())); + } + localVarRequestBuilder + .header("Content-Type", entity.getContentType().getValue()) + .method("POST", formDataPublisher); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Pull file + * Download a file from the device, streamed as the response body (CLI: `ios file pull`). + * @param udid (required) + * @param domain File service domain: `app`, `app-group`, `crash` or `temp`. (required) + * @param remote Remote file path on the device. (required) + * @param identifier Bundle/group id for the `app`/`app-group` domains. (optional) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object devicesPullFile(String udid, FileDomain domain, String remote, String identifier) throws ApiException { + ApiResponse localVarResponse = devicesPullFileWithHttpInfo(udid, domain, remote, identifier); + return localVarResponse.getData(); + } + + /** + * Pull file + * Download a file from the device, streamed as the response body (CLI: `ios file pull`). + * @param udid (required) + * @param domain File service domain: `app`, `app-group`, `crash` or `temp`. (required) + * @param remote Remote file path on the device. (required) + * @param identifier Bundle/group id for the `app`/`app-group` domains. (optional) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesPullFileWithHttpInfo(String udid, FileDomain domain, String remote, String identifier) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesPullFileRequestBuilder(udid, domain, remote, identifier); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesPullFile", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesPullFileRequestBuilder(String udid, FileDomain domain, String remote, String identifier) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesPullFile"); + } + // verify the required parameter 'domain' is set + if (domain == null) { + throw new ApiException(400, "Missing the required parameter 'domain' when calling devicesPullFile"); + } + // verify the required parameter 'remote' is set + if (remote == null) { + throw new ApiException(400, "Missing the required parameter 'remote' when calling devicesPullFile"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/files/pull" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "domain"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("domain", domain)); + localVarQueryParameterBaseName = "identifier"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("identifier", identifier)); + localVarQueryParameterBaseName = "remote"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("remote", remote)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/octet-stream, application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Push file + * Upload the request body to a device path (CLI: `ios file push`). A `Content-Length` header is required. + * @param udid (required) + * @param domain File service domain: `app`, `app-group`, `crash` or `temp`. (required) + * @param remote Destination path on the device. (required) + * @param body Raw file bytes to upload. (required) + * @param identifier Bundle/group id for the `app`/`app-group` domains. (optional) + * @return FilePushResult + * @throws ApiException if fails to make API call + */ + public FilePushResult devicesPushFile(String udid, FileDomain domain, String remote, Object body, String identifier) throws ApiException { + ApiResponse localVarResponse = devicesPushFileWithHttpInfo(udid, domain, remote, body, identifier); + return localVarResponse.getData(); + } + + /** + * Push file + * Upload the request body to a device path (CLI: `ios file push`). A `Content-Length` header is required. + * @param udid (required) + * @param domain File service domain: `app`, `app-group`, `crash` or `temp`. (required) + * @param remote Destination path on the device. (required) + * @param body Raw file bytes to upload. (required) + * @param identifier Bundle/group id for the `app`/`app-group` domains. (optional) + * @return ApiResponse<FilePushResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesPushFileWithHttpInfo(String udid, FileDomain domain, String remote, Object body, String identifier) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesPushFileRequestBuilder(udid, domain, remote, body, identifier); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesPushFile", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesPushFileRequestBuilder(String udid, FileDomain domain, String remote, Object body, String identifier) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesPushFile"); + } + // verify the required parameter 'domain' is set + if (domain == null) { + throw new ApiException(400, "Missing the required parameter 'domain' when calling devicesPushFile"); + } + // verify the required parameter 'remote' is set + if (remote == null) { + throw new ApiException(400, "Missing the required parameter 'remote' when calling devicesPushFile"); + } + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling devicesPushFile"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/files/push" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "domain"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("domain", domain)); + localVarQueryParameterBaseName = "identifier"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("identifier", identifier)); + localVarQueryParameterBaseName = "remote"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("remote", remote)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/octet-stream"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Reboot device + * Reboot the device (CLI: `ios reboot`). + * @param udid (required) + * @return GenericResponse + * @throws ApiException if fails to make API call + */ + public GenericResponse devicesReboot(String udid) throws ApiException { + ApiResponse localVarResponse = devicesRebootWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Reboot device + * Reboot the device (CLI: `ios reboot`). + * @param udid (required) + * @return ApiResponse<GenericResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesRebootWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesRebootRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesReboot", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesRebootRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesReboot"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/reboot" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Delete crash reports + * Delete crash reports (CLI: `ios crash rm`). + * @param udid (required) + * @param cwd Working directory on the device. (required) + * @param pattern Glob pattern of reports to delete. (required) + * @return GenericResponse + * @throws ApiException if fails to make API call + */ + public GenericResponse devicesRemoveCrashes(String udid, String cwd, String pattern) throws ApiException { + ApiResponse localVarResponse = devicesRemoveCrashesWithHttpInfo(udid, cwd, pattern); + return localVarResponse.getData(); + } + + /** + * Delete crash reports + * Delete crash reports (CLI: `ios crash rm`). + * @param udid (required) + * @param cwd Working directory on the device. (required) + * @param pattern Glob pattern of reports to delete. (required) + * @return ApiResponse<GenericResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesRemoveCrashesWithHttpInfo(String udid, String cwd, String pattern) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesRemoveCrashesRequestBuilder(udid, cwd, pattern); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesRemoveCrashes", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesRemoveCrashesRequestBuilder(String udid, String cwd, String pattern) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesRemoveCrashes"); + } + // verify the required parameter 'cwd' is set + if (cwd == null) { + throw new ApiException(400, "Missing the required parameter 'cwd' when calling devicesRemoveCrashes"); + } + // verify the required parameter 'pattern' is set + if (pattern == null) { + throw new ApiException(400, "Missing the required parameter 'pattern' when calling devicesRemoveCrashes"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/crashes" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "cwd"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("cwd", cwd)); + localVarQueryParameterBaseName = "pattern"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("pattern", pattern)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Remove HTTP proxy + * Clear the global HTTP proxy (CLI: `ios httpproxy remove`). + * @param udid (required) + * @return GenericResponse + * @throws ApiException if fails to make API call + */ + public GenericResponse devicesRemoveHttpProxy(String udid) throws ApiException { + ApiResponse localVarResponse = devicesRemoveHttpProxyWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Remove HTTP proxy + * Clear the global HTTP proxy (CLI: `ios httpproxy remove`). + * @param udid (required) + * @return ApiResponse<GenericResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesRemoveHttpProxyWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesRemoveHttpProxyRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesRemoveHttpProxy", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesRemoveHttpProxyRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesRemoveHttpProxy"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/httpproxy" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Remove profile + * Remove a configuration profile by identifier (CLI: `ios profile remove`). + * @param udid (required) + * @param name The profile identifier to remove. (required) + * @return GenericResponse + * @throws ApiException if fails to make API call + */ + public GenericResponse devicesRemoveProfile(String udid, String name) throws ApiException { + ApiResponse localVarResponse = devicesRemoveProfileWithHttpInfo(udid, name); + return localVarResponse.getData(); + } + + /** + * Remove profile + * Remove a configuration profile by identifier (CLI: `ios profile remove`). + * @param udid (required) + * @param name The profile identifier to remove. (required) + * @return ApiResponse<GenericResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesRemoveProfileWithHttpInfo(String udid, String name) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesRemoveProfileRequestBuilder(udid, name); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesRemoveProfile", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesRemoveProfileRequestBuilder(String udid, String name) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesRemoveProfile"); + } + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException(400, "Missing the required parameter 'name' when calling devicesRemoveProfile"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/profiles/{name}" + .replace("{udid}", ApiClient.urlEncode(udid.toString())) + .replace("{name}", ApiClient.urlEncode(name.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Remove wifi + * Remove a provisioned wifi network (CLI: `ios wifi --remove`). + * @param udid (required) + * @param ssid SSID of the network to remove. (required) + * @return GenericResponse + * @throws ApiException if fails to make API call + */ + public GenericResponse devicesRemoveWifi(String udid, String ssid) throws ApiException { + ApiResponse localVarResponse = devicesRemoveWifiWithHttpInfo(udid, ssid); + return localVarResponse.getData(); + } + + /** + * Remove wifi + * Remove a provisioned wifi network (CLI: `ios wifi --remove`). + * @param udid (required) + * @param ssid SSID of the network to remove. (required) + * @return ApiResponse<GenericResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesRemoveWifiWithHttpInfo(String udid, String ssid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesRemoveWifiRequestBuilder(udid, ssid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesRemoveWifi", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesRemoveWifiRequestBuilder(String udid, String ssid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesRemoveWifi"); + } + // verify the required parameter 'ssid' is set + if (ssid == null) { + throw new ApiException(400, "Missing the required parameter 'ssid' when calling devicesRemoveWifi"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/wifi" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "ssid"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("ssid", ssid)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Reset accessibility + * Reset accessibility settings on the device. + * @param udid (required) + * @return GenericResponse + * @throws ApiException if fails to make API call + */ + public GenericResponse devicesResetAccessibility(String udid) throws ApiException { + ApiResponse localVarResponse = devicesResetAccessibilityWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Reset accessibility + * Reset accessibility settings on the device. + * @param udid (required) + * @return ApiResponse<GenericResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesResetAccessibilityWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesResetAccessibilityRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesResetAccessibility", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesResetAccessibilityRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesResetAccessibility"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/resetaccessibility" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Reset simulated location + * Reset the simulated location back to the device's real GPS location. + * @param udid (required) + * @return GenericResponse + * @throws ApiException if fails to make API call + */ + public GenericResponse devicesResetLocation(String udid) throws ApiException { + ApiResponse localVarResponse = devicesResetLocationWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Reset simulated location + * Reset the simulated location back to the device's real GPS location. + * @param udid (required) + * @return ApiResponse<GenericResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesResetLocationWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesResetLocationRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesResetLocation", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesResetLocationRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesResetLocation"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/resetlocation" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Capture screenshot + * Capture a screenshot. Returns raw PNG bytes (`image/png`). + * @param udid (required) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object devicesScreenshot(String udid) throws ApiException { + ApiResponse localVarResponse = devicesScreenshotWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Capture screenshot + * Capture a screenshot. Returns raw PNG bytes (`image/png`). + * @param udid (required) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesScreenshotWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesScreenshotRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesScreenshot", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesScreenshotRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesScreenshot"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/screenshot" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "image/png, application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Set AssistiveTouch + * Enable/disable AssistiveTouch (CLI: `ios assistivetouch enable|disable`). + * @param udid (required) + * @param enabledRequest (required) + * @return AssistiveTouchState + * @throws ApiException if fails to make API call + */ + public AssistiveTouchState devicesSetAssistiveTouch(String udid, EnabledRequest enabledRequest) throws ApiException { + ApiResponse localVarResponse = devicesSetAssistiveTouchWithHttpInfo(udid, enabledRequest); + return localVarResponse.getData(); + } + + /** + * Set AssistiveTouch + * Enable/disable AssistiveTouch (CLI: `ios assistivetouch enable|disable`). + * @param udid (required) + * @param enabledRequest (required) + * @return ApiResponse<AssistiveTouchState> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesSetAssistiveTouchWithHttpInfo(String udid, EnabledRequest enabledRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesSetAssistiveTouchRequestBuilder(udid, enabledRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesSetAssistiveTouch", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesSetAssistiveTouchRequestBuilder(String udid, EnabledRequest enabledRequest) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesSetAssistiveTouch"); + } + // verify the required parameter 'enabledRequest' is set + if (enabledRequest == null) { + throw new ApiException(400, "Missing the required parameter 'enabledRequest' when calling devicesSetAssistiveTouch"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/assistivetouch" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(enabledRequest); + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Set developer mode + * Enable or reveal developer mode (CLI: `ios devmode enable|reveal`). + * @param udid (required) + * @param devModeRequest (required) + * @return GenericResponse + * @throws ApiException if fails to make API call + */ + public GenericResponse devicesSetDevMode(String udid, DevModeRequest devModeRequest) throws ApiException { + ApiResponse localVarResponse = devicesSetDevModeWithHttpInfo(udid, devModeRequest); + return localVarResponse.getData(); + } + + /** + * Set developer mode + * Enable or reveal developer mode (CLI: `ios devmode enable|reveal`). + * @param udid (required) + * @param devModeRequest (required) + * @return ApiResponse<GenericResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesSetDevModeWithHttpInfo(String udid, DevModeRequest devModeRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesSetDevModeRequestBuilder(udid, devModeRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesSetDevMode", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesSetDevModeRequestBuilder(String udid, DevModeRequest devModeRequest) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesSetDevMode"); + } + // verify the required parameter 'devModeRequest' is set + if (devModeRequest == null) { + throw new ApiException(400, "Missing the required parameter 'devModeRequest' when calling devicesSetDevMode"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/devmode" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(devModeRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Set HTTP proxy (supervised) + * Configure a global HTTP proxy (CLI: `ios httpproxy`). Supervised: send multipart form-data with `host`, `port`, a `p12` supervisor identity and optional `user`/`pass`/`password` fields. + * @param udid (required) + * @param host Proxy host. (required) + * @param port Proxy port. (required) + * @param p12 (required) + * @param user Proxy username. (optional) + * @param pass Proxy password. (optional) + * @param password Passphrase for the `.p12` identity. (optional) + * @return GenericResponse + * @throws ApiException if fails to make API call + */ + public GenericResponse devicesSetHttpProxy(String udid, String host, String port, Object p12, String user, String pass, String password) throws ApiException { + ApiResponse localVarResponse = devicesSetHttpProxyWithHttpInfo(udid, host, port, p12, user, pass, password); + return localVarResponse.getData(); + } + + /** + * Set HTTP proxy (supervised) + * Configure a global HTTP proxy (CLI: `ios httpproxy`). Supervised: send multipart form-data with `host`, `port`, a `p12` supervisor identity and optional `user`/`pass`/`password` fields. + * @param udid (required) + * @param host Proxy host. (required) + * @param port Proxy port. (required) + * @param p12 (required) + * @param user Proxy username. (optional) + * @param pass Proxy password. (optional) + * @param password Passphrase for the `.p12` identity. (optional) + * @return ApiResponse<GenericResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesSetHttpProxyWithHttpInfo(String udid, String host, String port, Object p12, String user, String pass, String password) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesSetHttpProxyRequestBuilder(udid, host, port, p12, user, pass, password); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesSetHttpProxy", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesSetHttpProxyRequestBuilder(String udid, String host, String port, Object p12, String user, String pass, String password) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesSetHttpProxy"); + } + // verify the required parameter 'host' is set + if (host == null) { + throw new ApiException(400, "Missing the required parameter 'host' when calling devicesSetHttpProxy"); + } + // verify the required parameter 'port' is set + if (port == null) { + throw new ApiException(400, "Missing the required parameter 'port' when calling devicesSetHttpProxy"); + } + // verify the required parameter 'p12' is set + if (p12 == null) { + throw new ApiException(400, "Missing the required parameter 'p12' when calling devicesSetHttpProxy"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/httpproxy" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + MultipartEntityBuilder multiPartBuilder = MultipartEntityBuilder.create(); + boolean hasFiles = false; + multiPartBuilder.addTextBody("host", host.toString()); + multiPartBuilder.addTextBody("port", port.toString()); + multiPartBuilder.addTextBody("p12", p12.toString()); + multiPartBuilder.addTextBody("user", user.toString()); + multiPartBuilder.addTextBody("pass", pass.toString()); + multiPartBuilder.addTextBody("password", password.toString()); + HttpEntity entity = multiPartBuilder.build(); + HttpRequest.BodyPublisher formDataPublisher; + if (hasFiles) { + Pipe pipe; + try { + pipe = Pipe.open(); + } catch (IOException e) { + throw new RuntimeException(e); + } + new Thread(() -> { + try (OutputStream outputStream = Channels.newOutputStream(pipe.sink())) { + entity.writeTo(outputStream); + } catch (IOException e) { + e.printStackTrace(); + } + }).start(); + formDataPublisher = HttpRequest.BodyPublishers.ofInputStream(() -> Channels.newInputStream(pipe.source())); + } else { + ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); + try { + entity.writeTo(formOutputStream); + } catch (IOException e) { + throw new RuntimeException(e); + } + formDataPublisher = HttpRequest.BodyPublishers + .ofInputStream(() -> new ByteArrayInputStream(formOutputStream.toByteArray())); + } + localVarRequestBuilder + .header("Content-Type", entity.getContentType().getValue()) + .method("PUT", formDataPublisher); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Set icon layout + * Restore a SpringBoard icon layout (CLI: `ios set-icon-layout`). Body is the layout JSON as returned by GET. + * @param udid (required) + * @param body (required) + * @return GenericResponse + * @throws ApiException if fails to make API call + */ + public GenericResponse devicesSetIconLayout(String udid, Object body) throws ApiException { + ApiResponse localVarResponse = devicesSetIconLayoutWithHttpInfo(udid, body); + return localVarResponse.getData(); + } + + /** + * Set icon layout + * Restore a SpringBoard icon layout (CLI: `ios set-icon-layout`). Body is the layout JSON as returned by GET. + * @param udid (required) + * @param body (required) + * @return ApiResponse<GenericResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesSetIconLayoutWithHttpInfo(String udid, Object body) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesSetIconLayoutRequestBuilder(udid, body); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesSetIconLayout", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesSetIconLayoutRequestBuilder(String udid, Object body) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesSetIconLayout"); + } + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling devicesSetIconLayout"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/icon-layout" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Set language + * Set the device language and/or locale (CLI: `ios lang --setlang --setlocale`). Returns the resulting configuration. + * @param udid (required) + * @param setLanguageRequest (required) + * @return LanguageConfiguration + * @throws ApiException if fails to make API call + */ + public LanguageConfiguration devicesSetLanguage(String udid, SetLanguageRequest setLanguageRequest) throws ApiException { + ApiResponse localVarResponse = devicesSetLanguageWithHttpInfo(udid, setLanguageRequest); + return localVarResponse.getData(); + } + + /** + * Set language + * Set the device language and/or locale (CLI: `ios lang --setlang --setlocale`). Returns the resulting configuration. + * @param udid (required) + * @param setLanguageRequest (required) + * @return ApiResponse<LanguageConfiguration> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesSetLanguageWithHttpInfo(String udid, SetLanguageRequest setLanguageRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesSetLanguageRequestBuilder(udid, setLanguageRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesSetLanguage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesSetLanguageRequestBuilder(String udid, SetLanguageRequest setLanguageRequest) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesSetLanguage"); + } + // verify the required parameter 'setLanguageRequest' is set + if (setLanguageRequest == null) { + throw new ApiException(400, "Missing the required parameter 'setLanguageRequest' when calling devicesSetLanguage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/lang" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(setLanguageRequest); + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Set simulated location + * Simulate a GPS location on the device. NOTE: the longitude parameter was historically misspelled `longtitude` on the wire. This spec fixes it to `longitude`; the go-ios server accepts `longitude` (and may keep `longtitude` as a deprecated alias). + * @param udid (required) + * @param latitude Latitude in decimal degrees. (required) + * @param longitude Longitude in decimal degrees. (required) + * @return GenericResponse + * @throws ApiException if fails to make API call + */ + public GenericResponse devicesSetLocation(String udid, String latitude, String longitude) throws ApiException { + ApiResponse localVarResponse = devicesSetLocationWithHttpInfo(udid, latitude, longitude); + return localVarResponse.getData(); + } + + /** + * Set simulated location + * Simulate a GPS location on the device. NOTE: the longitude parameter was historically misspelled `longtitude` on the wire. This spec fixes it to `longitude`; the go-ios server accepts `longitude` (and may keep `longtitude` as a deprecated alias). + * @param udid (required) + * @param latitude Latitude in decimal degrees. (required) + * @param longitude Longitude in decimal degrees. (required) + * @return ApiResponse<GenericResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesSetLocationWithHttpInfo(String udid, String latitude, String longitude) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesSetLocationRequestBuilder(udid, latitude, longitude); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesSetLocation", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesSetLocationRequestBuilder(String udid, String latitude, String longitude) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesSetLocation"); + } + // verify the required parameter 'latitude' is set + if (latitude == null) { + throw new ApiException(400, "Missing the required parameter 'latitude' when calling devicesSetLocation"); + } + // verify the required parameter 'longitude' is set + if (longitude == null) { + throw new ApiException(400, "Missing the required parameter 'longitude' when calling devicesSetLocation"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/setlocation" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "latitude"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("latitude", latitude)); + localVarQueryParameterBaseName = "longitude"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("longitude", longitude)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Set pasteboard + * Set the pasteboard text from the raw request body (CLI: `ios pasteboard set`). + * @param udid (required) + * @param body (required) + * @return GenericResponse + * @throws ApiException if fails to make API call + */ + public GenericResponse devicesSetPasteboard(String udid, String body) throws ApiException { + ApiResponse localVarResponse = devicesSetPasteboardWithHttpInfo(udid, body); + return localVarResponse.getData(); + } + + /** + * Set pasteboard + * Set the pasteboard text from the raw request body (CLI: `ios pasteboard set`). + * @param udid (required) + * @param body (required) + * @return ApiResponse<GenericResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesSetPasteboardWithHttpInfo(String udid, String body) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesSetPasteboardRequestBuilder(udid, body); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesSetPasteboard", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesSetPasteboardRequestBuilder(String udid, String body) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesSetPasteboard"); + } + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling devicesSetPasteboard"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/pasteboard" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "text/plain"); + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofString(body)); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Set time format + * Set 24-hour / 12-hour clock (CLI: `ios timeformat 24h|12h`). + * @param udid (required) + * @param timeFormatRequest (required) + * @return TimeFormatState + * @throws ApiException if fails to make API call + */ + public TimeFormatState devicesSetTimeFormat(String udid, TimeFormatRequest timeFormatRequest) throws ApiException { + ApiResponse localVarResponse = devicesSetTimeFormatWithHttpInfo(udid, timeFormatRequest); + return localVarResponse.getData(); + } + + /** + * Set time format + * Set 24-hour / 12-hour clock (CLI: `ios timeformat 24h|12h`). + * @param udid (required) + * @param timeFormatRequest (required) + * @return ApiResponse<TimeFormatState> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesSetTimeFormatWithHttpInfo(String udid, TimeFormatRequest timeFormatRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesSetTimeFormatRequestBuilder(udid, timeFormatRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesSetTimeFormat", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesSetTimeFormatRequestBuilder(String udid, TimeFormatRequest timeFormatRequest) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesSetTimeFormat"); + } + // verify the required parameter 'timeFormatRequest' is set + if (timeFormatRequest == null) { + throw new ApiException(400, "Missing the required parameter 'timeFormatRequest' when calling devicesSetTimeFormat"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/timeformat" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(timeFormatRequest); + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Set wallpaper (supervised) + * Set the wallpaper (CLI: `ios set-wallpaper`). Supervised: upload the image and a `.p12` supervisor identity as multipart form-data. + * @param udid (required) + * @param image (required) + * @param p12 (required) + * @param password Passphrase for the `.p12` identity. (optional) + * @param screen Target screen (`home`, `lock`, `both`). (optional) + * @return GenericResponse + * @throws ApiException if fails to make API call + */ + public GenericResponse devicesSetWallpaper(String udid, Object image, Object p12, String password, String screen) throws ApiException { + ApiResponse localVarResponse = devicesSetWallpaperWithHttpInfo(udid, image, p12, password, screen); + return localVarResponse.getData(); + } + + /** + * Set wallpaper (supervised) + * Set the wallpaper (CLI: `ios set-wallpaper`). Supervised: upload the image and a `.p12` supervisor identity as multipart form-data. + * @param udid (required) + * @param image (required) + * @param p12 (required) + * @param password Passphrase for the `.p12` identity. (optional) + * @param screen Target screen (`home`, `lock`, `both`). (optional) + * @return ApiResponse<GenericResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesSetWallpaperWithHttpInfo(String udid, Object image, Object p12, String password, String screen) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesSetWallpaperRequestBuilder(udid, image, p12, password, screen); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesSetWallpaper", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesSetWallpaperRequestBuilder(String udid, Object image, Object p12, String password, String screen) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesSetWallpaper"); + } + // verify the required parameter 'image' is set + if (image == null) { + throw new ApiException(400, "Missing the required parameter 'image' when calling devicesSetWallpaper"); + } + // verify the required parameter 'p12' is set + if (p12 == null) { + throw new ApiException(400, "Missing the required parameter 'p12' when calling devicesSetWallpaper"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/wallpaper" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + MultipartEntityBuilder multiPartBuilder = MultipartEntityBuilder.create(); + boolean hasFiles = false; + multiPartBuilder.addTextBody("image", image.toString()); + multiPartBuilder.addTextBody("p12", p12.toString()); + multiPartBuilder.addTextBody("password", password.toString()); + multiPartBuilder.addTextBody("screen", screen.toString()); + HttpEntity entity = multiPartBuilder.build(); + HttpRequest.BodyPublisher formDataPublisher; + if (hasFiles) { + Pipe pipe; + try { + pipe = Pipe.open(); + } catch (IOException e) { + throw new RuntimeException(e); + } + new Thread(() -> { + try (OutputStream outputStream = Channels.newOutputStream(pipe.sink())) { + entity.writeTo(outputStream); + } catch (IOException e) { + e.printStackTrace(); + } + }).start(); + formDataPublisher = HttpRequest.BodyPublishers.ofInputStream(() -> Channels.newInputStream(pipe.source())); + } else { + ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); + try { + entity.writeTo(formOutputStream); + } catch (IOException e) { + throw new RuntimeException(e); + } + formDataPublisher = HttpRequest.BodyPublishers + .ofInputStream(() -> new ByteArrayInputStream(formOutputStream.toByteArray())); + } + localVarRequestBuilder + .header("Content-Type", entity.getContentType().getValue()) + .method("PUT", formDataPublisher); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Provision wifi + * Provision a wifi network (CLI: `ios wifi`). + * @param udid (required) + * @param wifiRequest (required) + * @return GenericResponse + * @throws ApiException if fails to make API call + */ + public GenericResponse devicesSetWifi(String udid, WifiRequest wifiRequest) throws ApiException { + ApiResponse localVarResponse = devicesSetWifiWithHttpInfo(udid, wifiRequest); + return localVarResponse.getData(); + } + + /** + * Provision wifi + * Provision a wifi network (CLI: `ios wifi`). + * @param udid (required) + * @param wifiRequest (required) + * @return ApiResponse<GenericResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesSetWifiWithHttpInfo(String udid, WifiRequest wifiRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesSetWifiRequestBuilder(udid, wifiRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesSetWifi", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesSetWifiRequestBuilder(String udid, WifiRequest wifiRequest) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesSetWifi"); + } + // verify the required parameter 'wifiRequest' is set + if (wifiRequest == null) { + throw new ApiException(400, "Missing the required parameter 'wifiRequest' when calling devicesSetWifi"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/wifi" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(wifiRequest); + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Shut down device + * Shut down the device (CLI: `ios shutdown`). + * @param udid (required) + * @return GenericResponse + * @throws ApiException if fails to make API call + */ + public GenericResponse devicesShutdown(String udid) throws ApiException { + ApiResponse localVarResponse = devicesShutdownWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Shut down device + * Shut down the device (CLI: `ios shutdown`). + * @param udid (required) + * @return ApiResponse<GenericResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesShutdownWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesShutdownRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesShutdown", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesShutdownRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesShutdown"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/shutdown" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Start port forward (job) + * Start a TCP port forward host→device as an async job (CLI: `ios forward`). + * @param udid (required) + * @param forwardRequest (required) + * @return Job + * @throws ApiException if fails to make API call + */ + public Job devicesStartForward(String udid, ForwardRequest forwardRequest) throws ApiException { + ApiResponse localVarResponse = devicesStartForwardWithHttpInfo(udid, forwardRequest); + return localVarResponse.getData(); + } + + /** + * Start port forward (job) + * Start a TCP port forward host→device as an async job (CLI: `ios forward`). + * @param udid (required) + * @param forwardRequest (required) + * @return ApiResponse<Job> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesStartForwardWithHttpInfo(String udid, ForwardRequest forwardRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesStartForwardRequestBuilder(udid, forwardRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesStartForward", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesStartForwardRequestBuilder(String udid, ForwardRequest forwardRequest) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesStartForward"); + } + // verify the required parameter 'forwardRequest' is set + if (forwardRequest == null) { + throw new ApiException(400, "Missing the required parameter 'forwardRequest' when calling devicesStartForward"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/jobs/forward" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(forwardRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Start test run (job) + * Start an XCUITest/unit-test run as an async job (CLI: `ios runtest`). Returns `202` with the created job. + * @param udid (required) + * @param runTestRequest (required) + * @return Job + * @throws ApiException if fails to make API call + */ + public Job devicesStartRunTest(String udid, RunTestRequest runTestRequest) throws ApiException { + ApiResponse localVarResponse = devicesStartRunTestWithHttpInfo(udid, runTestRequest); + return localVarResponse.getData(); + } + + /** + * Start test run (job) + * Start an XCUITest/unit-test run as an async job (CLI: `ios runtest`). Returns `202` with the created job. + * @param udid (required) + * @param runTestRequest (required) + * @return ApiResponse<Job> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesStartRunTestWithHttpInfo(String udid, RunTestRequest runTestRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesStartRunTestRequestBuilder(udid, runTestRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesStartRunTest", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesStartRunTestRequestBuilder(String udid, RunTestRequest runTestRequest) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesStartRunTest"); + } + // verify the required parameter 'runTestRequest' is set + if (runTestRequest == null) { + throw new ApiException(400, "Missing the required parameter 'runTestRequest' when calling devicesStartRunTest"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/jobs/runtest" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(runTestRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Start WDA runner (job) + * Start the WebDriverAgent runner as an async job (CLI: `ios runwda`). Body fields are optional and default to the standard WDA bundle id and config. + * @param udid (required) + * @param runTestRequest (optional) + * @return Job + * @throws ApiException if fails to make API call + */ + public Job devicesStartRunWda(String udid, RunTestRequest runTestRequest) throws ApiException { + ApiResponse localVarResponse = devicesStartRunWdaWithHttpInfo(udid, runTestRequest); + return localVarResponse.getData(); + } + + /** + * Start WDA runner (job) + * Start the WebDriverAgent runner as an async job (CLI: `ios runwda`). Body fields are optional and default to the standard WDA bundle id and config. + * @param udid (required) + * @param runTestRequest (optional) + * @return ApiResponse<Job> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesStartRunWdaWithHttpInfo(String udid, RunTestRequest runTestRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesStartRunWdaRequestBuilder(udid, runTestRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesStartRunWda", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesStartRunWdaRequestBuilder(String udid, RunTestRequest runTestRequest) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesStartRunWda"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/jobs/runwda" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(runTestRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Stop or delete job + * Stop a running job, or purge an already-terminal one from the registry (CLI: Ctrl-C on the equivalent command). + * @param udid (required) + * @param id The job id. (required) + * @return GenericResponse + * @throws ApiException if fails to make API call + */ + public GenericResponse devicesStopJob(String udid, String id) throws ApiException { + ApiResponse localVarResponse = devicesStopJobWithHttpInfo(udid, id); + return localVarResponse.getData(); + } + + /** + * Stop or delete job + * Stop a running job, or purge an already-terminal one from the registry (CLI: Ctrl-C on the equivalent command). + * @param udid (required) + * @param id The job id. (required) + * @return ApiResponse<GenericResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesStopJobWithHttpInfo(String udid, String id) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesStopJobRequestBuilder(udid, id); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesStopJob", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesStopJobRequestBuilder(String udid, String id) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesStopJob"); + } + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling devicesStopJob"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/jobs/{id}" + .replace("{udid}", ApiClient.urlEncode(udid.toString())) + .replace("{id}", ApiClient.urlEncode(id.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Stream job logs (SSE) + * Stream a job's log output as Server-Sent Events: the buffered history first, then live lines until the job ends or the client disconnects. + * @param udid (required) + * @param id The job id. (required) + * @return String + * @throws ApiException if fails to make API call + */ + public String devicesStreamJobLogs(String udid, String id) throws ApiException { + ApiResponse localVarResponse = devicesStreamJobLogsWithHttpInfo(udid, id); + return localVarResponse.getData(); + } + + /** + * Stream job logs (SSE) + * Stream a job's log output as Server-Sent Events: the buffered history first, then live lines until the job ends or the client disconnects. + * @param udid (required) + * @param id The job id. (required) + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesStreamJobLogsWithHttpInfo(String udid, String id) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesStreamJobLogsRequestBuilder(udid, id); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesStreamJobLogs", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesStreamJobLogsRequestBuilder(String udid, String id) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesStreamJobLogs"); + } + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling devicesStreamJobLogs"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/jobs/{id}/logs" + .replace("{udid}", ApiClient.urlEncode(udid.toString())) + .replace("{id}", ApiClient.urlEncode(id.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "text/event-stream, application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Stream device attach/detach (SSE) + * Stream device attach/detach events as Server-Sent Events. + * @param udid (required) + * @return String + * @throws ApiException if fails to make API call + */ + public String devicesStreamListen(String udid) throws ApiException { + ApiResponse localVarResponse = devicesStreamListenWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Stream device attach/detach (SSE) + * Stream device attach/detach events as Server-Sent Events. + * @param udid (required) + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesStreamListenWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesStreamListenRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesStreamListen", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesStreamListenRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesStreamListen"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/listen" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "text/event-stream, application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Stream app-state notifications (SSE) + * Stream application state-change notifications as Server-Sent Events. + * @param udid (required) + * @return String + * @throws ApiException if fails to make API call + */ + public String devicesStreamNotifications(String udid) throws ApiException { + ApiResponse localVarResponse = devicesStreamNotificationsWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Stream app-state notifications (SSE) + * Stream application state-change notifications as Server-Sent Events. + * @param udid (required) + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesStreamNotificationsWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesStreamNotificationsRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesStreamNotifications", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesStreamNotificationsRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesStreamNotifications"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/notifications" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "text/event-stream, application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Stream os_log trace (SSE) + * Stream structured os_log trace entries as Server-Sent Events. All filters are optional and combine with AND semantics. + * @param udid (required) + * @param pid Only include entries from this process id. (optional) + * @param level Minimum log level to include (e.g. `info`, `debug`, `error`). (optional) + * @param subsystem Only include entries from this subsystem. (optional) + * @param match Only include entries whose message matches this substring/pattern. (optional) + * @param exclude Exclude entries whose message matches this substring/pattern. (optional) + * @return String + * @throws ApiException if fails to make API call + */ + public String devicesStreamOsTrace(String udid, Integer pid, String level, String subsystem, String match, String exclude) throws ApiException { + ApiResponse localVarResponse = devicesStreamOsTraceWithHttpInfo(udid, pid, level, subsystem, match, exclude); + return localVarResponse.getData(); + } + + /** + * Stream os_log trace (SSE) + * Stream structured os_log trace entries as Server-Sent Events. All filters are optional and combine with AND semantics. + * @param udid (required) + * @param pid Only include entries from this process id. (optional) + * @param level Minimum log level to include (e.g. `info`, `debug`, `error`). (optional) + * @param subsystem Only include entries from this subsystem. (optional) + * @param match Only include entries whose message matches this substring/pattern. (optional) + * @param exclude Exclude entries whose message matches this substring/pattern. (optional) + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesStreamOsTraceWithHttpInfo(String udid, Integer pid, String level, String subsystem, String match, String exclude) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesStreamOsTraceRequestBuilder(udid, pid, level, subsystem, match, exclude); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesStreamOsTrace", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesStreamOsTraceRequestBuilder(String udid, Integer pid, String level, String subsystem, String match, String exclude) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesStreamOsTrace"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/ostrace" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "pid"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("pid", pid)); + localVarQueryParameterBaseName = "level"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("level", level)); + localVarQueryParameterBaseName = "subsystem"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("subsystem", subsystem)); + localVarQueryParameterBaseName = "match"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("match", match)); + localVarQueryParameterBaseName = "exclude"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("exclude", exclude)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "text/event-stream, application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Stream syslog (SSE) + * Stream device syslog lines as Server-Sent Events. + * @param udid (required) + * @return String + * @throws ApiException if fails to make API call + */ + public String devicesStreamSyslog(String udid) throws ApiException { + ApiResponse localVarResponse = devicesStreamSyslogWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Stream syslog (SSE) + * Stream device syslog lines as Server-Sent Events. + * @param udid (required) + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesStreamSyslogWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesStreamSyslogRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesStreamSyslog", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesStreamSyslogRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesStreamSyslog"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/syslog" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "text/event-stream, application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Stream CPU usage (SSE) + * Stream CPU-usage samples as Server-Sent Events (CLI: `ios sysmontap`). + * @param udid (required) + * @return String + * @throws ApiException if fails to make API call + */ + public String devicesStreamSysmontap(String udid) throws ApiException { + ApiResponse localVarResponse = devicesStreamSysmontapWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Stream CPU usage (SSE) + * Stream CPU-usage samples as Server-Sent Events (CLI: `ios sysmontap`). + * @param udid (required) + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesStreamSysmontapWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesStreamSysmontapRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesStreamSysmontap", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesStreamSysmontapRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesStreamSysmontap"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/sysmontap" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "text/event-stream, application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Uninstall app + * Uninstall an application by bundle id. + * @param udid (required) + * @param bundleID Bundle id of the app to uninstall. (required) + * @return GenericResponse + * @throws ApiException if fails to make API call + */ + public GenericResponse devicesUninstallApp(String udid, String bundleID) throws ApiException { + ApiResponse localVarResponse = devicesUninstallAppWithHttpInfo(udid, bundleID); + return localVarResponse.getData(); + } + + /** + * Uninstall app + * Uninstall an application by bundle id. + * @param udid (required) + * @param bundleID Bundle id of the app to uninstall. (required) + * @return ApiResponse<GenericResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesUninstallAppWithHttpInfo(String udid, String bundleID) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesUninstallAppRequestBuilder(udid, bundleID); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesUninstallApp", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesUninstallAppRequestBuilder(String udid, String bundleID) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesUninstallApp"); + } + // verify the required parameter 'bundleID' is set + if (bundleID == null) { + throw new ApiException(400, "Missing the required parameter 'bundleID' when calling devicesUninstallApp"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/apps/uninstall" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "bundleID"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("bundleID", bundleID)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Unmount developer image + * Unmount the developer disk image (CLI: `ios image unmount`). + * @param udid (required) + * @return GenericResponse + * @throws ApiException if fails to make API call + */ + public GenericResponse devicesUnmountImage(String udid) throws ApiException { + ApiResponse localVarResponse = devicesUnmountImageWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Unmount developer image + * Unmount the developer disk image (CLI: `ios image unmount`). + * @param udid (required) + * @return ApiResponse<GenericResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse devicesUnmountImageWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = devicesUnmountImageRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("devicesUnmountImage", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder devicesUnmountImageRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling devicesUnmountImage"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/image" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get battery IORegistry + * Get the battery IORegistry stats (Temperature, Voltage, CurrentCapacity, ...) via the diagnostics relay (CLI: `ios diagnostics ioregistry`). + * @param udid (required) + * @return BatteryRegistry + * @throws ApiException if fails to make API call + */ + public BatteryRegistry diagnosticsNetGetBatteryRegistry(String udid) throws ApiException { + ApiResponse localVarResponse = diagnosticsNetGetBatteryRegistryWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Get battery IORegistry + * Get the battery IORegistry stats (Temperature, Voltage, CurrentCapacity, ...) via the diagnostics relay (CLI: `ios diagnostics ioregistry`). + * @param udid (required) + * @return ApiResponse<BatteryRegistry> + * @throws ApiException if fails to make API call + */ + public ApiResponse diagnosticsNetGetBatteryRegistryWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = diagnosticsNetGetBatteryRegistryRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("diagnosticsNetGetBatteryRegistry", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder diagnosticsNetGetBatteryRegistryRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling diagnosticsNetGetBatteryRegistry"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/battery/registry" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get device IP / network info + * Resolve the device's network addresses (MAC/IPv4/IPv6) by sniffing pcapd (CLI: `ios ip`). + * @param udid (required) + * @return NetworkInfo + * @throws ApiException if fails to make API call + */ + public NetworkInfo diagnosticsNetGetDeviceIp(String udid) throws ApiException { + ApiResponse localVarResponse = diagnosticsNetGetDeviceIpWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Get device IP / network info + * Resolve the device's network addresses (MAC/IPv4/IPv6) by sniffing pcapd (CLI: `ios ip`). + * @param udid (required) + * @return ApiResponse<NetworkInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse diagnosticsNetGetDeviceIpWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = diagnosticsNetGetDeviceIpRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("diagnosticsNetGetDeviceIp", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder diagnosticsNetGetDeviceIpRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling diagnosticsNetGetDeviceIp"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/ip" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get disk space info + * Get filesystem info for the device (total/free/used bytes, block size) via AFC (CLI: `ios diskspace`). + * @param udid (required) + * @return DiskSpaceInfo + * @throws ApiException if fails to make API call + */ + public DiskSpaceInfo diagnosticsNetGetDiskSpace(String udid) throws ApiException { + ApiResponse localVarResponse = diagnosticsNetGetDiskSpaceWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Get disk space info + * Get filesystem info for the device (total/free/used bytes, block size) via AFC (CLI: `ios diskspace`). + * @param udid (required) + * @return ApiResponse<DiskSpaceInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse diagnosticsNetGetDiskSpaceWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = diagnosticsNetGetDiskSpaceRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("diagnosticsNetGetDiskSpace", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder diagnosticsNetGetDiskSpaceRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling diagnosticsNetGetDiskSpace"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/diskspace" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get RSD service list + * Get the device's RSD (Remote Service Discovery) service list (CLI: `ios rsd ls`). Requires a running tunnel (iOS 17+); devices without RSD return `400`. + * @param udid (required) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object diagnosticsNetGetRsdServices(String udid) throws ApiException { + ApiResponse localVarResponse = diagnosticsNetGetRsdServicesWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Get RSD service list + * Get the device's RSD (Remote Service Discovery) service list (CLI: `ios rsd ls`). Requires a running tunnel (iOS 17+); devices without RSD return `400`. + * @param udid (required) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse diagnosticsNetGetRsdServicesWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = diagnosticsNetGetRsdServicesRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("diagnosticsNetGetRsdServices", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder diagnosticsNetGetRsdServicesRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling diagnosticsNetGetRsdServices"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/rsd" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List a directory over AFC + * List a device directory over AFC (CLI: `ios fsync ls`). + * @param udid (required) + * @param bundleID App bundle id to scope to its container (else the media dir). (optional) + * @param path Device-side path (rejects `..` elements). (optional) + * @return FsyncListing + * @throws ApiException if fails to make API call + */ + public FsyncListing fsyncFsyncLs(String udid, String bundleID, String path) throws ApiException { + ApiResponse localVarResponse = fsyncFsyncLsWithHttpInfo(udid, bundleID, path); + return localVarResponse.getData(); + } + + /** + * List a directory over AFC + * List a device directory over AFC (CLI: `ios fsync ls`). + * @param udid (required) + * @param bundleID App bundle id to scope to its container (else the media dir). (optional) + * @param path Device-side path (rejects `..` elements). (optional) + * @return ApiResponse<FsyncListing> + * @throws ApiException if fails to make API call + */ + public ApiResponse fsyncFsyncLsWithHttpInfo(String udid, String bundleID, String path) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = fsyncFsyncLsRequestBuilder(udid, bundleID, path); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("fsyncFsyncLs", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder fsyncFsyncLsRequestBuilder(String udid, String bundleID, String path) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling fsyncFsyncLs"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/fsync/ls" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "bundleID"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("bundleID", bundleID)); + localVarQueryParameterBaseName = "path"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("path", path)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Create a directory over AFC + * Create a directory over AFC (CLI: `ios fsync mkdir`). + * @param udid (required) + * @param path Directory path to create (required). (required) + * @param bundleID App bundle id to scope to its container (else the media dir). (optional) + * @return FsyncMessage + * @throws ApiException if fails to make API call + */ + public FsyncMessage fsyncFsyncMkdir(String udid, String path, String bundleID) throws ApiException { + ApiResponse localVarResponse = fsyncFsyncMkdirWithHttpInfo(udid, path, bundleID); + return localVarResponse.getData(); + } + + /** + * Create a directory over AFC + * Create a directory over AFC (CLI: `ios fsync mkdir`). + * @param udid (required) + * @param path Directory path to create (required). (required) + * @param bundleID App bundle id to scope to its container (else the media dir). (optional) + * @return ApiResponse<FsyncMessage> + * @throws ApiException if fails to make API call + */ + public ApiResponse fsyncFsyncMkdirWithHttpInfo(String udid, String path, String bundleID) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = fsyncFsyncMkdirRequestBuilder(udid, path, bundleID); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("fsyncFsyncMkdir", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder fsyncFsyncMkdirRequestBuilder(String udid, String path, String bundleID) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling fsyncFsyncMkdir"); + } + // verify the required parameter 'path' is set + if (path == null) { + throw new ApiException(400, "Missing the required parameter 'path' when calling fsyncFsyncMkdir"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/fsync/mkdir" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "bundleID"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("bundleID", bundleID)); + localVarQueryParameterBaseName = "path"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("path", path)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Download a file over AFC + * Download a file from the device over AFC (CLI: `ios fsync pull`). Returns the raw file bytes. `path` is required. + * @param udid (required) + * @param path Remote file path on the device (required). (required) + * @param bundleID App bundle id to scope to its container (else the media dir). (optional) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object fsyncFsyncPull(String udid, String path, String bundleID) throws ApiException { + ApiResponse localVarResponse = fsyncFsyncPullWithHttpInfo(udid, path, bundleID); + return localVarResponse.getData(); + } + + /** + * Download a file over AFC + * Download a file from the device over AFC (CLI: `ios fsync pull`). Returns the raw file bytes. `path` is required. + * @param udid (required) + * @param path Remote file path on the device (required). (required) + * @param bundleID App bundle id to scope to its container (else the media dir). (optional) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse fsyncFsyncPullWithHttpInfo(String udid, String path, String bundleID) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = fsyncFsyncPullRequestBuilder(udid, path, bundleID); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("fsyncFsyncPull", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder fsyncFsyncPullRequestBuilder(String udid, String path, String bundleID) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling fsyncFsyncPull"); + } + // verify the required parameter 'path' is set + if (path == null) { + throw new ApiException(400, "Missing the required parameter 'path' when calling fsyncFsyncPull"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/fsync/pull" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "bundleID"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("bundleID", bundleID)); + localVarQueryParameterBaseName = "path"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("path", path)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/octet-stream, application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Upload a file over AFC + * Upload a file to the device over AFC (CLI: `ios fsync push`). Accepts either raw bytes (application/octet-stream) or a multipart form with a `file` field. `path` is required. Bounded server-side; oversized uploads get `413`. + * @param udid (required) + * @param path Destination path on the device (required). (required) + * @param body Raw file bytes to upload (application/octet-stream). (required) + * @param bundleID App bundle id to scope to its container (else the media dir). (optional) + * @return FsyncPushResult + * @throws ApiException if fails to make API call + */ + public FsyncPushResult fsyncFsyncPush(String udid, String path, Object body, String bundleID) throws ApiException { + ApiResponse localVarResponse = fsyncFsyncPushWithHttpInfo(udid, path, body, bundleID); + return localVarResponse.getData(); + } + + /** + * Upload a file over AFC + * Upload a file to the device over AFC (CLI: `ios fsync push`). Accepts either raw bytes (application/octet-stream) or a multipart form with a `file` field. `path` is required. Bounded server-side; oversized uploads get `413`. + * @param udid (required) + * @param path Destination path on the device (required). (required) + * @param body Raw file bytes to upload (application/octet-stream). (required) + * @param bundleID App bundle id to scope to its container (else the media dir). (optional) + * @return ApiResponse<FsyncPushResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse fsyncFsyncPushWithHttpInfo(String udid, String path, Object body, String bundleID) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = fsyncFsyncPushRequestBuilder(udid, path, body, bundleID); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("fsyncFsyncPush", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder fsyncFsyncPushRequestBuilder(String udid, String path, Object body, String bundleID) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling fsyncFsyncPush"); + } + // verify the required parameter 'path' is set + if (path == null) { + throw new ApiException(400, "Missing the required parameter 'path' when calling fsyncFsyncPush"); + } + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling fsyncFsyncPush"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/fsync/push" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "bundleID"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("bundleID", bundleID)); + localVarQueryParameterBaseName = "path"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("path", path)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/octet-stream"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Remove a file or directory over AFC + * Remove a file or directory over AFC (CLI: `ios fsync rm`). Pass `recursive=true` to delete a non-empty directory. + * @param udid (required) + * @param path Path to remove (required). (required) + * @param bundleID App bundle id to scope to its container (else the media dir). (optional) + * @param recursive Remove directory contents recursively. (optional) + * @return FsyncMessage + * @throws ApiException if fails to make API call + */ + public FsyncMessage fsyncFsyncRm(String udid, String path, String bundleID, Boolean recursive) throws ApiException { + ApiResponse localVarResponse = fsyncFsyncRmWithHttpInfo(udid, path, bundleID, recursive); + return localVarResponse.getData(); + } + + /** + * Remove a file or directory over AFC + * Remove a file or directory over AFC (CLI: `ios fsync rm`). Pass `recursive=true` to delete a non-empty directory. + * @param udid (required) + * @param path Path to remove (required). (required) + * @param bundleID App bundle id to scope to its container (else the media dir). (optional) + * @param recursive Remove directory contents recursively. (optional) + * @return ApiResponse<FsyncMessage> + * @throws ApiException if fails to make API call + */ + public ApiResponse fsyncFsyncRmWithHttpInfo(String udid, String path, String bundleID, Boolean recursive) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = fsyncFsyncRmRequestBuilder(udid, path, bundleID, recursive); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("fsyncFsyncRm", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder fsyncFsyncRmRequestBuilder(String udid, String path, String bundleID, Boolean recursive) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling fsyncFsyncRm"); + } + // verify the required parameter 'path' is set + if (path == null) { + throw new ApiException(400, "Missing the required parameter 'path' when calling fsyncFsyncRm"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/fsync/rm" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "bundleID"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("bundleID", bundleID)); + localVarQueryParameterBaseName = "path"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("path", path)); + localVarQueryParameterBaseName = "recursive"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("recursive", recursive)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Recursively list a directory over AFC + * Recursively list a device directory over AFC (CLI: `ios fsync tree`). + * @param udid (required) + * @param bundleID App bundle id to scope to its container (else the media dir). (optional) + * @param path Device-side path (rejects `..` elements). (optional) + * @return FsyncTreeListing + * @throws ApiException if fails to make API call + */ + public FsyncTreeListing fsyncFsyncTree(String udid, String bundleID, String path) throws ApiException { + ApiResponse localVarResponse = fsyncFsyncTreeWithHttpInfo(udid, bundleID, path); + return localVarResponse.getData(); + } + + /** + * Recursively list a directory over AFC + * Recursively list a device directory over AFC (CLI: `ios fsync tree`). + * @param udid (required) + * @param bundleID App bundle id to scope to its container (else the media dir). (optional) + * @param path Device-side path (rejects `..` elements). (optional) + * @return ApiResponse<FsyncTreeListing> + * @throws ApiException if fails to make API call + */ + public ApiResponse fsyncFsyncTreeWithHttpInfo(String udid, String bundleID, String path) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = fsyncFsyncTreeRequestBuilder(udid, bundleID, path); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("fsyncFsyncTree", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder fsyncFsyncTreeRequestBuilder(String udid, String bundleID, String path) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling fsyncFsyncTree"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/fsync/tree" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "bundleID"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("bundleID", bundleID)); + localVarQueryParameterBaseName = "path"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("path", path)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get device cloud configuration + * Get the device cloud configuration (supervision status, skip-setup options, organization info). + * @param udid (required) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object fsyncGetCloudConfig(String udid) throws ApiException { + ApiResponse localVarResponse = fsyncGetCloudConfigWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Get device cloud configuration + * Get the device cloud configuration (supervision status, skip-setup options, organization info). + * @param udid (required) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse fsyncGetCloudConfigWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = fsyncGetCloudConfigRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("fsyncGetCloudConfig", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder fsyncGetCloudConfigRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling fsyncGetCloudConfig"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/cloudconfig" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List setup skip options + * List all setup-pane skip options usable when preparing a device (CLI: `ios prepare printskip`). Static, device-free list. + * @return PrepareSkipOptions + * @throws ApiException if fails to make API call + */ + public PrepareSkipOptions getPrepareSkipOptions() throws ApiException { + ApiResponse localVarResponse = getPrepareSkipOptionsWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * List setup skip options + * List all setup-pane skip options usable when preparing a device (CLI: `ios prepare printskip`). Static, device-free list. + * @return ApiResponse<PrepareSkipOptions> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPrepareSkipOptionsWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPrepareSkipOptionsRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getPrepareSkipOptions", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPrepareSkipOptionsRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/prepare/skip-options"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List devices + * List all attached / reachable devices. + * @return DeviceList + * @throws ApiException if fails to make API call + */ + public DeviceList listDevices() throws ApiException { + ApiResponse localVarResponse = listDevicesWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * List devices + * List all attached / reachable devices. + * @return ApiResponse<DeviceList> + * @throws ApiException if fails to make API call + */ + public ApiResponse listDevicesWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = listDevicesRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("listDevices", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder listDevicesRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/list"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List tunnels + * List running device tunnels (CLI: `ios tunnel ls`). + * @return List<Tunnel> + * @throws ApiException if fails to make API call + */ + public List listTunnels() throws ApiException { + ApiResponse> localVarResponse = listTunnelsWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * List tunnels + * List running device tunnels (CLI: `ios tunnel ls`). + * @return ApiResponse<List<Tunnel>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> listTunnelsWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = listTunnelsRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("listTunnels", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference>() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder listTunnelsRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/tunnels"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Generate a supervision certificate + * Generate a self-signed supervision identity (CLI: `ios prepare create-cert`) and return the DER (base64) and PEM for both the certificate and private key. Host-scoped (device-free). + * @return SupervisionCert + * @throws ApiException if fails to make API call + */ + public SupervisionCert prepareCreateCert() throws ApiException { + ApiResponse localVarResponse = prepareCreateCertWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Generate a supervision certificate + * Generate a self-signed supervision identity (CLI: `ios prepare create-cert`) and return the DER (base64) and PEM for both the certificate and private key. Host-scoped (device-free). + * @return ApiResponse<SupervisionCert> + * @throws ApiException if fails to make API call + */ + public ApiResponse prepareCreateCertWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = prepareCreateCertRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("prepareCreateCert", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder prepareCreateCertRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/prepare/create-cert"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Prepare (and optionally supervise) a device + * Run the device preparation/provisioning flow (CLI: `ios prepare`). Send multipart/form-data. To supervise the device include a `cert` file (DER/PEM/P12 supervision identity) and optional `p12password`; without a cert the device is prepared without supervision. + * @param udid (required) + * @param cert (optional) + * @param p12password P12 password (when `cert` is a P12). (optional) + * @param skip Setup panes to skip (see /prepare/skip-options). Repeatable. (optional) + * @param orgname Supervision organization name. (optional) + * @param locale Device locale (default en_US). (optional) + * @param lang Device language (default en). (optional) + * @return PrepareResult + * @throws ApiException if fails to make API call + */ + public PrepareResult preparePrepareDevice(String udid, Object cert, String p12password, List skip, String orgname, String locale, String lang) throws ApiException { + ApiResponse localVarResponse = preparePrepareDeviceWithHttpInfo(udid, cert, p12password, skip, orgname, locale, lang); + return localVarResponse.getData(); + } + + /** + * Prepare (and optionally supervise) a device + * Run the device preparation/provisioning flow (CLI: `ios prepare`). Send multipart/form-data. To supervise the device include a `cert` file (DER/PEM/P12 supervision identity) and optional `p12password`; without a cert the device is prepared without supervision. + * @param udid (required) + * @param cert (optional) + * @param p12password P12 password (when `cert` is a P12). (optional) + * @param skip Setup panes to skip (see /prepare/skip-options). Repeatable. (optional) + * @param orgname Supervision organization name. (optional) + * @param locale Device locale (default en_US). (optional) + * @param lang Device language (default en). (optional) + * @return ApiResponse<PrepareResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse preparePrepareDeviceWithHttpInfo(String udid, Object cert, String p12password, List skip, String orgname, String locale, String lang) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = preparePrepareDeviceRequestBuilder(udid, cert, p12password, skip, orgname, locale, lang); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("preparePrepareDevice", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder preparePrepareDeviceRequestBuilder(String udid, Object cert, String p12password, List skip, String orgname, String locale, String lang) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling preparePrepareDevice"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/prepare" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + MultipartEntityBuilder multiPartBuilder = MultipartEntityBuilder.create(); + boolean hasFiles = false; + multiPartBuilder.addTextBody("cert", cert.toString()); + multiPartBuilder.addTextBody("p12password", p12password.toString()); + for (int i=0; i < skip.size(); i++) { + multiPartBuilder.addTextBody("skip", skip.get(i).toString()); + } + multiPartBuilder.addTextBody("orgname", orgname.toString()); + multiPartBuilder.addTextBody("locale", locale.toString()); + multiPartBuilder.addTextBody("lang", lang.toString()); + HttpEntity entity = multiPartBuilder.build(); + HttpRequest.BodyPublisher formDataPublisher; + if (hasFiles) { + Pipe pipe; + try { + pipe = Pipe.open(); + } catch (IOException e) { + throw new RuntimeException(e); + } + new Thread(() -> { + try (OutputStream outputStream = Channels.newOutputStream(pipe.sink())) { + entity.writeTo(outputStream); + } catch (IOException e) { + e.printStackTrace(); + } + }).start(); + formDataPublisher = HttpRequest.BodyPublishers.ofInputStream(() -> Channels.newInputStream(pipe.source())); + } else { + ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); + try { + entity.writeTo(formOutputStream); + } catch (IOException e) { + throw new RuntimeException(e); + } + formDataPublisher = HttpRequest.BodyPublishers + .ofInputStream(() -> new ByteArrayInputStream(formOutputStream.toByteArray())); + } + localVarRequestBuilder + .header("Content-Type", entity.getContentType().getValue()) + .method("POST", formDataPublisher); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Refresh tunnel + * Restart the tunnel for a device and wait for it to come up (CLI: `ios tunnel refresh`). + * @param udid (required) + * @return Tunnel + * @throws ApiException if fails to make API call + */ + public Tunnel refreshTunnel(String udid) throws ApiException { + ApiResponse localVarResponse = refreshTunnelWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Refresh tunnel + * Restart the tunnel for a device and wait for it to come up (CLI: `ios tunnel refresh`). + * @param udid (required) + * @return ApiResponse<Tunnel> + * @throws ApiException if fails to make API call + */ + public ApiResponse refreshTunnelWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = refreshTunnelRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("refreshTunnel", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder refreshTunnelRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling refreshTunnel"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/tunnels/{udid}/refresh" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Shut down tunnel agent + * Shut down the tunnel agent (CLI: `ios tunnel stopagent`). + * @return AgentShutdown + * @throws ApiException if fails to make API call + */ + public AgentShutdown shutdownTunnelAgent() throws ApiException { + ApiResponse localVarResponse = shutdownTunnelAgentWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Shut down tunnel agent + * Shut down the tunnel agent (CLI: `ios tunnel stopagent`). + * @return ApiResponse<AgentShutdown> + * @throws ApiException if fails to make API call + */ + public ApiResponse shutdownTunnelAgentWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = shutdownTunnelAgentRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("shutdownTunnelAgent", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder shutdownTunnelAgentRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/tunnel-agent/shutdown"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Resign an app/IPA + * Resign an uploaded app/IPA with an uploaded P12 identity and provisioning profile, returning the signed IPA. Synchronous. Host-scoped. + * @param ipa (required) + * @param p12file (required) + * @param profile (required) + * @param p12password P12 password. (optional) + * @param bundleid Override bundle id. (optional) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object signApp(Object ipa, Object p12file, Object profile, String p12password, String bundleid) throws ApiException { + ApiResponse localVarResponse = signAppWithHttpInfo(ipa, p12file, profile, p12password, bundleid); + return localVarResponse.getData(); + } + + /** + * Resign an app/IPA + * Resign an uploaded app/IPA with an uploaded P12 identity and provisioning profile, returning the signed IPA. Synchronous. Host-scoped. + * @param ipa (required) + * @param p12file (required) + * @param profile (required) + * @param p12password P12 password. (optional) + * @param bundleid Override bundle id. (optional) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse signAppWithHttpInfo(Object ipa, Object p12file, Object profile, String p12password, String bundleid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = signAppRequestBuilder(ipa, p12file, profile, p12password, bundleid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("signApp", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder signAppRequestBuilder(Object ipa, Object p12file, Object profile, String p12password, String bundleid) throws ApiException { + // verify the required parameter 'ipa' is set + if (ipa == null) { + throw new ApiException(400, "Missing the required parameter 'ipa' when calling signApp"); + } + // verify the required parameter 'p12file' is set + if (p12file == null) { + throw new ApiException(400, "Missing the required parameter 'p12file' when calling signApp"); + } + // verify the required parameter 'profile' is set + if (profile == null) { + throw new ApiException(400, "Missing the required parameter 'profile' when calling signApp"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/sign/app"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/octet-stream, application/json"); + + MultipartEntityBuilder multiPartBuilder = MultipartEntityBuilder.create(); + boolean hasFiles = false; + multiPartBuilder.addTextBody("ipa", ipa.toString()); + multiPartBuilder.addTextBody("p12file", p12file.toString()); + multiPartBuilder.addTextBody("profile", profile.toString()); + multiPartBuilder.addTextBody("p12password", p12password.toString()); + multiPartBuilder.addTextBody("bundleid", bundleid.toString()); + HttpEntity entity = multiPartBuilder.build(); + HttpRequest.BodyPublisher formDataPublisher; + if (hasFiles) { + Pipe pipe; + try { + pipe = Pipe.open(); + } catch (IOException e) { + throw new RuntimeException(e); + } + new Thread(() -> { + try (OutputStream outputStream = Channels.newOutputStream(pipe.sink())) { + entity.writeTo(outputStream); + } catch (IOException e) { + e.printStackTrace(); + } + }).start(); + formDataPublisher = HttpRequest.BodyPublishers.ofInputStream(() -> Channels.newInputStream(pipe.source())); + } else { + ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); + try { + entity.writeTo(formOutputStream); + } catch (IOException e) { + throw new RuntimeException(e); + } + formDataPublisher = HttpRequest.BodyPublishers + .ofInputStream(() -> new ByteArrayInputStream(formOutputStream.toByteArray())); + } + localVarRequestBuilder + .header("Content-Type", entity.getContentType().getValue()) + .method("POST", formDataPublisher); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Create a signing certificate + * Create one App Store Connect signing certificate and return its P12 (certificate + private key) as a downloadable `application/x-pkcs12` file. The P12 password is echoed in the `X-P12-Password` response header and the certificate resource id in `X-Certificate-Id`. Host-scoped (device-free). + * @param ascPrivateKey (required) + * @param ascKeyId App Store Connect key id. (required) + * @param ascIssuerId App Store Connect issuer id. (required) + * @param revokeExisting Revoke existing iOS Development certificates first. (optional) + * @param p12password Password to protect the generated P12. (optional) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object signCertificate(Object ascPrivateKey, String ascKeyId, String ascIssuerId, String revokeExisting, String p12password) throws ApiException { + ApiResponse localVarResponse = signCertificateWithHttpInfo(ascPrivateKey, ascKeyId, ascIssuerId, revokeExisting, p12password); + return localVarResponse.getData(); + } + + /** + * Create a signing certificate + * Create one App Store Connect signing certificate and return its P12 (certificate + private key) as a downloadable `application/x-pkcs12` file. The P12 password is echoed in the `X-P12-Password` response header and the certificate resource id in `X-Certificate-Id`. Host-scoped (device-free). + * @param ascPrivateKey (required) + * @param ascKeyId App Store Connect key id. (required) + * @param ascIssuerId App Store Connect issuer id. (required) + * @param revokeExisting Revoke existing iOS Development certificates first. (optional) + * @param p12password Password to protect the generated P12. (optional) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse signCertificateWithHttpInfo(Object ascPrivateKey, String ascKeyId, String ascIssuerId, String revokeExisting, String p12password) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = signCertificateRequestBuilder(ascPrivateKey, ascKeyId, ascIssuerId, revokeExisting, p12password); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("signCertificate", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder signCertificateRequestBuilder(Object ascPrivateKey, String ascKeyId, String ascIssuerId, String revokeExisting, String p12password) throws ApiException { + // verify the required parameter 'ascPrivateKey' is set + if (ascPrivateKey == null) { + throw new ApiException(400, "Missing the required parameter 'ascPrivateKey' when calling signCertificate"); + } + // verify the required parameter 'ascKeyId' is set + if (ascKeyId == null) { + throw new ApiException(400, "Missing the required parameter 'ascKeyId' when calling signCertificate"); + } + // verify the required parameter 'ascIssuerId' is set + if (ascIssuerId == null) { + throw new ApiException(400, "Missing the required parameter 'ascIssuerId' when calling signCertificate"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/sign/certificate"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/x-pkcs12, application/json"); + + MultipartEntityBuilder multiPartBuilder = MultipartEntityBuilder.create(); + boolean hasFiles = false; + multiPartBuilder.addTextBody("asc-private-key", ascPrivateKey.toString()); + multiPartBuilder.addTextBody("asc-key-id", ascKeyId.toString()); + multiPartBuilder.addTextBody("asc-issuer-id", ascIssuerId.toString()); + multiPartBuilder.addTextBody("revoke-existing", revokeExisting.toString()); + multiPartBuilder.addTextBody("p12password", p12password.toString()); + HttpEntity entity = multiPartBuilder.build(); + HttpRequest.BodyPublisher formDataPublisher; + if (hasFiles) { + Pipe pipe; + try { + pipe = Pipe.open(); + } catch (IOException e) { + throw new RuntimeException(e); + } + new Thread(() -> { + try (OutputStream outputStream = Channels.newOutputStream(pipe.sink())) { + entity.writeTo(outputStream); + } catch (IOException e) { + e.printStackTrace(); + } + }).start(); + formDataPublisher = HttpRequest.BodyPublishers.ofInputStream(() -> Channels.newInputStream(pipe.source())); + } else { + ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); + try { + entity.writeTo(formOutputStream); + } catch (IOException e) { + throw new RuntimeException(e); + } + formDataPublisher = HttpRequest.BodyPublishers + .ofInputStream(() -> new ByteArrayInputStream(formOutputStream.toByteArray())); + } + localVarRequestBuilder + .header("Content-Type", entity.getContentType().getValue()) + .method("POST", formDataPublisher); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Create a provisioning profile + P12 + * Create a bundle id, development certificate and provisioning profile via App Store Connect and return both artifacts base64-encoded in a JSON envelope. The target device udid is supplied as a form field. Host-scoped. + * @param ascPrivateKey (required) + * @param ascKeyId App Store Connect key id. (required) + * @param ascIssuerId App Store Connect issuer id. (required) + * @param bundleid App bundle identifier. (required) + * @param udid Target device udid to register against the profile. (required) + * @param bundlename Bundle display name. (optional) + * @param profilename Provisioning profile name. (optional) + * @param devicename Device display name. (optional) + * @param certificateId Reuse an existing certificate (no new P12 is generated). (optional) + * @param revokeExisting Revoke existing certificates first. (optional) + * @param p12password Password to protect the generated P12. (optional) + * @return ProvisioningResult + * @throws ApiException if fails to make API call + */ + public ProvisioningResult signProvision(Object ascPrivateKey, String ascKeyId, String ascIssuerId, String bundleid, String udid, String bundlename, String profilename, String devicename, String certificateId, String revokeExisting, String p12password) throws ApiException { + ApiResponse localVarResponse = signProvisionWithHttpInfo(ascPrivateKey, ascKeyId, ascIssuerId, bundleid, udid, bundlename, profilename, devicename, certificateId, revokeExisting, p12password); + return localVarResponse.getData(); + } + + /** + * Create a provisioning profile + P12 + * Create a bundle id, development certificate and provisioning profile via App Store Connect and return both artifacts base64-encoded in a JSON envelope. The target device udid is supplied as a form field. Host-scoped. + * @param ascPrivateKey (required) + * @param ascKeyId App Store Connect key id. (required) + * @param ascIssuerId App Store Connect issuer id. (required) + * @param bundleid App bundle identifier. (required) + * @param udid Target device udid to register against the profile. (required) + * @param bundlename Bundle display name. (optional) + * @param profilename Provisioning profile name. (optional) + * @param devicename Device display name. (optional) + * @param certificateId Reuse an existing certificate (no new P12 is generated). (optional) + * @param revokeExisting Revoke existing certificates first. (optional) + * @param p12password Password to protect the generated P12. (optional) + * @return ApiResponse<ProvisioningResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse signProvisionWithHttpInfo(Object ascPrivateKey, String ascKeyId, String ascIssuerId, String bundleid, String udid, String bundlename, String profilename, String devicename, String certificateId, String revokeExisting, String p12password) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = signProvisionRequestBuilder(ascPrivateKey, ascKeyId, ascIssuerId, bundleid, udid, bundlename, profilename, devicename, certificateId, revokeExisting, p12password); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("signProvision", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder signProvisionRequestBuilder(Object ascPrivateKey, String ascKeyId, String ascIssuerId, String bundleid, String udid, String bundlename, String profilename, String devicename, String certificateId, String revokeExisting, String p12password) throws ApiException { + // verify the required parameter 'ascPrivateKey' is set + if (ascPrivateKey == null) { + throw new ApiException(400, "Missing the required parameter 'ascPrivateKey' when calling signProvision"); + } + // verify the required parameter 'ascKeyId' is set + if (ascKeyId == null) { + throw new ApiException(400, "Missing the required parameter 'ascKeyId' when calling signProvision"); + } + // verify the required parameter 'ascIssuerId' is set + if (ascIssuerId == null) { + throw new ApiException(400, "Missing the required parameter 'ascIssuerId' when calling signProvision"); + } + // verify the required parameter 'bundleid' is set + if (bundleid == null) { + throw new ApiException(400, "Missing the required parameter 'bundleid' when calling signProvision"); + } + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling signProvision"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/sign/provision"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + MultipartEntityBuilder multiPartBuilder = MultipartEntityBuilder.create(); + boolean hasFiles = false; + multiPartBuilder.addTextBody("asc-private-key", ascPrivateKey.toString()); + multiPartBuilder.addTextBody("asc-key-id", ascKeyId.toString()); + multiPartBuilder.addTextBody("asc-issuer-id", ascIssuerId.toString()); + multiPartBuilder.addTextBody("bundleid", bundleid.toString()); + multiPartBuilder.addTextBody("udid", udid.toString()); + multiPartBuilder.addTextBody("bundlename", bundlename.toString()); + multiPartBuilder.addTextBody("profilename", profilename.toString()); + multiPartBuilder.addTextBody("devicename", devicename.toString()); + multiPartBuilder.addTextBody("certificate-id", certificateId.toString()); + multiPartBuilder.addTextBody("revoke-existing", revokeExisting.toString()); + multiPartBuilder.addTextBody("p12password", p12password.toString()); + HttpEntity entity = multiPartBuilder.build(); + HttpRequest.BodyPublisher formDataPublisher; + if (hasFiles) { + Pipe pipe; + try { + pipe = Pipe.open(); + } catch (IOException e) { + throw new RuntimeException(e); + } + new Thread(() -> { + try (OutputStream outputStream = Channels.newOutputStream(pipe.sink())) { + entity.writeTo(outputStream); + } catch (IOException e) { + e.printStackTrace(); + } + }).start(); + formDataPublisher = HttpRequest.BodyPublishers.ofInputStream(() -> Channels.newInputStream(pipe.source())); + } else { + ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); + try { + entity.writeTo(formOutputStream); + } catch (IOException e) { + throw new RuntimeException(e); + } + formDataPublisher = HttpRequest.BodyPublishers + .ofInputStream(() -> new ByteArrayInputStream(formOutputStream.toByteArray())); + } + localVarRequestBuilder + .header("Content-Type", entity.getContentType().getValue()) + .method("POST", formDataPublisher); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Stop tunnel + * Stop the tunnel for a device (CLI: `ios tunnel stop --udid`). + * @param udid (required) + * @return TunnelStopped + * @throws ApiException if fails to make API call + */ + public TunnelStopped stopTunnel(String udid) throws ApiException { + ApiResponse localVarResponse = stopTunnelWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * Stop tunnel + * Stop the tunnel for a device (CLI: `ios tunnel stop --udid`). + * @param udid (required) + * @return ApiResponse<TunnelStopped> + * @throws ApiException if fails to make API call + */ + public ApiResponse stopTunnelWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = stopTunnelRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("stopTunnel", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder stopTunnelRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling stopTunnel"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/tunnels/{udid}" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Stream a live pcap capture (binary) + * Stream a live packet capture from the device as a libpcap byte stream (pipeable into wireshark/tshark). Runs until `timeout` (seconds) elapses, the default timeout is reached, or the client disconnects. + * @param udid (required) + * @param timeout Capture duration in seconds (default 60, max 3600). (optional) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object streamsPcap(String udid, Integer timeout) throws ApiException { + ApiResponse localVarResponse = streamsPcapWithHttpInfo(udid, timeout); + return localVarResponse.getData(); + } + + /** + * Stream a live pcap capture (binary) + * Stream a live packet capture from the device as a libpcap byte stream (pipeable into wireshark/tshark). Runs until `timeout` (seconds) elapses, the default timeout is reached, or the client disconnects. + * @param udid (required) + * @param timeout Capture duration in seconds (default 60, max 3600). (optional) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse streamsPcapWithHttpInfo(String udid, Integer timeout) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = streamsPcapRequestBuilder(udid, timeout); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("streamsPcap", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder streamsPcapRequestBuilder(String udid, Integer timeout) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling streamsPcap"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/pcap" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "timeout"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("timeout", timeout)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/vnd.tcpdump.pcap, application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Stream screenshots as MJPEG (binary) + * Serve an MJPEG (multipart/x-mixed-replace) stream of device screenshots captured via the instruments screenshot service. Streams until the client disconnects or the source fails. + * @param udid (required) + * @param quality Optional JPEG quality (1–100, default 80). (optional) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object streamsScreenshotStream(String udid, Integer quality) throws ApiException { + ApiResponse localVarResponse = streamsScreenshotStreamWithHttpInfo(udid, quality); + return localVarResponse.getData(); + } + + /** + * Stream screenshots as MJPEG (binary) + * Serve an MJPEG (multipart/x-mixed-replace) stream of device screenshots captured via the instruments screenshot service. Streams until the client disconnects or the source fails. + * @param udid (required) + * @param quality Optional JPEG quality (1–100, default 80). (optional) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse streamsScreenshotStreamWithHttpInfo(String udid, Integer quality) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = streamsScreenshotStreamRequestBuilder(udid, quality); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("streamsScreenshotStream", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder streamsScreenshotStreamRequestBuilder(String udid, Integer quality) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling streamsScreenshotStream"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/screenshot/stream" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "image/jpeg, application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Stream UI video (binary) + * Open a live UI video stream against a forwarded WDA/DeviceKit backend and pipe it straight through to the client. Default codec is MJPEG (multipart/x-mixed-replace); `codec=h264` returns an H.264 elementary stream (requires the devicekit backend). Streams until the client disconnects or the backend ends. Requires a running, forwarded WDA/DeviceKit backend (see the UI routes). + * @param udid (required) + * @param backend Backend to target: `wda` (default) or `devicekit`. (optional) + * @param wdaUrl Forwarded backend base URL (defaults per backend). (optional) + * @param timeout Per-request HTTP timeout in seconds (default 60). (optional) + * @param codec Video codec: `mjpeg` (default) or `h264` (devicekit backend only). (optional) + * @param fps Target frames per second (backend-dependent). (optional) + * @param quality JPEG quality for the mjpeg codec. (optional) + * @param scale Scale factor (backend-dependent). (optional) + * @param bitrate Target bitrate for the h264 codec. (optional) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object streamsUiStream(String udid, String backend, String wdaUrl, Integer timeout, String codec, String fps, String quality, String scale, String bitrate) throws ApiException { + ApiResponse localVarResponse = streamsUiStreamWithHttpInfo(udid, backend, wdaUrl, timeout, codec, fps, quality, scale, bitrate); + return localVarResponse.getData(); + } + + /** + * Stream UI video (binary) + * Open a live UI video stream against a forwarded WDA/DeviceKit backend and pipe it straight through to the client. Default codec is MJPEG (multipart/x-mixed-replace); `codec=h264` returns an H.264 elementary stream (requires the devicekit backend). Streams until the client disconnects or the backend ends. Requires a running, forwarded WDA/DeviceKit backend (see the UI routes). + * @param udid (required) + * @param backend Backend to target: `wda` (default) or `devicekit`. (optional) + * @param wdaUrl Forwarded backend base URL (defaults per backend). (optional) + * @param timeout Per-request HTTP timeout in seconds (default 60). (optional) + * @param codec Video codec: `mjpeg` (default) or `h264` (devicekit backend only). (optional) + * @param fps Target frames per second (backend-dependent). (optional) + * @param quality JPEG quality for the mjpeg codec. (optional) + * @param scale Scale factor (backend-dependent). (optional) + * @param bitrate Target bitrate for the h264 codec. (optional) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse streamsUiStreamWithHttpInfo(String udid, String backend, String wdaUrl, Integer timeout, String codec, String fps, String quality, String scale, String bitrate) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = streamsUiStreamRequestBuilder(udid, backend, wdaUrl, timeout, codec, fps, quality, scale, bitrate); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("streamsUiStream", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder streamsUiStreamRequestBuilder(String udid, String backend, String wdaUrl, Integer timeout, String codec, String fps, String quality, String scale, String bitrate) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling streamsUiStream"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/ui/stream" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "backend"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backend", backend)); + localVarQueryParameterBaseName = "wdaUrl"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("wdaUrl", wdaUrl)); + localVarQueryParameterBaseName = "timeout"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("timeout", timeout)); + localVarQueryParameterBaseName = "codec"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("codec", codec)); + localVarQueryParameterBaseName = "fps"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fps", fps)); + localVarQueryParameterBaseName = "quality"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("quality", quality)); + localVarQueryParameterBaseName = "scale"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("scale", scale)); + localVarQueryParameterBaseName = "bitrate"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("bitrate", bitrate)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/octet-stream, application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Raw backend passthrough + * Raw passthrough to the backend. For WDA supply `method`/`path`/`body`; for DeviceKit supply `rpcMethod`/`rpcParams`. The backend response is forwarded verbatim. + * @param udid (required) + * @param uiAPIRequest (required) + * @param backend Backend to target: `wda` (default) or `devicekit`. (optional) + * @param wdaUrl Forwarded backend base URL (defaults per backend). (optional) + * @param timeout Per-request HTTP timeout in seconds (default 60). (optional) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object uIUiApi(String udid, UIAPIRequest uiAPIRequest, String backend, String wdaUrl, Integer timeout) throws ApiException { + ApiResponse localVarResponse = uIUiApiWithHttpInfo(udid, uiAPIRequest, backend, wdaUrl, timeout); + return localVarResponse.getData(); + } + + /** + * Raw backend passthrough + * Raw passthrough to the backend. For WDA supply `method`/`path`/`body`; for DeviceKit supply `rpcMethod`/`rpcParams`. The backend response is forwarded verbatim. + * @param udid (required) + * @param uiAPIRequest (required) + * @param backend Backend to target: `wda` (default) or `devicekit`. (optional) + * @param wdaUrl Forwarded backend base URL (defaults per backend). (optional) + * @param timeout Per-request HTTP timeout in seconds (default 60). (optional) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse uIUiApiWithHttpInfo(String udid, UIAPIRequest uiAPIRequest, String backend, String wdaUrl, Integer timeout) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = uIUiApiRequestBuilder(udid, uiAPIRequest, backend, wdaUrl, timeout); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("uIUiApi", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder uIUiApiRequestBuilder(String udid, UIAPIRequest uiAPIRequest, String backend, String wdaUrl, Integer timeout) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling uIUiApi"); + } + // verify the required parameter 'uiAPIRequest' is set + if (uiAPIRequest == null) { + throw new ApiException(400, "Missing the required parameter 'uiAPIRequest' when calling uIUiApi"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/ui/api" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "backend"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backend", backend)); + localVarQueryParameterBaseName = "wdaUrl"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("wdaUrl", wdaUrl)); + localVarQueryParameterBaseName = "timeout"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("timeout", timeout)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(uiAPIRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Foreground app (UI backend) + * Bring the backgrounded app to the foreground. Only the devicekit backend supports this; WDA returns `501`. The request body is ignored. + * @param udid (required) + * @param backend Backend to target: `wda` (default) or `devicekit`. (optional) + * @param wdaUrl Forwarded backend base URL (defaults per backend). (optional) + * @param timeout Per-request HTTP timeout in seconds (default 60). (optional) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object uIUiAppForeground(String udid, String backend, String wdaUrl, Integer timeout) throws ApiException { + ApiResponse localVarResponse = uIUiAppForegroundWithHttpInfo(udid, backend, wdaUrl, timeout); + return localVarResponse.getData(); + } + + /** + * Foreground app (UI backend) + * Bring the backgrounded app to the foreground. Only the devicekit backend supports this; WDA returns `501`. The request body is ignored. + * @param udid (required) + * @param backend Backend to target: `wda` (default) or `devicekit`. (optional) + * @param wdaUrl Forwarded backend base URL (defaults per backend). (optional) + * @param timeout Per-request HTTP timeout in seconds (default 60). (optional) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse uIUiAppForegroundWithHttpInfo(String udid, String backend, String wdaUrl, Integer timeout) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = uIUiAppForegroundRequestBuilder(udid, backend, wdaUrl, timeout); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("uIUiAppForeground", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder uIUiAppForegroundRequestBuilder(String udid, String backend, String wdaUrl, Integer timeout) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling uIUiAppForeground"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/ui/app/foreground" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "backend"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backend", backend)); + localVarQueryParameterBaseName = "wdaUrl"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("wdaUrl", wdaUrl)); + localVarQueryParameterBaseName = "timeout"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("timeout", timeout)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Launch app (UI backend) + * Launch the app identified by `bundleId`. + * @param udid (required) + * @param uiAppRequest (required) + * @param backend Backend to target: `wda` (default) or `devicekit`. (optional) + * @param wdaUrl Forwarded backend base URL (defaults per backend). (optional) + * @param timeout Per-request HTTP timeout in seconds (default 60). (optional) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object uIUiAppLaunch(String udid, UIAppRequest uiAppRequest, String backend, String wdaUrl, Integer timeout) throws ApiException { + ApiResponse localVarResponse = uIUiAppLaunchWithHttpInfo(udid, uiAppRequest, backend, wdaUrl, timeout); + return localVarResponse.getData(); + } + + /** + * Launch app (UI backend) + * Launch the app identified by `bundleId`. + * @param udid (required) + * @param uiAppRequest (required) + * @param backend Backend to target: `wda` (default) or `devicekit`. (optional) + * @param wdaUrl Forwarded backend base URL (defaults per backend). (optional) + * @param timeout Per-request HTTP timeout in seconds (default 60). (optional) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse uIUiAppLaunchWithHttpInfo(String udid, UIAppRequest uiAppRequest, String backend, String wdaUrl, Integer timeout) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = uIUiAppLaunchRequestBuilder(udid, uiAppRequest, backend, wdaUrl, timeout); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("uIUiAppLaunch", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder uIUiAppLaunchRequestBuilder(String udid, UIAppRequest uiAppRequest, String backend, String wdaUrl, Integer timeout) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling uIUiAppLaunch"); + } + // verify the required parameter 'uiAppRequest' is set + if (uiAppRequest == null) { + throw new ApiException(400, "Missing the required parameter 'uiAppRequest' when calling uIUiAppLaunch"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/ui/app/launch" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "backend"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backend", backend)); + localVarQueryParameterBaseName = "wdaUrl"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("wdaUrl", wdaUrl)); + localVarQueryParameterBaseName = "timeout"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("timeout", timeout)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(uiAppRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Terminate app (UI backend) + * Terminate the app identified by `bundleId`. + * @param udid (required) + * @param uiAppRequest (required) + * @param backend Backend to target: `wda` (default) or `devicekit`. (optional) + * @param wdaUrl Forwarded backend base URL (defaults per backend). (optional) + * @param timeout Per-request HTTP timeout in seconds (default 60). (optional) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object uIUiAppTerminate(String udid, UIAppRequest uiAppRequest, String backend, String wdaUrl, Integer timeout) throws ApiException { + ApiResponse localVarResponse = uIUiAppTerminateWithHttpInfo(udid, uiAppRequest, backend, wdaUrl, timeout); + return localVarResponse.getData(); + } + + /** + * Terminate app (UI backend) + * Terminate the app identified by `bundleId`. + * @param udid (required) + * @param uiAppRequest (required) + * @param backend Backend to target: `wda` (default) or `devicekit`. (optional) + * @param wdaUrl Forwarded backend base URL (defaults per backend). (optional) + * @param timeout Per-request HTTP timeout in seconds (default 60). (optional) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse uIUiAppTerminateWithHttpInfo(String udid, UIAppRequest uiAppRequest, String backend, String wdaUrl, Integer timeout) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = uIUiAppTerminateRequestBuilder(udid, uiAppRequest, backend, wdaUrl, timeout); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("uIUiAppTerminate", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder uIUiAppTerminateRequestBuilder(String udid, UIAppRequest uiAppRequest, String backend, String wdaUrl, Integer timeout) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling uIUiAppTerminate"); + } + // verify the required parameter 'uiAppRequest' is set + if (uiAppRequest == null) { + throw new ApiException(400, "Missing the required parameter 'uiAppRequest' when calling uIUiAppTerminate"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/ui/app/terminate" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "backend"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backend", backend)); + localVarQueryParameterBaseName = "wdaUrl"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("wdaUrl", wdaUrl)); + localVarQueryParameterBaseName = "timeout"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("timeout", timeout)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(uiAppRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Press hardware button + * Press a hardware button by name (WDA supports only `home`). + * @param udid (required) + * @param uiButtonRequest (required) + * @param backend Backend to target: `wda` (default) or `devicekit`. (optional) + * @param wdaUrl Forwarded backend base URL (defaults per backend). (optional) + * @param timeout Per-request HTTP timeout in seconds (default 60). (optional) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object uIUiButton(String udid, UIButtonRequest uiButtonRequest, String backend, String wdaUrl, Integer timeout) throws ApiException { + ApiResponse localVarResponse = uIUiButtonWithHttpInfo(udid, uiButtonRequest, backend, wdaUrl, timeout); + return localVarResponse.getData(); + } + + /** + * Press hardware button + * Press a hardware button by name (WDA supports only `home`). + * @param udid (required) + * @param uiButtonRequest (required) + * @param backend Backend to target: `wda` (default) or `devicekit`. (optional) + * @param wdaUrl Forwarded backend base URL (defaults per backend). (optional) + * @param timeout Per-request HTTP timeout in seconds (default 60). (optional) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse uIUiButtonWithHttpInfo(String udid, UIButtonRequest uiButtonRequest, String backend, String wdaUrl, Integer timeout) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = uIUiButtonRequestBuilder(udid, uiButtonRequest, backend, wdaUrl, timeout); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("uIUiButton", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder uIUiButtonRequestBuilder(String udid, UIButtonRequest uiButtonRequest, String backend, String wdaUrl, Integer timeout) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling uIUiButton"); + } + // verify the required parameter 'uiButtonRequest' is set + if (uiButtonRequest == null) { + throw new ApiException(400, "Missing the required parameter 'uiButtonRequest' when calling uIUiButton"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/ui/button" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "backend"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backend", backend)); + localVarQueryParameterBaseName = "wdaUrl"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("wdaUrl", wdaUrl)); + localVarQueryParameterBaseName = "timeout"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("timeout", timeout)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(uiButtonRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get orientation + * Get the current device orientation payload. + * @param udid (required) + * @param backend Backend to target: `wda` (default) or `devicekit`. (optional) + * @param wdaUrl Forwarded backend base URL (defaults per backend). (optional) + * @param timeout Per-request HTTP timeout in seconds (default 60). (optional) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object uIUiGetOrientation(String udid, String backend, String wdaUrl, Integer timeout) throws ApiException { + ApiResponse localVarResponse = uIUiGetOrientationWithHttpInfo(udid, backend, wdaUrl, timeout); + return localVarResponse.getData(); + } + + /** + * Get orientation + * Get the current device orientation payload. + * @param udid (required) + * @param backend Backend to target: `wda` (default) or `devicekit`. (optional) + * @param wdaUrl Forwarded backend base URL (defaults per backend). (optional) + * @param timeout Per-request HTTP timeout in seconds (default 60). (optional) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse uIUiGetOrientationWithHttpInfo(String udid, String backend, String wdaUrl, Integer timeout) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = uIUiGetOrientationRequestBuilder(udid, backend, wdaUrl, timeout); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("uIUiGetOrientation", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder uIUiGetOrientationRequestBuilder(String udid, String backend, String wdaUrl, Integer timeout) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling uIUiGetOrientation"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/ui/orientation" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "backend"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backend", backend)); + localVarQueryParameterBaseName = "wdaUrl"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("wdaUrl", wdaUrl)); + localVarQueryParameterBaseName = "timeout"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("timeout", timeout)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Long press + * Press and hold at (x,y). + * @param udid (required) + * @param uiLongPressRequest (required) + * @param backend Backend to target: `wda` (default) or `devicekit`. (optional) + * @param wdaUrl Forwarded backend base URL (defaults per backend). (optional) + * @param timeout Per-request HTTP timeout in seconds (default 60). (optional) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object uIUiLongPress(String udid, UILongPressRequest uiLongPressRequest, String backend, String wdaUrl, Integer timeout) throws ApiException { + ApiResponse localVarResponse = uIUiLongPressWithHttpInfo(udid, uiLongPressRequest, backend, wdaUrl, timeout); + return localVarResponse.getData(); + } + + /** + * Long press + * Press and hold at (x,y). + * @param udid (required) + * @param uiLongPressRequest (required) + * @param backend Backend to target: `wda` (default) or `devicekit`. (optional) + * @param wdaUrl Forwarded backend base URL (defaults per backend). (optional) + * @param timeout Per-request HTTP timeout in seconds (default 60). (optional) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse uIUiLongPressWithHttpInfo(String udid, UILongPressRequest uiLongPressRequest, String backend, String wdaUrl, Integer timeout) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = uIUiLongPressRequestBuilder(udid, uiLongPressRequest, backend, wdaUrl, timeout); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("uIUiLongPress", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder uIUiLongPressRequestBuilder(String udid, UILongPressRequest uiLongPressRequest, String backend, String wdaUrl, Integer timeout) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling uIUiLongPress"); + } + // verify the required parameter 'uiLongPressRequest' is set + if (uiLongPressRequest == null) { + throw new ApiException(400, "Missing the required parameter 'uiLongPressRequest' when calling uIUiLongPress"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/ui/longpress" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "backend"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backend", backend)); + localVarQueryParameterBaseName = "wdaUrl"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("wdaUrl", wdaUrl)); + localVarQueryParameterBaseName = "timeout"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("timeout", timeout)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(uiLongPressRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * UI screenshot (PNG) + * Capture the screen and return raw PNG bytes. + * @param udid (required) + * @param backend Backend to target: `wda` (default) or `devicekit`. (optional) + * @param wdaUrl Forwarded backend base URL (defaults per backend). (optional) + * @param timeout Per-request HTTP timeout in seconds (default 60). (optional) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object uIUiScreenshot(String udid, String backend, String wdaUrl, Integer timeout) throws ApiException { + ApiResponse localVarResponse = uIUiScreenshotWithHttpInfo(udid, backend, wdaUrl, timeout); + return localVarResponse.getData(); + } + + /** + * UI screenshot (PNG) + * Capture the screen and return raw PNG bytes. + * @param udid (required) + * @param backend Backend to target: `wda` (default) or `devicekit`. (optional) + * @param wdaUrl Forwarded backend base URL (defaults per backend). (optional) + * @param timeout Per-request HTTP timeout in seconds (default 60). (optional) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse uIUiScreenshotWithHttpInfo(String udid, String backend, String wdaUrl, Integer timeout) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = uIUiScreenshotRequestBuilder(udid, backend, wdaUrl, timeout); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("uIUiScreenshot", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder uIUiScreenshotRequestBuilder(String udid, String backend, String wdaUrl, Integer timeout) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling uIUiScreenshot"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/ui/screenshot" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "backend"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backend", backend)); + localVarQueryParameterBaseName = "wdaUrl"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("wdaUrl", wdaUrl)); + localVarQueryParameterBaseName = "timeout"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("timeout", timeout)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "image/png, application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Set orientation + * Set the device orientation. + * @param udid (required) + * @param uiOrientationRequest (required) + * @param backend Backend to target: `wda` (default) or `devicekit`. (optional) + * @param wdaUrl Forwarded backend base URL (defaults per backend). (optional) + * @param timeout Per-request HTTP timeout in seconds (default 60). (optional) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object uIUiSetOrientation(String udid, UIOrientationRequest uiOrientationRequest, String backend, String wdaUrl, Integer timeout) throws ApiException { + ApiResponse localVarResponse = uIUiSetOrientationWithHttpInfo(udid, uiOrientationRequest, backend, wdaUrl, timeout); + return localVarResponse.getData(); + } + + /** + * Set orientation + * Set the device orientation. + * @param udid (required) + * @param uiOrientationRequest (required) + * @param backend Backend to target: `wda` (default) or `devicekit`. (optional) + * @param wdaUrl Forwarded backend base URL (defaults per backend). (optional) + * @param timeout Per-request HTTP timeout in seconds (default 60). (optional) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse uIUiSetOrientationWithHttpInfo(String udid, UIOrientationRequest uiOrientationRequest, String backend, String wdaUrl, Integer timeout) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = uIUiSetOrientationRequestBuilder(udid, uiOrientationRequest, backend, wdaUrl, timeout); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("uIUiSetOrientation", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder uIUiSetOrientationRequestBuilder(String udid, UIOrientationRequest uiOrientationRequest, String backend, String wdaUrl, Integer timeout) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling uIUiSetOrientation"); + } + // verify the required parameter 'uiOrientationRequest' is set + if (uiOrientationRequest == null) { + throw new ApiException(400, "Missing the required parameter 'uiOrientationRequest' when calling uIUiSetOrientation"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/ui/orientation" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "backend"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backend", backend)); + localVarQueryParameterBaseName = "wdaUrl"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("wdaUrl", wdaUrl)); + localVarQueryParameterBaseName = "timeout"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("timeout", timeout)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(uiOrientationRequest); + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * UI source hierarchy + * Return the current view hierarchy (XML for WDA; backend Content-Type preserved). + * @param udid (required) + * @param backend Backend to target: `wda` (default) or `devicekit`. (optional) + * @param wdaUrl Forwarded backend base URL (defaults per backend). (optional) + * @param timeout Per-request HTTP timeout in seconds (default 60). (optional) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object uIUiSource(String udid, String backend, String wdaUrl, Integer timeout) throws ApiException { + ApiResponse localVarResponse = uIUiSourceWithHttpInfo(udid, backend, wdaUrl, timeout); + return localVarResponse.getData(); + } + + /** + * UI source hierarchy + * Return the current view hierarchy (XML for WDA; backend Content-Type preserved). + * @param udid (required) + * @param backend Backend to target: `wda` (default) or `devicekit`. (optional) + * @param wdaUrl Forwarded backend base URL (defaults per backend). (optional) + * @param timeout Per-request HTTP timeout in seconds (default 60). (optional) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse uIUiSourceWithHttpInfo(String udid, String backend, String wdaUrl, Integer timeout) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = uIUiSourceRequestBuilder(udid, backend, wdaUrl, timeout); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("uIUiSource", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder uIUiSourceRequestBuilder(String udid, String backend, String wdaUrl, Integer timeout) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling uIUiSource"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/ui/source" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "backend"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backend", backend)); + localVarQueryParameterBaseName = "wdaUrl"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("wdaUrl", wdaUrl)); + localVarQueryParameterBaseName = "timeout"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("timeout", timeout)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/xml, application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * UI backend status + * Return the backend status/health payload (WDA /status or DeviceKit /health). + * @param udid (required) + * @param backend Backend to target: `wda` (default) or `devicekit`. (optional) + * @param wdaUrl Forwarded backend base URL (defaults per backend). (optional) + * @param timeout Per-request HTTP timeout in seconds (default 60). (optional) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object uIUiStatus(String udid, String backend, String wdaUrl, Integer timeout) throws ApiException { + ApiResponse localVarResponse = uIUiStatusWithHttpInfo(udid, backend, wdaUrl, timeout); + return localVarResponse.getData(); + } + + /** + * UI backend status + * Return the backend status/health payload (WDA /status or DeviceKit /health). + * @param udid (required) + * @param backend Backend to target: `wda` (default) or `devicekit`. (optional) + * @param wdaUrl Forwarded backend base URL (defaults per backend). (optional) + * @param timeout Per-request HTTP timeout in seconds (default 60). (optional) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse uIUiStatusWithHttpInfo(String udid, String backend, String wdaUrl, Integer timeout) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = uIUiStatusRequestBuilder(udid, backend, wdaUrl, timeout); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("uIUiStatus", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder uIUiStatusRequestBuilder(String udid, String backend, String wdaUrl, Integer timeout) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling uIUiStatus"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/ui/status" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "backend"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backend", backend)); + localVarQueryParameterBaseName = "wdaUrl"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("wdaUrl", wdaUrl)); + localVarQueryParameterBaseName = "timeout"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("timeout", timeout)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Swipe + * Drag from (x1,y1) to (x2,y2). + * @param udid (required) + * @param uiSwipeRequest (required) + * @param backend Backend to target: `wda` (default) or `devicekit`. (optional) + * @param wdaUrl Forwarded backend base URL (defaults per backend). (optional) + * @param timeout Per-request HTTP timeout in seconds (default 60). (optional) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object uIUiSwipe(String udid, UISwipeRequest uiSwipeRequest, String backend, String wdaUrl, Integer timeout) throws ApiException { + ApiResponse localVarResponse = uIUiSwipeWithHttpInfo(udid, uiSwipeRequest, backend, wdaUrl, timeout); + return localVarResponse.getData(); + } + + /** + * Swipe + * Drag from (x1,y1) to (x2,y2). + * @param udid (required) + * @param uiSwipeRequest (required) + * @param backend Backend to target: `wda` (default) or `devicekit`. (optional) + * @param wdaUrl Forwarded backend base URL (defaults per backend). (optional) + * @param timeout Per-request HTTP timeout in seconds (default 60). (optional) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse uIUiSwipeWithHttpInfo(String udid, UISwipeRequest uiSwipeRequest, String backend, String wdaUrl, Integer timeout) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = uIUiSwipeRequestBuilder(udid, uiSwipeRequest, backend, wdaUrl, timeout); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("uIUiSwipe", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder uIUiSwipeRequestBuilder(String udid, UISwipeRequest uiSwipeRequest, String backend, String wdaUrl, Integer timeout) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling uIUiSwipe"); + } + // verify the required parameter 'uiSwipeRequest' is set + if (uiSwipeRequest == null) { + throw new ApiException(400, "Missing the required parameter 'uiSwipeRequest' when calling uIUiSwipe"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/ui/swipe" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "backend"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backend", backend)); + localVarQueryParameterBaseName = "wdaUrl"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("wdaUrl", wdaUrl)); + localVarQueryParameterBaseName = "timeout"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("timeout", timeout)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(uiSwipeRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Tap + * Tap at absolute coordinates. + * @param udid (required) + * @param uiTapRequest (required) + * @param backend Backend to target: `wda` (default) or `devicekit`. (optional) + * @param wdaUrl Forwarded backend base URL (defaults per backend). (optional) + * @param timeout Per-request HTTP timeout in seconds (default 60). (optional) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object uIUiTap(String udid, UITapRequest uiTapRequest, String backend, String wdaUrl, Integer timeout) throws ApiException { + ApiResponse localVarResponse = uIUiTapWithHttpInfo(udid, uiTapRequest, backend, wdaUrl, timeout); + return localVarResponse.getData(); + } + + /** + * Tap + * Tap at absolute coordinates. + * @param udid (required) + * @param uiTapRequest (required) + * @param backend Backend to target: `wda` (default) or `devicekit`. (optional) + * @param wdaUrl Forwarded backend base URL (defaults per backend). (optional) + * @param timeout Per-request HTTP timeout in seconds (default 60). (optional) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse uIUiTapWithHttpInfo(String udid, UITapRequest uiTapRequest, String backend, String wdaUrl, Integer timeout) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = uIUiTapRequestBuilder(udid, uiTapRequest, backend, wdaUrl, timeout); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("uIUiTap", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder uIUiTapRequestBuilder(String udid, UITapRequest uiTapRequest, String backend, String wdaUrl, Integer timeout) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling uIUiTap"); + } + // verify the required parameter 'uiTapRequest' is set + if (uiTapRequest == null) { + throw new ApiException(400, "Missing the required parameter 'uiTapRequest' when calling uIUiTap"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/ui/tap" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "backend"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backend", backend)); + localVarQueryParameterBaseName = "wdaUrl"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("wdaUrl", wdaUrl)); + localVarQueryParameterBaseName = "timeout"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("timeout", timeout)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(uiTapRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Type text + * Send text as keyboard input. + * @param udid (required) + * @param uiTypeRequest (required) + * @param backend Backend to target: `wda` (default) or `devicekit`. (optional) + * @param wdaUrl Forwarded backend base URL (defaults per backend). (optional) + * @param timeout Per-request HTTP timeout in seconds (default 60). (optional) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object uIUiType(String udid, UITypeRequest uiTypeRequest, String backend, String wdaUrl, Integer timeout) throws ApiException { + ApiResponse localVarResponse = uIUiTypeWithHttpInfo(udid, uiTypeRequest, backend, wdaUrl, timeout); + return localVarResponse.getData(); + } + + /** + * Type text + * Send text as keyboard input. + * @param udid (required) + * @param uiTypeRequest (required) + * @param backend Backend to target: `wda` (default) or `devicekit`. (optional) + * @param wdaUrl Forwarded backend base URL (defaults per backend). (optional) + * @param timeout Per-request HTTP timeout in seconds (default 60). (optional) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse uIUiTypeWithHttpInfo(String udid, UITypeRequest uiTypeRequest, String backend, String wdaUrl, Integer timeout) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = uIUiTypeRequestBuilder(udid, uiTypeRequest, backend, wdaUrl, timeout); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("uIUiType", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder uIUiTypeRequestBuilder(String udid, UITypeRequest uiTypeRequest, String backend, String wdaUrl, Integer timeout) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling uIUiType"); + } + // verify the required parameter 'uiTypeRequest' is set + if (uiTypeRequest == null) { + throw new ApiException(400, "Missing the required parameter 'uiTypeRequest' when calling uIUiType"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/ui/type" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "backend"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backend", backend)); + localVarQueryParameterBaseName = "wdaUrl"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("wdaUrl", wdaUrl)); + localVarQueryParameterBaseName = "timeout"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("timeout", timeout)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(uiTypeRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * UI window size + * Return the device window/screen size payload (typically {width,height}). + * @param udid (required) + * @param backend Backend to target: `wda` (default) or `devicekit`. (optional) + * @param wdaUrl Forwarded backend base URL (defaults per backend). (optional) + * @param timeout Per-request HTTP timeout in seconds (default 60). (optional) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object uIUiWindowSize(String udid, String backend, String wdaUrl, Integer timeout) throws ApiException { + ApiResponse localVarResponse = uIUiWindowSizeWithHttpInfo(udid, backend, wdaUrl, timeout); + return localVarResponse.getData(); + } + + /** + * UI window size + * Return the device window/screen size payload (typically {width,height}). + * @param udid (required) + * @param backend Backend to target: `wda` (default) or `devicekit`. (optional) + * @param wdaUrl Forwarded backend base URL (defaults per backend). (optional) + * @param timeout Per-request HTTP timeout in seconds (default 60). (optional) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + */ + public ApiResponse uIUiWindowSizeWithHttpInfo(String udid, String backend, String wdaUrl, Integer timeout) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = uIUiWindowSizeRequestBuilder(udid, backend, wdaUrl, timeout); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("uIUiWindowSize", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder uIUiWindowSizeRequestBuilder(String udid, String backend, String wdaUrl, Integer timeout) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling uIUiWindowSize"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/ui/size" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "backend"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("backend", backend)); + localVarQueryParameterBaseName = "wdaUrl"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("wdaUrl", wdaUrl)); + localVarQueryParameterBaseName = "timeout"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("timeout", timeout)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Evaluate JavaScript in a page + * Evaluate JavaScript in an inspectable page and return the result (CLI: `ios webinspector eval`). `404` when no matching page exists. + * @param udid (required) + * @param webInspectorEvalRequest (required) + * @return WebInspectorEvalResult + * @throws ApiException if fails to make API call + */ + public WebInspectorEvalResult webInspectorWebInspectorEval(String udid, WebInspectorEvalRequest webInspectorEvalRequest) throws ApiException { + ApiResponse localVarResponse = webInspectorWebInspectorEvalWithHttpInfo(udid, webInspectorEvalRequest); + return localVarResponse.getData(); + } + + /** + * Evaluate JavaScript in a page + * Evaluate JavaScript in an inspectable page and return the result (CLI: `ios webinspector eval`). `404` when no matching page exists. + * @param udid (required) + * @param webInspectorEvalRequest (required) + * @return ApiResponse<WebInspectorEvalResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse webInspectorWebInspectorEvalWithHttpInfo(String udid, WebInspectorEvalRequest webInspectorEvalRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = webInspectorWebInspectorEvalRequestBuilder(udid, webInspectorEvalRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("webInspectorWebInspectorEval", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder webInspectorWebInspectorEvalRequestBuilder(String udid, WebInspectorEvalRequest webInspectorEvalRequest) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling webInspectorWebInspectorEval"); + } + // verify the required parameter 'webInspectorEvalRequest' is set + if (webInspectorEvalRequest == null) { + throw new ApiException(400, "Missing the required parameter 'webInspectorEvalRequest' when calling webInspectorWebInspectorEval"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/webinspector/eval" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(webInspectorEvalRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Open a URL in a new inspectable page + * Open a URL in a new inspectable page via a remote automation session (CLI: `ios webinspector launch <url>`). `url` may be a query param or in the body; `bundleId` defaults to Safari. + * @param udid (required) + * @param url URL to open (alternative to the request body). (optional) + * @param webInspectorLaunchRequest (optional) + * @return WebInspectorLaunchResult + * @throws ApiException if fails to make API call + */ + public WebInspectorLaunchResult webInspectorWebInspectorLaunch(String udid, String url, WebInspectorLaunchRequest webInspectorLaunchRequest) throws ApiException { + ApiResponse localVarResponse = webInspectorWebInspectorLaunchWithHttpInfo(udid, url, webInspectorLaunchRequest); + return localVarResponse.getData(); + } + + /** + * Open a URL in a new inspectable page + * Open a URL in a new inspectable page via a remote automation session (CLI: `ios webinspector launch <url>`). `url` may be a query param or in the body; `bundleId` defaults to Safari. + * @param udid (required) + * @param url URL to open (alternative to the request body). (optional) + * @param webInspectorLaunchRequest (optional) + * @return ApiResponse<WebInspectorLaunchResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse webInspectorWebInspectorLaunchWithHttpInfo(String udid, String url, WebInspectorLaunchRequest webInspectorLaunchRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = webInspectorWebInspectorLaunchRequestBuilder(udid, url, webInspectorLaunchRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("webInspectorWebInspectorLaunch", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder webInspectorWebInspectorLaunchRequestBuilder(String udid, String url, WebInspectorLaunchRequest webInspectorLaunchRequest) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling webInspectorWebInspectorLaunch"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/webinspector/launch" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "url"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("url", url)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(webInspectorLaunchRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * List inspectable pages + * List inspectable pages reported by the device (CLI: `ios webinspector list`). + * @param udid (required) + * @return List<Object> + * @throws ApiException if fails to make API call + */ + public List webInspectorWebInspectorPages(String udid) throws ApiException { + ApiResponse> localVarResponse = webInspectorWebInspectorPagesWithHttpInfo(udid); + return localVarResponse.getData(); + } + + /** + * List inspectable pages + * List inspectable pages reported by the device (CLI: `ios webinspector list`). + * @param udid (required) + * @return ApiResponse<List<Object>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> webInspectorWebInspectorPagesWithHttpInfo(String udid) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = webInspectorWebInspectorPagesRequestBuilder(udid); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("webInspectorWebInspectorPages", localVarResponse); + } + if (localVarResponse.body() == null) { + return new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + String responseBody = new String(localVarResponse.body().readAllBytes()); + localVarResponse.body().close(); + + return new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference>() {}) + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder webInspectorWebInspectorPagesRequestBuilder(String udid) throws ApiException { + // verify the required parameter 'udid' is set + if (udid == null) { + throw new ApiException(400, "Missing the required parameter 'udid' when calling webInspectorWebInspectorPages"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/device/{udid}/webinspector/pages" + .replace("{udid}", ApiClient.urlEncode(udid.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + +} diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/invoker/ApiClient.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/invoker/ApiClient.java new file mode 100644 index 000000000..0db1d3754 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/invoker/ApiClient.java @@ -0,0 +1,454 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.github.danielpaulus.goios.generated.invoker; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; + +import java.io.InputStream; +import java.net.URI; +import java.net.URLEncoder; +import java.net.http.HttpClient; +import java.net.http.HttpConnectTimeoutException; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.StringJoiner; +import java.util.function.Consumer; +import java.util.stream.Collectors; + +import static java.nio.charset.StandardCharsets.UTF_8; + +/** + * Configuration and utility class for API clients. + * + *

This class can be constructed and modified, then used to instantiate the + * various API classes. The API classes use the settings in this class to + * configure themselves, but otherwise do not store a link to this class.

+ * + *

This class is mutable and not synchronized, so it is not thread-safe. + * The API classes generated from this are immutable and thread-safe.

+ * + *

The setter methods of this class return the current object to facilitate + * a fluent style of configuration.

+ */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class ApiClient { + + private HttpClient.Builder builder; + private ObjectMapper mapper; + private String scheme; + private String host; + private int port; + private String basePath; + private Consumer interceptor; + private Consumer> responseInterceptor; + private Consumer> asyncResponseInterceptor; + private Duration readTimeout; + private Duration connectTimeout; + + public static String valueToString(Object value) { + if (value == null) { + return ""; + } + if (value instanceof OffsetDateTime) { + return ((OffsetDateTime) value).format(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + return value.toString(); + } + + /** + * URL encode a string in the UTF-8 encoding. + * + * @param s String to encode. + * @return URL-encoded representation of the input string. + */ + public static String urlEncode(String s) { + return URLEncoder.encode(s, UTF_8).replaceAll("\\+", "%20"); + } + + /** + * Convert a URL query name/value parameter to a list of encoded {@link Pair} + * objects. + * + *

The value can be null, in which case an empty list is returned.

+ * + * @param name The query name parameter. + * @param value The query value, which may not be a collection but may be + * null. + * @return A singleton list of the {@link Pair} objects representing the input + * parameters, which is encoded for use in a URL. If the value is null, an + * empty list is returned. + */ + public static List parameterToPairs(String name, Object value) { + if (name == null || name.isEmpty() || value == null) { + return Collections.emptyList(); + } + return Collections.singletonList(new Pair(urlEncode(name), urlEncode(valueToString(value)))); + } + + /** + * Convert a URL query name/collection parameter to a list of encoded + * {@link Pair} objects. + * + * @param collectionFormat The swagger collectionFormat string (csv, tsv, etc). + * @param name The query name parameter. + * @param values A collection of values for the given query name, which may be + * null. + * @return A list of {@link Pair} objects representing the input parameters, + * which is encoded for use in a URL. If the values collection is null, an + * empty list is returned. + */ + public static List parameterToPairs( + String collectionFormat, String name, Collection values) { + if (name == null || name.isEmpty() || values == null || values.isEmpty()) { + return Collections.emptyList(); + } + + // get the collection format (default: csv) + String format = collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat; + + // create the params based on the collection format + if ("multi".equals(format)) { + return values.stream() + .map(value -> new Pair(urlEncode(name), urlEncode(valueToString(value)))) + .collect(Collectors.toList()); + } + + String delimiter; + switch(format) { + case "csv": + delimiter = urlEncode(","); + break; + case "ssv": + delimiter = urlEncode(" "); + break; + case "tsv": + delimiter = urlEncode("\t"); + break; + case "pipes": + delimiter = urlEncode("|"); + break; + default: + throw new IllegalArgumentException("Illegal collection format: " + collectionFormat); + } + + StringJoiner joiner = new StringJoiner(delimiter); + for (Object value : values) { + joiner.add(urlEncode(valueToString(value))); + } + + return Collections.singletonList(new Pair(urlEncode(name), joiner.toString())); + } + + /** + * Create an instance of ApiClient. + */ + public ApiClient() { + this.builder = createDefaultHttpClientBuilder(); + this.mapper = createDefaultObjectMapper(); + updateBaseUri(getDefaultBaseUri()); + interceptor = null; + readTimeout = null; + connectTimeout = null; + responseInterceptor = null; + asyncResponseInterceptor = null; + } + + /** + * Create an instance of ApiClient. + * + * @param builder Http client builder. + * @param mapper Object mapper. + * @param baseUri Base URI + */ + public ApiClient(HttpClient.Builder builder, ObjectMapper mapper, String baseUri) { + this.builder = builder; + this.mapper = mapper; + updateBaseUri(baseUri != null ? baseUri : getDefaultBaseUri()); + interceptor = null; + readTimeout = null; + connectTimeout = null; + responseInterceptor = null; + asyncResponseInterceptor = null; + } + + public static ObjectMapper createDefaultObjectMapper() { + ObjectMapper mapper = new ObjectMapper(); + mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false); + mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); + mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); + mapper.disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE); + mapper.registerModule(new JavaTimeModule()); + return mapper; + } + + private String getDefaultBaseUri() { + return "http://localhost:60105"; + } + + public static HttpClient.Builder createDefaultHttpClientBuilder() { + return HttpClient.newBuilder(); + } + + public void updateBaseUri(String baseUri) { + URI uri = URI.create(baseUri); + scheme = uri.getScheme(); + host = uri.getHost(); + port = uri.getPort(); + basePath = uri.getRawPath(); + } + + /** + * Set a custom {@link HttpClient.Builder} object to use when creating the + * {@link HttpClient} that is used by the API client. + * + * @param builder Custom client builder. + * @return This object. + */ + public ApiClient setHttpClientBuilder(HttpClient.Builder builder) { + this.builder = builder; + return this; + } + + /** + * Get an {@link HttpClient} based on the current {@link HttpClient.Builder}. + * + *

The returned object is immutable and thread-safe.

+ * + * @return The HTTP client. + */ + public HttpClient getHttpClient() { + return builder.build(); + } + + /** + * Set a custom {@link ObjectMapper} to serialize and deserialize the request + * and response bodies. + * + * @param mapper Custom object mapper. + * @return This object. + */ + public ApiClient setObjectMapper(ObjectMapper mapper) { + this.mapper = mapper; + return this; + } + + /** + * Get a copy of the current {@link ObjectMapper}. + * + * @return A copy of the current object mapper. + */ + public ObjectMapper getObjectMapper() { + return mapper.copy(); + } + + /** + * Set a custom host name for the target service. + * + * @param host The host name of the target service. + * @return This object. + */ + public ApiClient setHost(String host) { + this.host = host; + return this; + } + + /** + * Set a custom port number for the target service. + * + * @param port The port of the target service. Set this to -1 to reset the + * value to the default for the scheme. + * @return This object. + */ + public ApiClient setPort(int port) { + this.port = port; + return this; + } + + /** + * Set a custom base path for the target service, for example '/v2'. + * + * @param basePath The base path against which the rest of the path is + * resolved. + * @return This object. + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + return this; + } + + /** + * Get the base URI to resolve the endpoint paths against. + * + * @return The complete base URI that the rest of the API parameters are + * resolved against. + */ + public String getBaseUri() { + return scheme + "://" + host + (port == -1 ? "" : ":" + port) + basePath; + } + + /** + * Set a custom scheme for the target service, for example 'https'. + * + * @param scheme The scheme of the target service + * @return This object. + */ + public ApiClient setScheme(String scheme){ + this.scheme = scheme; + return this; + } + + /** + * Set a custom request interceptor. + * + *

A request interceptor is a mechanism for altering each request before it + * is sent. After the request has been fully configured but not yet built, the + * request builder is passed into this function for further modification, + * after which it is sent out.

+ * + *

This is useful for altering the requests in a custom manner, such as + * adding headers. It could also be used for logging and monitoring.

+ * + * @param interceptor A function invoked before creating each request. A value + * of null resets the interceptor to a no-op. + * @return This object. + */ + public ApiClient setRequestInterceptor(Consumer interceptor) { + this.interceptor = interceptor; + return this; + } + + /** + * Get the custom interceptor. + * + * @return The custom interceptor that was set, or null if there isn't any. + */ + public Consumer getRequestInterceptor() { + return interceptor; + } + + /** + * Set a custom response interceptor. + * + *

This is useful for logging, monitoring or extraction of header variables

+ * + * @param interceptor A function invoked before creating each request. A value + * of null resets the interceptor to a no-op. + * @return This object. + */ + public ApiClient setResponseInterceptor(Consumer> interceptor) { + this.responseInterceptor = interceptor; + return this; + } + + /** + * Get the custom response interceptor. + * + * @return The custom interceptor that was set, or null if there isn't any. + */ + public Consumer> getResponseInterceptor() { + return responseInterceptor; + } + + /** + * Set a custom async response interceptor. Use this interceptor when asyncNative is set to 'true'. + * + *

This is useful for logging, monitoring or extraction of header variables

+ * + * @param interceptor A function invoked before creating each request. A value + * of null resets the interceptor to a no-op. + * @return This object. + */ + public ApiClient setAsyncResponseInterceptor(Consumer> interceptor) { + this.asyncResponseInterceptor = interceptor; + return this; + } + + /** + * Get the custom async response interceptor. Use this interceptor when asyncNative is set to 'true'. + * + * @return The custom interceptor that was set, or null if there isn't any. + */ + public Consumer> getAsyncResponseInterceptor() { + return asyncResponseInterceptor; + } + + /** + * Set the read timeout for the http client. + * + *

This is the value used by default for each request, though it can be + * overridden on a per-request basis with a request interceptor.

+ * + * @param readTimeout The read timeout used by default by the http client. + * Setting this value to null resets the timeout to an + * effectively infinite value. + * @return This object. + */ + public ApiClient setReadTimeout(Duration readTimeout) { + this.readTimeout = readTimeout; + return this; + } + + /** + * Get the read timeout that was set. + * + * @return The read timeout, or null if no timeout was set. Null represents + * an infinite wait time. + */ + public Duration getReadTimeout() { + return readTimeout; + } + /** + * Sets the connect timeout (in milliseconds) for the http client. + * + *

In the case where a new connection needs to be established, if + * the connection cannot be established within the given {@code + * duration}, then {@link HttpClient#send(HttpRequest,BodyHandler) + * HttpClient::send} throws an {@link HttpConnectTimeoutException}, or + * {@link HttpClient#sendAsync(HttpRequest,BodyHandler) + * HttpClient::sendAsync} completes exceptionally with an + * {@code HttpConnectTimeoutException}. If a new connection does not + * need to be established, for example if a connection can be reused + * from a previous request, then this timeout duration has no effect. + * + * @param connectTimeout connection timeout in milliseconds + * + * @return This object. + */ + public ApiClient setConnectTimeout(Duration connectTimeout) { + this.connectTimeout = connectTimeout; + this.builder.connectTimeout(connectTimeout); + return this; + } + + /** + * Get connection timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public Duration getConnectTimeout() { + return connectTimeout; + } +} diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/invoker/ApiException.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/invoker/ApiException.java new file mode 100644 index 000000000..1d9f016d5 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/invoker/ApiException.java @@ -0,0 +1,92 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.invoker; + +import java.net.http.HttpHeaders; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class ApiException extends Exception { + private static final long serialVersionUID = 1L; + + private int code = 0; + private HttpHeaders responseHeaders = null; + private String responseBody = null; + + public ApiException() {} + + public ApiException(Throwable throwable) { + super(throwable); + } + + public ApiException(String message) { + super(message); + } + + public ApiException(String message, Throwable throwable, int code, HttpHeaders responseHeaders, String responseBody) { + super(message, throwable); + this.code = code; + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + public ApiException(String message, int code, HttpHeaders responseHeaders, String responseBody) { + this(message, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(String message, Throwable throwable, int code, HttpHeaders responseHeaders) { + this(message, throwable, code, responseHeaders, null); + } + + public ApiException(int code, HttpHeaders responseHeaders, String responseBody) { + this((String) null, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(int code, String message) { + super(message); + this.code = code; + } + + public ApiException(int code, String message, HttpHeaders responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return Headers as an HttpHeaders object + */ + public HttpHeaders getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } +} diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/invoker/ApiResponse.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/invoker/ApiResponse.java new file mode 100644 index 000000000..580ebefb4 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/invoker/ApiResponse.java @@ -0,0 +1,60 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.invoker; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + * + * @param The type of data that is deserialized from response body + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map> headers) { + this(statusCode, headers, null); + } + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map> headers, T data) { + this.statusCode = statusCode; + this.headers = headers; + this.data = data; + } + + public int getStatusCode() { + return statusCode; + } + + public Map> getHeaders() { + return headers; + } + + public T getData() { + return data; + } +} diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/invoker/Configuration.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/invoker/Configuration.java new file mode 100644 index 000000000..68bfe7fc1 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/invoker/Configuration.java @@ -0,0 +1,41 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.invoker; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class Configuration { + public static final String VERSION = "0.1.0"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/invoker/JSON.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/invoker/JSON.java new file mode 100644 index 000000000..0ecf9d137 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/invoker/JSON.java @@ -0,0 +1,261 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.invoker; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.*; +import com.fasterxml.jackson.databind.json.JsonMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import com.github.danielpaulus.goios.generated.model.*; + +import java.text.DateFormat; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class JSON { + private ObjectMapper mapper; + + public JSON() { + mapper = JsonMapper.builder() + .serializationInclusion(JsonInclude.Include.NON_NULL) + .disable(MapperFeature.ALLOW_COERCION_OF_SCALARS) + .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) + .enable(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE) + .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) + .enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING) + .enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING) + .defaultDateFormat(new RFC3339DateFormat()) + .addModule(new JavaTimeModule()) + .build(); + } + + /** + * Set the date format for JSON (de)serialization with Date properties. + * + * @param dateFormat Date format + */ + public void setDateFormat(DateFormat dateFormat) { + mapper.setDateFormat(dateFormat); + } + + /** + * Get the object mapper + * + * @return object mapper + */ + public ObjectMapper getMapper() { return mapper; } + + /** + * Returns the target model class that should be used to deserialize the input data. + * The discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param modelClass The class that contains the discriminator mappings. + * + * @return the target model class. + */ + public static Class getClassForElement(JsonNode node, Class modelClass) { + ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); + if (cdm != null) { + return cdm.getClassForElement(node, new HashSet>()); + } + return null; + } + + /** + * Helper class to register the discriminator mappings. + */ + @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") + private static class ClassDiscriminatorMapping { + // The model class name. + Class modelClass; + // The name of the discriminator property. + String discriminatorName; + // The discriminator mappings for a model class. + Map> discriminatorMappings; + + // Constructs a new class discriminator. + ClassDiscriminatorMapping(Class cls, String propertyName, Map> mappings) { + modelClass = cls; + discriminatorName = propertyName; + discriminatorMappings = new HashMap>(); + if (mappings != null) { + discriminatorMappings.putAll(mappings); + } + } + + // Return the name of the discriminator property for this model class. + String getDiscriminatorPropertyName() { + return discriminatorName; + } + + // Return the discriminator value or null if the discriminator is not + // present in the payload. + String getDiscriminatorValue(JsonNode node) { + // Determine the value of the discriminator property in the input data. + if (discriminatorName != null) { + // Get the value of the discriminator property, if present in the input payload. + node = node.get(discriminatorName); + if (node != null && node.isValueNode()) { + String discrValue = node.asText(); + if (discrValue != null) { + return discrValue; + } + } + } + return null; + } + + /** + * Returns the target model class that should be used to deserialize the input data. + * This function can be invoked for anyOf/oneOf composed models with discriminator mappings. + * The discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param visitedClasses The set of classes that have already been visited. + * + * @return the target model class. + */ + Class getClassForElement(JsonNode node, Set> visitedClasses) { + if (visitedClasses.contains(modelClass)) { + // Class has already been visited. + return null; + } + // Determine the value of the discriminator property in the input data. + String discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + return null; + } + Class cls = discriminatorMappings.get(discrValue); + // It may not be sufficient to return this cls directly because that target class + // may itself be a composed schema, possibly with its own discriminator. + visitedClasses.add(modelClass); + for (Class childClass : discriminatorMappings.values()) { + ClassDiscriminatorMapping childCdm = modelDiscriminators.get(childClass); + if (childCdm == null) { + continue; + } + if (!discriminatorName.equals(childCdm.discriminatorName)) { + discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + continue; + } + } + if (childCdm != null) { + // Recursively traverse the discriminator mappings. + Class childDiscr = childCdm.getClassForElement(node, visitedClasses); + if (childDiscr != null) { + return childDiscr; + } + } + } + return cls; + } + } + + /** + * Returns true if inst is an instance of modelClass in the OpenAPI model hierarchy. + * + * The Java class hierarchy is not implemented the same way as the OpenAPI model hierarchy, + * so it's not possible to use the instanceof keyword. + * + * @param modelClass A OpenAPI model class. + * @param inst The instance object. + * @param visitedClasses The set of classes that have already been visited. + * + * @return true if inst is an instance of modelClass in the OpenAPI model hierarchy. + */ + public static boolean isInstanceOf(Class modelClass, Object inst, Set> visitedClasses) { + if (modelClass.isInstance(inst)) { + // This handles the 'allOf' use case with single parent inheritance. + return true; + } + if (visitedClasses.contains(modelClass)) { + // This is to prevent infinite recursion when the composed schemas have + // a circular dependency. + return false; + } + visitedClasses.add(modelClass); + + // Traverse the oneOf/anyOf composed schemas. + Map> descendants = modelDescendants.get(modelClass); + if (descendants != null) { + for (Class childType : descendants.values()) { + if (isInstanceOf(childType, inst, visitedClasses)) { + return true; + } + } + } + return false; + } + + /** + * A map of discriminators for all model classes. + */ + private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap<>(); + + /** + * A map of oneOf/anyOf descendants for each model class. + */ + private static Map, Map>> modelDescendants = new HashMap<>(); + + /** + * Register a model class discriminator. + * + * @param modelClass the model class + * @param discriminatorPropertyName the name of the discriminator property + * @param mappings a map with the discriminator mappings. + */ + public static void registerDiscriminator(Class modelClass, String discriminatorPropertyName, Map> mappings) { + ClassDiscriminatorMapping m = new ClassDiscriminatorMapping(modelClass, discriminatorPropertyName, mappings); + modelDiscriminators.put(modelClass, m); + } + + /** + * Register the oneOf/anyOf descendants of the modelClass. + * + * @param modelClass the model class + * @param descendants a map of oneOf/anyOf descendants. + */ + public static void registerDescendants(Class modelClass, Map> descendants) { + modelDescendants.put(modelClass, descendants); + } + + private static JSON json; + + static { + json = new JSON(); + } + + /** + * Get the default JSON instance. + * + * @return the default JSON instance + */ + public static JSON getDefault() { + return json; + } + + /** + * Set the default JSON instance. + * + * @param json JSON instance to be used + */ + public static void setDefault(JSON json) { + JSON.json = json; + } +} diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/invoker/Pair.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/invoker/Pair.java new file mode 100644 index 000000000..716f58510 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/invoker/Pair.java @@ -0,0 +1,57 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.invoker; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/invoker/RFC3339DateFormat.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/invoker/RFC3339DateFormat.java new file mode 100644 index 000000000..ca8be0aef --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/invoker/RFC3339DateFormat.java @@ -0,0 +1,58 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.github.danielpaulus.goios.generated.invoker; + +import com.fasterxml.jackson.databind.util.StdDateFormat; + +import java.text.DateFormat; +import java.text.FieldPosition; +import java.text.ParsePosition; +import java.util.Date; +import java.text.DecimalFormat; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class RFC3339DateFormat extends DateFormat { + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + + private final StdDateFormat fmt = new StdDateFormat() + .withTimeZone(TIMEZONE_Z) + .withColonInTimeZone(true); + + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + this.numberFormat = new DecimalFormat(); + } + + @Override + public Date parse(String source) { + return parse(source, new ParsePosition(0)); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } + + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } + + @Override + public Object clone() { + return super.clone(); + } +} diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/invoker/ServerConfiguration.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/invoker/ServerConfiguration.java new file mode 100644 index 000000000..6a58f62ca --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/invoker/ServerConfiguration.java @@ -0,0 +1,72 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.invoker; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/invoker/ServerVariable.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/invoker/ServerVariable.java new file mode 100644 index 000000000..bcae69ed0 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/invoker/ServerVariable.java @@ -0,0 +1,37 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.invoker; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/AXEnabledRequest.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/AXEnabledRequest.java new file mode 100644 index 000000000..5e4ecb645 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/AXEnabledRequest.java @@ -0,0 +1,151 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * Body for the accessibility toggle PUTs (`/voiceover`, `/zoom`). The desired state may also be supplied as an `enabled` query param; a parseable body wins. + */ +@JsonPropertyOrder({ + AXEnabledRequest.JSON_PROPERTY_ENABLED +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class AXEnabledRequest { + public static final String JSON_PROPERTY_ENABLED = "enabled"; + @jakarta.annotation.Nonnull + private Boolean enabled; + + public AXEnabledRequest() { + } + + public AXEnabledRequest enabled(@jakarta.annotation.Nonnull Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get enabled + * @return enabled + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getEnabled() { + return enabled; + } + + + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEnabled(@jakarta.annotation.Nonnull Boolean enabled) { + this.enabled = enabled; + } + + + /** + * Return true if this AXEnabledRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AXEnabledRequest axEnabledRequest = (AXEnabledRequest) o; + return Objects.equals(this.enabled, axEnabledRequest.enabled); + } + + @Override + public int hashCode() { + return Objects.hash(enabled); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AXEnabledRequest {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `enabled` to the URL query string + if (getEnabled() != null) { + joiner.add(String.format("%senabled%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getEnabled()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/AbstractOpenApiSchema.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/AbstractOpenApiSchema.java new file mode 100644 index 000000000..b5f106513 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/AbstractOpenApiSchema.java @@ -0,0 +1,147 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map> getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + @JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/AgentShutdown.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/AgentShutdown.java new file mode 100644 index 000000000..03a44ec03 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/AgentShutdown.java @@ -0,0 +1,151 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `POST /tunnel-agent/shutdown` — acknowledgement. + */ +@JsonPropertyOrder({ + AgentShutdown.JSON_PROPERTY_STATUS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class AgentShutdown { + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nonnull + private String status; + + public AgentShutdown() { + } + + public AgentShutdown status(@jakarta.annotation.Nonnull String status) { + this.status = status; + return this; + } + + /** + * Always `agent shutdown requested`. + * @return status + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(@jakarta.annotation.Nonnull String status) { + this.status = status; + } + + + /** + * Return true if this AgentShutdown object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AgentShutdown agentShutdown = (AgentShutdown) o; + return Objects.equals(this.status, agentShutdown.status); + } + + @Override + public int hashCode() { + return Objects.hash(status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AgentShutdown {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getStatus()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/AppInfo.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/AppInfo.java new file mode 100644 index 000000000..4ca1cd9c8 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/AppInfo.java @@ -0,0 +1,331 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * Installed application metadata. This is an open map: keys come straight from the app's Info.plist. Common keys are surfaced for discoverability but any additional keys may be present. + */ +@JsonPropertyOrder({ + AppInfo.JSON_PROPERTY_CF_BUNDLE_IDENTIFIER, + AppInfo.JSON_PROPERTY_CF_BUNDLE_EXECUTABLE, + AppInfo.JSON_PROPERTY_CF_BUNDLE_NAME, + AppInfo.JSON_PROPERTY_CF_BUNDLE_SHORT_VERSION_STRING, + AppInfo.JSON_PROPERTY_PATH, + AppInfo.JSON_PROPERTY_UI_FILE_SHARING_ENABLED +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class AppInfo { + public static final String JSON_PROPERTY_CF_BUNDLE_IDENTIFIER = "CFBundleIdentifier"; + @jakarta.annotation.Nullable + private String cfBundleIdentifier; + + public static final String JSON_PROPERTY_CF_BUNDLE_EXECUTABLE = "CFBundleExecutable"; + @jakarta.annotation.Nullable + private String cfBundleExecutable; + + public static final String JSON_PROPERTY_CF_BUNDLE_NAME = "CFBundleName"; + @jakarta.annotation.Nullable + private String cfBundleName; + + public static final String JSON_PROPERTY_CF_BUNDLE_SHORT_VERSION_STRING = "CFBundleShortVersionString"; + @jakarta.annotation.Nullable + private String cfBundleShortVersionString; + + public static final String JSON_PROPERTY_PATH = "Path"; + @jakarta.annotation.Nullable + private String path; + + public static final String JSON_PROPERTY_UI_FILE_SHARING_ENABLED = "UIFileSharingEnabled"; + @jakarta.annotation.Nullable + private Boolean uiFileSharingEnabled; + + public AppInfo() { + } + + public AppInfo cfBundleIdentifier(@jakarta.annotation.Nullable String cfBundleIdentifier) { + this.cfBundleIdentifier = cfBundleIdentifier; + return this; + } + + /** + * Get cfBundleIdentifier + * @return cfBundleIdentifier + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CF_BUNDLE_IDENTIFIER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCfBundleIdentifier() { + return cfBundleIdentifier; + } + + + @JsonProperty(JSON_PROPERTY_CF_BUNDLE_IDENTIFIER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCfBundleIdentifier(@jakarta.annotation.Nullable String cfBundleIdentifier) { + this.cfBundleIdentifier = cfBundleIdentifier; + } + + + public AppInfo cfBundleExecutable(@jakarta.annotation.Nullable String cfBundleExecutable) { + this.cfBundleExecutable = cfBundleExecutable; + return this; + } + + /** + * Get cfBundleExecutable + * @return cfBundleExecutable + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CF_BUNDLE_EXECUTABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCfBundleExecutable() { + return cfBundleExecutable; + } + + + @JsonProperty(JSON_PROPERTY_CF_BUNDLE_EXECUTABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCfBundleExecutable(@jakarta.annotation.Nullable String cfBundleExecutable) { + this.cfBundleExecutable = cfBundleExecutable; + } + + + public AppInfo cfBundleName(@jakarta.annotation.Nullable String cfBundleName) { + this.cfBundleName = cfBundleName; + return this; + } + + /** + * Get cfBundleName + * @return cfBundleName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CF_BUNDLE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCfBundleName() { + return cfBundleName; + } + + + @JsonProperty(JSON_PROPERTY_CF_BUNDLE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCfBundleName(@jakarta.annotation.Nullable String cfBundleName) { + this.cfBundleName = cfBundleName; + } + + + public AppInfo cfBundleShortVersionString(@jakarta.annotation.Nullable String cfBundleShortVersionString) { + this.cfBundleShortVersionString = cfBundleShortVersionString; + return this; + } + + /** + * Get cfBundleShortVersionString + * @return cfBundleShortVersionString + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CF_BUNDLE_SHORT_VERSION_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCfBundleShortVersionString() { + return cfBundleShortVersionString; + } + + + @JsonProperty(JSON_PROPERTY_CF_BUNDLE_SHORT_VERSION_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCfBundleShortVersionString(@jakarta.annotation.Nullable String cfBundleShortVersionString) { + this.cfBundleShortVersionString = cfBundleShortVersionString; + } + + + public AppInfo path(@jakarta.annotation.Nullable String path) { + this.path = path; + return this; + } + + /** + * Get path + * @return path + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@jakarta.annotation.Nullable String path) { + this.path = path; + } + + + public AppInfo uiFileSharingEnabled(@jakarta.annotation.Nullable Boolean uiFileSharingEnabled) { + this.uiFileSharingEnabled = uiFileSharingEnabled; + return this; + } + + /** + * Get uiFileSharingEnabled + * @return uiFileSharingEnabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UI_FILE_SHARING_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getUiFileSharingEnabled() { + return uiFileSharingEnabled; + } + + + @JsonProperty(JSON_PROPERTY_UI_FILE_SHARING_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUiFileSharingEnabled(@jakarta.annotation.Nullable Boolean uiFileSharingEnabled) { + this.uiFileSharingEnabled = uiFileSharingEnabled; + } + + + /** + * Return true if this AppInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AppInfo appInfo = (AppInfo) o; + return Objects.equals(this.cfBundleIdentifier, appInfo.cfBundleIdentifier) && + Objects.equals(this.cfBundleExecutable, appInfo.cfBundleExecutable) && + Objects.equals(this.cfBundleName, appInfo.cfBundleName) && + Objects.equals(this.cfBundleShortVersionString, appInfo.cfBundleShortVersionString) && + Objects.equals(this.path, appInfo.path) && + Objects.equals(this.uiFileSharingEnabled, appInfo.uiFileSharingEnabled); + } + + @Override + public int hashCode() { + return Objects.hash(cfBundleIdentifier, cfBundleExecutable, cfBundleName, cfBundleShortVersionString, path, uiFileSharingEnabled); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AppInfo {\n"); + sb.append(" cfBundleIdentifier: ").append(toIndentedString(cfBundleIdentifier)).append("\n"); + sb.append(" cfBundleExecutable: ").append(toIndentedString(cfBundleExecutable)).append("\n"); + sb.append(" cfBundleName: ").append(toIndentedString(cfBundleName)).append("\n"); + sb.append(" cfBundleShortVersionString: ").append(toIndentedString(cfBundleShortVersionString)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" uiFileSharingEnabled: ").append(toIndentedString(uiFileSharingEnabled)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `CFBundleIdentifier` to the URL query string + if (getCfBundleIdentifier() != null) { + joiner.add(String.format("%sCFBundleIdentifier%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getCfBundleIdentifier()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `CFBundleExecutable` to the URL query string + if (getCfBundleExecutable() != null) { + joiner.add(String.format("%sCFBundleExecutable%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getCfBundleExecutable()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `CFBundleName` to the URL query string + if (getCfBundleName() != null) { + joiner.add(String.format("%sCFBundleName%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getCfBundleName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `CFBundleShortVersionString` to the URL query string + if (getCfBundleShortVersionString() != null) { + joiner.add(String.format("%sCFBundleShortVersionString%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getCfBundleShortVersionString()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `Path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%sPath%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPath()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `UIFileSharingEnabled` to the URL query string + if (getUiFileSharingEnabled() != null) { + joiner.add(String.format("%sUIFileSharingEnabled%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getUiFileSharingEnabled()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/AppStateNotification.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/AppStateNotification.java new file mode 100644 index 000000000..1eb1a781f --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/AppStateNotification.java @@ -0,0 +1,223 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * An app foreground/background/lifecycle state change. + */ +@JsonPropertyOrder({ + AppStateNotification.JSON_PROPERTY_BUNDLE_ID, + AppStateNotification.JSON_PROPERTY_STATE, + AppStateNotification.JSON_PROPERTY_TIMESTAMP +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class AppStateNotification { + public static final String JSON_PROPERTY_BUNDLE_ID = "bundleId"; + @jakarta.annotation.Nonnull + private String bundleId; + + public static final String JSON_PROPERTY_STATE = "state"; + @jakarta.annotation.Nonnull + private String state; + + public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; + @jakarta.annotation.Nullable + private Long timestamp; + + public AppStateNotification() { + } + + public AppStateNotification bundleId(@jakarta.annotation.Nonnull String bundleId) { + this.bundleId = bundleId; + return this; + } + + /** + * Bundle id of the app whose state changed. + * @return bundleId + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_BUNDLE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getBundleId() { + return bundleId; + } + + + @JsonProperty(JSON_PROPERTY_BUNDLE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setBundleId(@jakarta.annotation.Nonnull String bundleId) { + this.bundleId = bundleId; + } + + + public AppStateNotification state(@jakarta.annotation.Nonnull String state) { + this.state = state; + return this; + } + + /** + * New application state. Typical values: `foreground`, `background`, `suspended`, `terminated`, `unknown`. + * @return state + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getState() { + return state; + } + + + @JsonProperty(JSON_PROPERTY_STATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setState(@jakarta.annotation.Nonnull String state) { + this.state = state; + } + + + public AppStateNotification timestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Unix epoch milliseconds when the change was observed. + * @return timestamp + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TIMESTAMP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTimestamp() { + return timestamp; + } + + + @JsonProperty(JSON_PROPERTY_TIMESTAMP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTimestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + } + + + /** + * Return true if this AppStateNotification object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AppStateNotification appStateNotification = (AppStateNotification) o; + return Objects.equals(this.bundleId, appStateNotification.bundleId) && + Objects.equals(this.state, appStateNotification.state) && + Objects.equals(this.timestamp, appStateNotification.timestamp); + } + + @Override + public int hashCode() { + return Objects.hash(bundleId, state, timestamp); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AppStateNotification {\n"); + sb.append(" bundleId: ").append(toIndentedString(bundleId)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `bundleId` to the URL query string + if (getBundleId() != null) { + joiner.add(String.format("%sbundleId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getBundleId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `state` to the URL query string + if (getState() != null) { + joiner.add(String.format("%sstate%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getState()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `timestamp` to the URL query string + if (getTimestamp() != null) { + joiner.add(String.format("%stimestamp%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getTimestamp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/AssistiveTouchState.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/AssistiveTouchState.java new file mode 100644 index 000000000..1d1538564 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/AssistiveTouchState.java @@ -0,0 +1,151 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `GET /device/{udid}/assistivetouch` — AssistiveTouch state. + */ +@JsonPropertyOrder({ + AssistiveTouchState.JSON_PROPERTY_ASSISTIVE_TOUCH_ENABLED +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class AssistiveTouchState { + public static final String JSON_PROPERTY_ASSISTIVE_TOUCH_ENABLED = "AssistiveTouchEnabled"; + @jakarta.annotation.Nonnull + private Boolean assistiveTouchEnabled; + + public AssistiveTouchState() { + } + + public AssistiveTouchState assistiveTouchEnabled(@jakarta.annotation.Nonnull Boolean assistiveTouchEnabled) { + this.assistiveTouchEnabled = assistiveTouchEnabled; + return this; + } + + /** + * Get assistiveTouchEnabled + * @return assistiveTouchEnabled + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ASSISTIVE_TOUCH_ENABLED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getAssistiveTouchEnabled() { + return assistiveTouchEnabled; + } + + + @JsonProperty(JSON_PROPERTY_ASSISTIVE_TOUCH_ENABLED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAssistiveTouchEnabled(@jakarta.annotation.Nonnull Boolean assistiveTouchEnabled) { + this.assistiveTouchEnabled = assistiveTouchEnabled; + } + + + /** + * Return true if this AssistiveTouchState object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AssistiveTouchState assistiveTouchState = (AssistiveTouchState) o; + return Objects.equals(this.assistiveTouchEnabled, assistiveTouchState.assistiveTouchEnabled); + } + + @Override + public int hashCode() { + return Objects.hash(assistiveTouchEnabled); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AssistiveTouchState {\n"); + sb.append(" assistiveTouchEnabled: ").append(toIndentedString(assistiveTouchEnabled)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `AssistiveTouchEnabled` to the URL query string + if (getAssistiveTouchEnabled() != null) { + joiner.add(String.format("%sAssistiveTouchEnabled%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getAssistiveTouchEnabled()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/AttachDetachEvent.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/AttachDetachEvent.java new file mode 100644 index 000000000..c42edb45d --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/AttachDetachEvent.java @@ -0,0 +1,260 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.github.danielpaulus.goios.generated.model.DeviceProperties; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * A device was attached to or detached from the host. + */ +@JsonPropertyOrder({ + AttachDetachEvent.JSON_PROPERTY_EVENT, + AttachDetachEvent.JSON_PROPERTY_DEVICE_I_D, + AttachDetachEvent.JSON_PROPERTY_UDID, + AttachDetachEvent.JSON_PROPERTY_PROPERTIES +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class AttachDetachEvent { + public static final String JSON_PROPERTY_EVENT = "event"; + @jakarta.annotation.Nonnull + private String event; + + public static final String JSON_PROPERTY_DEVICE_I_D = "deviceID"; + @jakarta.annotation.Nullable + private Integer deviceID; + + public static final String JSON_PROPERTY_UDID = "udid"; + @jakarta.annotation.Nullable + private String udid; + + public static final String JSON_PROPERTY_PROPERTIES = "properties"; + @jakarta.annotation.Nullable + private DeviceProperties properties; + + public AttachDetachEvent() { + } + + public AttachDetachEvent event(@jakarta.annotation.Nonnull String event) { + this.event = event; + return this; + } + + /** + * Event kind. `attached` when a device connects, `detached` when it disconnects, `paired` when a pairing record appears. + * @return event + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EVENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getEvent() { + return event; + } + + + @JsonProperty(JSON_PROPERTY_EVENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEvent(@jakarta.annotation.Nonnull String event) { + this.event = event; + } + + + public AttachDetachEvent deviceID(@jakarta.annotation.Nullable Integer deviceID) { + this.deviceID = deviceID; + return this; + } + + /** + * usbmuxd device id. + * @return deviceID + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEVICE_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getDeviceID() { + return deviceID; + } + + + @JsonProperty(JSON_PROPERTY_DEVICE_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceID(@jakarta.annotation.Nullable Integer deviceID) { + this.deviceID = deviceID; + } + + + public AttachDetachEvent udid(@jakarta.annotation.Nullable String udid) { + this.udid = udid; + return this; + } + + /** + * The device udid (serial number), when known. + * @return udid + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UDID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUdid() { + return udid; + } + + + @JsonProperty(JSON_PROPERTY_UDID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUdid(@jakarta.annotation.Nullable String udid) { + this.udid = udid; + } + + + public AttachDetachEvent properties(@jakarta.annotation.Nullable DeviceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Full device properties, present on `attached`. + * @return properties + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeviceProperties getProperties() { + return properties; + } + + + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProperties(@jakarta.annotation.Nullable DeviceProperties properties) { + this.properties = properties; + } + + + /** + * Return true if this AttachDetachEvent object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AttachDetachEvent attachDetachEvent = (AttachDetachEvent) o; + return Objects.equals(this.event, attachDetachEvent.event) && + Objects.equals(this.deviceID, attachDetachEvent.deviceID) && + Objects.equals(this.udid, attachDetachEvent.udid) && + Objects.equals(this.properties, attachDetachEvent.properties); + } + + @Override + public int hashCode() { + return Objects.hash(event, deviceID, udid, properties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AttachDetachEvent {\n"); + sb.append(" event: ").append(toIndentedString(event)).append("\n"); + sb.append(" deviceID: ").append(toIndentedString(deviceID)).append("\n"); + sb.append(" udid: ").append(toIndentedString(udid)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `event` to the URL query string + if (getEvent() != null) { + joiner.add(String.format("%sevent%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getEvent()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `deviceID` to the URL query string + if (getDeviceID() != null) { + joiner.add(String.format("%sdeviceID%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getDeviceID()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `udid` to the URL query string + if (getUdid() != null) { + joiner.add(String.format("%sudid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getUdid()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `properties` to the URL query string + if (getProperties() != null) { + joiner.add(getProperties().toUrlQueryString(prefix + "properties" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/BatteryInfo.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/BatteryInfo.java new file mode 100644 index 000000000..0376e259c --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/BatteryInfo.java @@ -0,0 +1,295 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `GET /device/{udid}/battery` — battery diagnostics (`ios.BatteryInfo`). Open map; commonly-present keys are surfaced for discoverability. + */ +@JsonPropertyOrder({ + BatteryInfo.JSON_PROPERTY_CURRENT_CAPACITY, + BatteryInfo.JSON_PROPERTY_EXTERNAL_CONNECTED, + BatteryInfo.JSON_PROPERTY_FULLY_CHARGED, + BatteryInfo.JSON_PROPERTY_IS_CHARGING, + BatteryInfo.JSON_PROPERTY_TEMPERATURE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class BatteryInfo { + public static final String JSON_PROPERTY_CURRENT_CAPACITY = "CurrentCapacity"; + @jakarta.annotation.Nullable + private Integer currentCapacity; + + public static final String JSON_PROPERTY_EXTERNAL_CONNECTED = "ExternalConnected"; + @jakarta.annotation.Nullable + private Boolean externalConnected; + + public static final String JSON_PROPERTY_FULLY_CHARGED = "FullyCharged"; + @jakarta.annotation.Nullable + private Boolean fullyCharged; + + public static final String JSON_PROPERTY_IS_CHARGING = "IsCharging"; + @jakarta.annotation.Nullable + private Boolean isCharging; + + public static final String JSON_PROPERTY_TEMPERATURE = "Temperature"; + @jakarta.annotation.Nullable + private Integer temperature; + + public BatteryInfo() { + } + + public BatteryInfo currentCapacity(@jakarta.annotation.Nullable Integer currentCapacity) { + this.currentCapacity = currentCapacity; + return this; + } + + /** + * Get currentCapacity + * @return currentCapacity + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CURRENT_CAPACITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCurrentCapacity() { + return currentCapacity; + } + + + @JsonProperty(JSON_PROPERTY_CURRENT_CAPACITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrentCapacity(@jakarta.annotation.Nullable Integer currentCapacity) { + this.currentCapacity = currentCapacity; + } + + + public BatteryInfo externalConnected(@jakarta.annotation.Nullable Boolean externalConnected) { + this.externalConnected = externalConnected; + return this; + } + + /** + * Get externalConnected + * @return externalConnected + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXTERNAL_CONNECTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getExternalConnected() { + return externalConnected; + } + + + @JsonProperty(JSON_PROPERTY_EXTERNAL_CONNECTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExternalConnected(@jakarta.annotation.Nullable Boolean externalConnected) { + this.externalConnected = externalConnected; + } + + + public BatteryInfo fullyCharged(@jakarta.annotation.Nullable Boolean fullyCharged) { + this.fullyCharged = fullyCharged; + return this; + } + + /** + * Get fullyCharged + * @return fullyCharged + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FULLY_CHARGED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getFullyCharged() { + return fullyCharged; + } + + + @JsonProperty(JSON_PROPERTY_FULLY_CHARGED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFullyCharged(@jakarta.annotation.Nullable Boolean fullyCharged) { + this.fullyCharged = fullyCharged; + } + + + public BatteryInfo isCharging(@jakarta.annotation.Nullable Boolean isCharging) { + this.isCharging = isCharging; + return this; + } + + /** + * Get isCharging + * @return isCharging + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_CHARGING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsCharging() { + return isCharging; + } + + + @JsonProperty(JSON_PROPERTY_IS_CHARGING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsCharging(@jakarta.annotation.Nullable Boolean isCharging) { + this.isCharging = isCharging; + } + + + public BatteryInfo temperature(@jakarta.annotation.Nullable Integer temperature) { + this.temperature = temperature; + return this; + } + + /** + * Get temperature + * @return temperature + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEMPERATURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTemperature() { + return temperature; + } + + + @JsonProperty(JSON_PROPERTY_TEMPERATURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemperature(@jakarta.annotation.Nullable Integer temperature) { + this.temperature = temperature; + } + + + /** + * Return true if this BatteryInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BatteryInfo batteryInfo = (BatteryInfo) o; + return Objects.equals(this.currentCapacity, batteryInfo.currentCapacity) && + Objects.equals(this.externalConnected, batteryInfo.externalConnected) && + Objects.equals(this.fullyCharged, batteryInfo.fullyCharged) && + Objects.equals(this.isCharging, batteryInfo.isCharging) && + Objects.equals(this.temperature, batteryInfo.temperature); + } + + @Override + public int hashCode() { + return Objects.hash(currentCapacity, externalConnected, fullyCharged, isCharging, temperature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BatteryInfo {\n"); + sb.append(" currentCapacity: ").append(toIndentedString(currentCapacity)).append("\n"); + sb.append(" externalConnected: ").append(toIndentedString(externalConnected)).append("\n"); + sb.append(" fullyCharged: ").append(toIndentedString(fullyCharged)).append("\n"); + sb.append(" isCharging: ").append(toIndentedString(isCharging)).append("\n"); + sb.append(" temperature: ").append(toIndentedString(temperature)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `CurrentCapacity` to the URL query string + if (getCurrentCapacity() != null) { + joiner.add(String.format("%sCurrentCapacity%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getCurrentCapacity()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `ExternalConnected` to the URL query string + if (getExternalConnected() != null) { + joiner.add(String.format("%sExternalConnected%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getExternalConnected()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `FullyCharged` to the URL query string + if (getFullyCharged() != null) { + joiner.add(String.format("%sFullyCharged%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getFullyCharged()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `IsCharging` to the URL query string + if (getIsCharging() != null) { + joiner.add(String.format("%sIsCharging%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getIsCharging()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `Temperature` to the URL query string + if (getTemperature() != null) { + joiner.add(String.format("%sTemperature%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getTemperature()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/BatteryRegistry.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/BatteryRegistry.java new file mode 100644 index 000000000..94b84f0ac --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/BatteryRegistry.java @@ -0,0 +1,331 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `GET /device/{udid}/battery/registry` — battery IORegistry stats (`diagnostics.IORegistry`). Open map; common keys surfaced. + */ +@JsonPropertyOrder({ + BatteryRegistry.JSON_PROPERTY_TEMPERATURE, + BatteryRegistry.JSON_PROPERTY_VOLTAGE, + BatteryRegistry.JSON_PROPERTY_CURRENT_CAPACITY, + BatteryRegistry.JSON_PROPERTY_INSTANT_AMPERAGE, + BatteryRegistry.JSON_PROPERTY_IS_CHARGING, + BatteryRegistry.JSON_PROPERTY_FULLY_CHARGED +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class BatteryRegistry { + public static final String JSON_PROPERTY_TEMPERATURE = "Temperature"; + @jakarta.annotation.Nullable + private Integer temperature; + + public static final String JSON_PROPERTY_VOLTAGE = "Voltage"; + @jakarta.annotation.Nullable + private Integer voltage; + + public static final String JSON_PROPERTY_CURRENT_CAPACITY = "CurrentCapacity"; + @jakarta.annotation.Nullable + private Integer currentCapacity; + + public static final String JSON_PROPERTY_INSTANT_AMPERAGE = "InstantAmperage"; + @jakarta.annotation.Nullable + private Long instantAmperage; + + public static final String JSON_PROPERTY_IS_CHARGING = "IsCharging"; + @jakarta.annotation.Nullable + private Boolean isCharging; + + public static final String JSON_PROPERTY_FULLY_CHARGED = "FullyCharged"; + @jakarta.annotation.Nullable + private Boolean fullyCharged; + + public BatteryRegistry() { + } + + public BatteryRegistry temperature(@jakarta.annotation.Nullable Integer temperature) { + this.temperature = temperature; + return this; + } + + /** + * Get temperature + * @return temperature + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEMPERATURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTemperature() { + return temperature; + } + + + @JsonProperty(JSON_PROPERTY_TEMPERATURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemperature(@jakarta.annotation.Nullable Integer temperature) { + this.temperature = temperature; + } + + + public BatteryRegistry voltage(@jakarta.annotation.Nullable Integer voltage) { + this.voltage = voltage; + return this; + } + + /** + * Get voltage + * @return voltage + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VOLTAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getVoltage() { + return voltage; + } + + + @JsonProperty(JSON_PROPERTY_VOLTAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVoltage(@jakarta.annotation.Nullable Integer voltage) { + this.voltage = voltage; + } + + + public BatteryRegistry currentCapacity(@jakarta.annotation.Nullable Integer currentCapacity) { + this.currentCapacity = currentCapacity; + return this; + } + + /** + * Get currentCapacity + * @return currentCapacity + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CURRENT_CAPACITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCurrentCapacity() { + return currentCapacity; + } + + + @JsonProperty(JSON_PROPERTY_CURRENT_CAPACITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrentCapacity(@jakarta.annotation.Nullable Integer currentCapacity) { + this.currentCapacity = currentCapacity; + } + + + public BatteryRegistry instantAmperage(@jakarta.annotation.Nullable Long instantAmperage) { + this.instantAmperage = instantAmperage; + return this; + } + + /** + * Get instantAmperage + * @return instantAmperage + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INSTANT_AMPERAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getInstantAmperage() { + return instantAmperage; + } + + + @JsonProperty(JSON_PROPERTY_INSTANT_AMPERAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInstantAmperage(@jakarta.annotation.Nullable Long instantAmperage) { + this.instantAmperage = instantAmperage; + } + + + public BatteryRegistry isCharging(@jakarta.annotation.Nullable Boolean isCharging) { + this.isCharging = isCharging; + return this; + } + + /** + * Get isCharging + * @return isCharging + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_CHARGING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsCharging() { + return isCharging; + } + + + @JsonProperty(JSON_PROPERTY_IS_CHARGING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsCharging(@jakarta.annotation.Nullable Boolean isCharging) { + this.isCharging = isCharging; + } + + + public BatteryRegistry fullyCharged(@jakarta.annotation.Nullable Boolean fullyCharged) { + this.fullyCharged = fullyCharged; + return this; + } + + /** + * Get fullyCharged + * @return fullyCharged + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FULLY_CHARGED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getFullyCharged() { + return fullyCharged; + } + + + @JsonProperty(JSON_PROPERTY_FULLY_CHARGED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFullyCharged(@jakarta.annotation.Nullable Boolean fullyCharged) { + this.fullyCharged = fullyCharged; + } + + + /** + * Return true if this BatteryRegistry object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BatteryRegistry batteryRegistry = (BatteryRegistry) o; + return Objects.equals(this.temperature, batteryRegistry.temperature) && + Objects.equals(this.voltage, batteryRegistry.voltage) && + Objects.equals(this.currentCapacity, batteryRegistry.currentCapacity) && + Objects.equals(this.instantAmperage, batteryRegistry.instantAmperage) && + Objects.equals(this.isCharging, batteryRegistry.isCharging) && + Objects.equals(this.fullyCharged, batteryRegistry.fullyCharged); + } + + @Override + public int hashCode() { + return Objects.hash(temperature, voltage, currentCapacity, instantAmperage, isCharging, fullyCharged); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BatteryRegistry {\n"); + sb.append(" temperature: ").append(toIndentedString(temperature)).append("\n"); + sb.append(" voltage: ").append(toIndentedString(voltage)).append("\n"); + sb.append(" currentCapacity: ").append(toIndentedString(currentCapacity)).append("\n"); + sb.append(" instantAmperage: ").append(toIndentedString(instantAmperage)).append("\n"); + sb.append(" isCharging: ").append(toIndentedString(isCharging)).append("\n"); + sb.append(" fullyCharged: ").append(toIndentedString(fullyCharged)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Temperature` to the URL query string + if (getTemperature() != null) { + joiner.add(String.format("%sTemperature%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getTemperature()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `Voltage` to the URL query string + if (getVoltage() != null) { + joiner.add(String.format("%sVoltage%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getVoltage()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `CurrentCapacity` to the URL query string + if (getCurrentCapacity() != null) { + joiner.add(String.format("%sCurrentCapacity%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getCurrentCapacity()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `InstantAmperage` to the URL query string + if (getInstantAmperage() != null) { + joiner.add(String.format("%sInstantAmperage%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getInstantAmperage()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `IsCharging` to the URL query string + if (getIsCharging() != null) { + joiner.add(String.format("%sIsCharging%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getIsCharging()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `FullyCharged` to the URL query string + if (getFullyCharged() != null) { + joiner.add(String.format("%sFullyCharged%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getFullyCharged()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/CpuUsageSample.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/CpuUsageSample.java new file mode 100644 index 000000000..51ba712e6 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/CpuUsageSample.java @@ -0,0 +1,223 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * A single sysmontap CPU-usage sample. Open map; sampler keys vary by OS. + */ +@JsonPropertyOrder({ + CpuUsageSample.JSON_PROPERTY_CP_U_TOTAL_LOAD, + CpuUsageSample.JSON_PROPERTY_SYSTEM_LOAD, + CpuUsageSample.JSON_PROPERTY_USER_LOAD +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class CpuUsageSample { + public static final String JSON_PROPERTY_CP_U_TOTAL_LOAD = "CPU_TotalLoad"; + @jakarta.annotation.Nullable + private Double cpUTotalLoad; + + public static final String JSON_PROPERTY_SYSTEM_LOAD = "SystemLoad"; + @jakarta.annotation.Nullable + private Double systemLoad; + + public static final String JSON_PROPERTY_USER_LOAD = "UserLoad"; + @jakarta.annotation.Nullable + private Double userLoad; + + public CpuUsageSample() { + } + + public CpuUsageSample cpUTotalLoad(@jakarta.annotation.Nullable Double cpUTotalLoad) { + this.cpUTotalLoad = cpUTotalLoad; + return this; + } + + /** + * Total CPU load across all cores (0–100). + * @return cpUTotalLoad + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CP_U_TOTAL_LOAD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getCpUTotalLoad() { + return cpUTotalLoad; + } + + + @JsonProperty(JSON_PROPERTY_CP_U_TOTAL_LOAD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCpUTotalLoad(@jakarta.annotation.Nullable Double cpUTotalLoad) { + this.cpUTotalLoad = cpUTotalLoad; + } + + + public CpuUsageSample systemLoad(@jakarta.annotation.Nullable Double systemLoad) { + this.systemLoad = systemLoad; + return this; + } + + /** + * System (kernel) CPU load. + * @return systemLoad + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SYSTEM_LOAD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getSystemLoad() { + return systemLoad; + } + + + @JsonProperty(JSON_PROPERTY_SYSTEM_LOAD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSystemLoad(@jakarta.annotation.Nullable Double systemLoad) { + this.systemLoad = systemLoad; + } + + + public CpuUsageSample userLoad(@jakarta.annotation.Nullable Double userLoad) { + this.userLoad = userLoad; + return this; + } + + /** + * User CPU load. + * @return userLoad + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USER_LOAD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getUserLoad() { + return userLoad; + } + + + @JsonProperty(JSON_PROPERTY_USER_LOAD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserLoad(@jakarta.annotation.Nullable Double userLoad) { + this.userLoad = userLoad; + } + + + /** + * Return true if this CpuUsageSample object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CpuUsageSample cpuUsageSample = (CpuUsageSample) o; + return Objects.equals(this.cpUTotalLoad, cpuUsageSample.cpUTotalLoad) && + Objects.equals(this.systemLoad, cpuUsageSample.systemLoad) && + Objects.equals(this.userLoad, cpuUsageSample.userLoad); + } + + @Override + public int hashCode() { + return Objects.hash(cpUTotalLoad, systemLoad, userLoad); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CpuUsageSample {\n"); + sb.append(" cpUTotalLoad: ").append(toIndentedString(cpUTotalLoad)).append("\n"); + sb.append(" systemLoad: ").append(toIndentedString(systemLoad)).append("\n"); + sb.append(" userLoad: ").append(toIndentedString(userLoad)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `CPU_TotalLoad` to the URL query string + if (getCpUTotalLoad() != null) { + joiner.add(String.format("%sCPU_TotalLoad%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getCpUTotalLoad()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `SystemLoad` to the URL query string + if (getSystemLoad() != null) { + joiner.add(String.format("%sSystemLoad%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSystemLoad()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `UserLoad` to the URL query string + if (getUserLoad() != null) { + joiner.add(String.format("%sUserLoad%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getUserLoad()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/CrashListing.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/CrashListing.java new file mode 100644 index 000000000..5c2ef4415 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/CrashListing.java @@ -0,0 +1,201 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `GET /device/{udid}/crashes` — crash report names. + */ +@JsonPropertyOrder({ + CrashListing.JSON_PROPERTY_FILES, + CrashListing.JSON_PROPERTY_COUNT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class CrashListing { + public static final String JSON_PROPERTY_FILES = "files"; + @jakarta.annotation.Nonnull + private List files = new ArrayList<>(); + + public static final String JSON_PROPERTY_COUNT = "count"; + @jakarta.annotation.Nonnull + private Integer count; + + public CrashListing() { + } + + public CrashListing files(@jakarta.annotation.Nonnull List files) { + this.files = files; + return this; + } + + public CrashListing addFilesItem(String filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Get files + * @return files + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getFiles() { + return files; + } + + + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFiles(@jakarta.annotation.Nonnull List files) { + this.files = files; + } + + + public CrashListing count(@jakarta.annotation.Nonnull Integer count) { + this.count = count; + return this; + } + + /** + * Get count + * @return count + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getCount() { + return count; + } + + + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCount(@jakarta.annotation.Nonnull Integer count) { + this.count = count; + } + + + /** + * Return true if this CrashListing object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CrashListing crashListing = (CrashListing) o; + return Objects.equals(this.files, crashListing.files) && + Objects.equals(this.count, crashListing.count); + } + + @Override + public int hashCode() { + return Objects.hash(files, count); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CrashListing {\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `files` to the URL query string + if (getFiles() != null) { + for (int i = 0; i < getFiles().size(); i++) { + joiner.add(String.format("%sfiles%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(ApiClient.valueToString(getFiles().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + + // add `count` to the URL query string + if (getCount() != null) { + joiner.add(String.format("%scount%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getCount()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/DevModeRequest.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/DevModeRequest.java new file mode 100644 index 000000000..6551766dd --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/DevModeRequest.java @@ -0,0 +1,187 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `POST /device/{udid}/devmode` request. + */ +@JsonPropertyOrder({ + DevModeRequest.JSON_PROPERTY_ACTION, + DevModeRequest.JSON_PROPERTY_ENABLE_POST_RESTART +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class DevModeRequest { + public static final String JSON_PROPERTY_ACTION = "action"; + @jakarta.annotation.Nonnull + private String action; + + public static final String JSON_PROPERTY_ENABLE_POST_RESTART = "enablePostRestart"; + @jakarta.annotation.Nullable + private Boolean enablePostRestart; + + public DevModeRequest() { + } + + public DevModeRequest action(@jakarta.annotation.Nonnull String action) { + this.action = action; + return this; + } + + /** + * `enable` to turn developer mode on, `reveal` to expose the settings menu. + * @return action + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ACTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAction() { + return action; + } + + + @JsonProperty(JSON_PROPERTY_ACTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAction(@jakarta.annotation.Nonnull String action) { + this.action = action; + } + + + public DevModeRequest enablePostRestart(@jakarta.annotation.Nullable Boolean enablePostRestart) { + this.enablePostRestart = enablePostRestart; + return this; + } + + /** + * When enabling, also arm developer mode to persist across the next reboot. + * @return enablePostRestart + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLE_POST_RESTART) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnablePostRestart() { + return enablePostRestart; + } + + + @JsonProperty(JSON_PROPERTY_ENABLE_POST_RESTART) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnablePostRestart(@jakarta.annotation.Nullable Boolean enablePostRestart) { + this.enablePostRestart = enablePostRestart; + } + + + /** + * Return true if this DevModeRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DevModeRequest devModeRequest = (DevModeRequest) o; + return Objects.equals(this.action, devModeRequest.action) && + Objects.equals(this.enablePostRestart, devModeRequest.enablePostRestart); + } + + @Override + public int hashCode() { + return Objects.hash(action, enablePostRestart); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DevModeRequest {\n"); + sb.append(" action: ").append(toIndentedString(action)).append("\n"); + sb.append(" enablePostRestart: ").append(toIndentedString(enablePostRestart)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `action` to the URL query string + if (getAction() != null) { + joiner.add(String.format("%saction%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getAction()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `enablePostRestart` to the URL query string + if (getEnablePostRestart() != null) { + joiner.add(String.format("%senablePostRestart%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getEnablePostRestart()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/DevModeState.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/DevModeState.java new file mode 100644 index 000000000..b7b420402 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/DevModeState.java @@ -0,0 +1,151 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `GET /device/{udid}/devmode` — developer mode state. + */ +@JsonPropertyOrder({ + DevModeState.JSON_PROPERTY_DEVELOPER_MODE_ENABLED +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class DevModeState { + public static final String JSON_PROPERTY_DEVELOPER_MODE_ENABLED = "DeveloperModeEnabled"; + @jakarta.annotation.Nonnull + private Boolean developerModeEnabled; + + public DevModeState() { + } + + public DevModeState developerModeEnabled(@jakarta.annotation.Nonnull Boolean developerModeEnabled) { + this.developerModeEnabled = developerModeEnabled; + return this; + } + + /** + * Get developerModeEnabled + * @return developerModeEnabled + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DEVELOPER_MODE_ENABLED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getDeveloperModeEnabled() { + return developerModeEnabled; + } + + + @JsonProperty(JSON_PROPERTY_DEVELOPER_MODE_ENABLED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDeveloperModeEnabled(@jakarta.annotation.Nonnull Boolean developerModeEnabled) { + this.developerModeEnabled = developerModeEnabled; + } + + + /** + * Return true if this DevModeState object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DevModeState devModeState = (DevModeState) o; + return Objects.equals(this.developerModeEnabled, devModeState.developerModeEnabled); + } + + @Override + public int hashCode() { + return Objects.hash(developerModeEnabled); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DevModeState {\n"); + sb.append(" developerModeEnabled: ").append(toIndentedString(developerModeEnabled)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `DeveloperModeEnabled` to the URL query string + if (getDeveloperModeEnabled() != null) { + joiner.add(String.format("%sDeveloperModeEnabled%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getDeveloperModeEnabled()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/DeviceDate.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/DeviceDate.java new file mode 100644 index 000000000..a5681a891 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/DeviceDate.java @@ -0,0 +1,187 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `GET /device/{udid}/date`. + */ +@JsonPropertyOrder({ + DeviceDate.JSON_PROPERTY_FORMATED_DATE, + DeviceDate.JSON_PROPERTY_TIME_INTERVAL_SINCE1970 +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class DeviceDate { + public static final String JSON_PROPERTY_FORMATED_DATE = "formatedDate"; + @jakarta.annotation.Nonnull + private String formatedDate; + + public static final String JSON_PROPERTY_TIME_INTERVAL_SINCE1970 = "TimeIntervalSince1970"; + @jakarta.annotation.Nonnull + private Double timeIntervalSince1970; + + public DeviceDate() { + } + + public DeviceDate formatedDate(@jakarta.annotation.Nonnull String formatedDate) { + this.formatedDate = formatedDate; + return this; + } + + /** + * Human-readable RFC850 date on the device. + * @return formatedDate + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FORMATED_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getFormatedDate() { + return formatedDate; + } + + + @JsonProperty(JSON_PROPERTY_FORMATED_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFormatedDate(@jakarta.annotation.Nonnull String formatedDate) { + this.formatedDate = formatedDate; + } + + + public DeviceDate timeIntervalSince1970(@jakarta.annotation.Nonnull Double timeIntervalSince1970) { + this.timeIntervalSince1970 = timeIntervalSince1970; + return this; + } + + /** + * Device clock as Unix epoch seconds. + * @return timeIntervalSince1970 + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TIME_INTERVAL_SINCE1970) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Double getTimeIntervalSince1970() { + return timeIntervalSince1970; + } + + + @JsonProperty(JSON_PROPERTY_TIME_INTERVAL_SINCE1970) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTimeIntervalSince1970(@jakarta.annotation.Nonnull Double timeIntervalSince1970) { + this.timeIntervalSince1970 = timeIntervalSince1970; + } + + + /** + * Return true if this DeviceDate object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeviceDate deviceDate = (DeviceDate) o; + return Objects.equals(this.formatedDate, deviceDate.formatedDate) && + Objects.equals(this.timeIntervalSince1970, deviceDate.timeIntervalSince1970); + } + + @Override + public int hashCode() { + return Objects.hash(formatedDate, timeIntervalSince1970); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeviceDate {\n"); + sb.append(" formatedDate: ").append(toIndentedString(formatedDate)).append("\n"); + sb.append(" timeIntervalSince1970: ").append(toIndentedString(timeIntervalSince1970)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `formatedDate` to the URL query string + if (getFormatedDate() != null) { + joiner.add(String.format("%sformatedDate%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getFormatedDate()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `TimeIntervalSince1970` to the URL query string + if (getTimeIntervalSince1970() != null) { + joiner.add(String.format("%sTimeIntervalSince1970%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getTimeIntervalSince1970()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/DeviceEntry.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/DeviceEntry.java new file mode 100644 index 000000000..e66594266 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/DeviceEntry.java @@ -0,0 +1,368 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.github.danielpaulus.goios.generated.model.DeviceProperties; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * A single device as returned by `GET /list`. + */ +@JsonPropertyOrder({ + DeviceEntry.JSON_PROPERTY_DEVICE_I_D, + DeviceEntry.JSON_PROPERTY_MESSAGE_TYPE, + DeviceEntry.JSON_PROPERTY_PROPERTIES, + DeviceEntry.JSON_PROPERTY_ADDRESS, + DeviceEntry.JSON_PROPERTY_USERSPACE_T_U_N, + DeviceEntry.JSON_PROPERTY_USERSPACE_T_U_N_HOST, + DeviceEntry.JSON_PROPERTY_USERSPACE_T_U_N_PORT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class DeviceEntry { + public static final String JSON_PROPERTY_DEVICE_I_D = "deviceID"; + @jakarta.annotation.Nonnull + private Integer deviceID; + + public static final String JSON_PROPERTY_MESSAGE_TYPE = "messageType"; + @jakarta.annotation.Nullable + private String messageType; + + public static final String JSON_PROPERTY_PROPERTIES = "properties"; + @jakarta.annotation.Nonnull + private DeviceProperties properties; + + public static final String JSON_PROPERTY_ADDRESS = "address"; + @jakarta.annotation.Nullable + private String address; + + public static final String JSON_PROPERTY_USERSPACE_T_U_N = "userspaceTUN"; + @jakarta.annotation.Nullable + private Boolean userspaceTUN; + + public static final String JSON_PROPERTY_USERSPACE_T_U_N_HOST = "userspaceTUNHost"; + @jakarta.annotation.Nullable + private String userspaceTUNHost; + + public static final String JSON_PROPERTY_USERSPACE_T_U_N_PORT = "userspaceTUNPort"; + @jakarta.annotation.Nullable + private Integer userspaceTUNPort; + + public DeviceEntry() { + } + + public DeviceEntry deviceID(@jakarta.annotation.Nonnull Integer deviceID) { + this.deviceID = deviceID; + return this; + } + + /** + * Get deviceID + * @return deviceID + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DEVICE_I_D) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getDeviceID() { + return deviceID; + } + + + @JsonProperty(JSON_PROPERTY_DEVICE_I_D) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDeviceID(@jakarta.annotation.Nonnull Integer deviceID) { + this.deviceID = deviceID; + } + + + public DeviceEntry messageType(@jakarta.annotation.Nullable String messageType) { + this.messageType = messageType; + return this; + } + + /** + * Get messageType + * @return messageType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessageType() { + return messageType; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageType(@jakarta.annotation.Nullable String messageType) { + this.messageType = messageType; + } + + + public DeviceEntry properties(@jakarta.annotation.Nonnull DeviceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get properties + * @return properties + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DeviceProperties getProperties() { + return properties; + } + + + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setProperties(@jakarta.annotation.Nonnull DeviceProperties properties) { + this.properties = properties; + } + + + public DeviceEntry address(@jakarta.annotation.Nullable String address) { + this.address = address; + return this; + } + + /** + * Network address for a device reached over the network / tunnel. + * @return address + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAddress() { + return address; + } + + + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAddress(@jakarta.annotation.Nullable String address) { + this.address = address; + } + + + public DeviceEntry userspaceTUN(@jakarta.annotation.Nullable Boolean userspaceTUN) { + this.userspaceTUN = userspaceTUN; + return this; + } + + /** + * True if reachable via the userspace TUN tunnel. + * @return userspaceTUN + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERSPACE_T_U_N) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getUserspaceTUN() { + return userspaceTUN; + } + + + @JsonProperty(JSON_PROPERTY_USERSPACE_T_U_N) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserspaceTUN(@jakarta.annotation.Nullable Boolean userspaceTUN) { + this.userspaceTUN = userspaceTUN; + } + + + public DeviceEntry userspaceTUNHost(@jakarta.annotation.Nullable String userspaceTUNHost) { + this.userspaceTUNHost = userspaceTUNHost; + return this; + } + + /** + * Get userspaceTUNHost + * @return userspaceTUNHost + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERSPACE_T_U_N_HOST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUserspaceTUNHost() { + return userspaceTUNHost; + } + + + @JsonProperty(JSON_PROPERTY_USERSPACE_T_U_N_HOST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserspaceTUNHost(@jakarta.annotation.Nullable String userspaceTUNHost) { + this.userspaceTUNHost = userspaceTUNHost; + } + + + public DeviceEntry userspaceTUNPort(@jakarta.annotation.Nullable Integer userspaceTUNPort) { + this.userspaceTUNPort = userspaceTUNPort; + return this; + } + + /** + * Get userspaceTUNPort + * @return userspaceTUNPort + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERSPACE_T_U_N_PORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getUserspaceTUNPort() { + return userspaceTUNPort; + } + + + @JsonProperty(JSON_PROPERTY_USERSPACE_T_U_N_PORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserspaceTUNPort(@jakarta.annotation.Nullable Integer userspaceTUNPort) { + this.userspaceTUNPort = userspaceTUNPort; + } + + + /** + * Return true if this DeviceEntry object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeviceEntry deviceEntry = (DeviceEntry) o; + return Objects.equals(this.deviceID, deviceEntry.deviceID) && + Objects.equals(this.messageType, deviceEntry.messageType) && + Objects.equals(this.properties, deviceEntry.properties) && + Objects.equals(this.address, deviceEntry.address) && + Objects.equals(this.userspaceTUN, deviceEntry.userspaceTUN) && + Objects.equals(this.userspaceTUNHost, deviceEntry.userspaceTUNHost) && + Objects.equals(this.userspaceTUNPort, deviceEntry.userspaceTUNPort); + } + + @Override + public int hashCode() { + return Objects.hash(deviceID, messageType, properties, address, userspaceTUN, userspaceTUNHost, userspaceTUNPort); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeviceEntry {\n"); + sb.append(" deviceID: ").append(toIndentedString(deviceID)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" userspaceTUN: ").append(toIndentedString(userspaceTUN)).append("\n"); + sb.append(" userspaceTUNHost: ").append(toIndentedString(userspaceTUNHost)).append("\n"); + sb.append(" userspaceTUNPort: ").append(toIndentedString(userspaceTUNPort)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `deviceID` to the URL query string + if (getDeviceID() != null) { + joiner.add(String.format("%sdeviceID%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getDeviceID()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `messageType` to the URL query string + if (getMessageType() != null) { + joiner.add(String.format("%smessageType%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getMessageType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `properties` to the URL query string + if (getProperties() != null) { + joiner.add(getProperties().toUrlQueryString(prefix + "properties" + suffix)); + } + + // add `address` to the URL query string + if (getAddress() != null) { + joiner.add(String.format("%saddress%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getAddress()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `userspaceTUN` to the URL query string + if (getUserspaceTUN() != null) { + joiner.add(String.format("%suserspaceTUN%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getUserspaceTUN()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `userspaceTUNHost` to the URL query string + if (getUserspaceTUNHost() != null) { + joiner.add(String.format("%suserspaceTUNHost%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getUserspaceTUNHost()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `userspaceTUNPort` to the URL query string + if (getUserspaceTUNPort() != null) { + joiner.add(String.format("%suserspaceTUNPort%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getUserspaceTUNPort()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/DeviceList.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/DeviceList.java new file mode 100644 index 000000000..edb958b69 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/DeviceList.java @@ -0,0 +1,167 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.github.danielpaulus.goios.generated.model.DeviceEntry; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * Response of `GET /list`. + */ +@JsonPropertyOrder({ + DeviceList.JSON_PROPERTY_DEVICE_LIST +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class DeviceList { + public static final String JSON_PROPERTY_DEVICE_LIST = "deviceList"; + @jakarta.annotation.Nonnull + private List deviceList = new ArrayList<>(); + + public DeviceList() { + } + + public DeviceList deviceList(@jakarta.annotation.Nonnull List deviceList) { + this.deviceList = deviceList; + return this; + } + + public DeviceList addDeviceListItem(DeviceEntry deviceListItem) { + if (this.deviceList == null) { + this.deviceList = new ArrayList<>(); + } + this.deviceList.add(deviceListItem); + return this; + } + + /** + * Get deviceList + * @return deviceList + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DEVICE_LIST) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getDeviceList() { + return deviceList; + } + + + @JsonProperty(JSON_PROPERTY_DEVICE_LIST) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDeviceList(@jakarta.annotation.Nonnull List deviceList) { + this.deviceList = deviceList; + } + + + /** + * Return true if this DeviceList object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeviceList deviceList = (DeviceList) o; + return Objects.equals(this.deviceList, deviceList.deviceList); + } + + @Override + public int hashCode() { + return Objects.hash(deviceList); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeviceList {\n"); + sb.append(" deviceList: ").append(toIndentedString(deviceList)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `deviceList` to the URL query string + if (getDeviceList() != null) { + for (int i = 0; i < getDeviceList().size(); i++) { + if (getDeviceList().get(i) != null) { + joiner.add(getDeviceList().get(i).toUrlQueryString(String.format("%sdeviceList%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/DeviceName.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/DeviceName.java new file mode 100644 index 000000000..c47ecc0c6 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/DeviceName.java @@ -0,0 +1,151 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `GET /device/{udid}/devicename`. + */ +@JsonPropertyOrder({ + DeviceName.JSON_PROPERTY_DEVICENAME +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class DeviceName { + public static final String JSON_PROPERTY_DEVICENAME = "devicename"; + @jakarta.annotation.Nonnull + private String devicename; + + public DeviceName() { + } + + public DeviceName devicename(@jakarta.annotation.Nonnull String devicename) { + this.devicename = devicename; + return this; + } + + /** + * Get devicename + * @return devicename + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DEVICENAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDevicename() { + return devicename; + } + + + @JsonProperty(JSON_PROPERTY_DEVICENAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDevicename(@jakarta.annotation.Nonnull String devicename) { + this.devicename = devicename; + } + + + /** + * Return true if this DeviceName object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeviceName deviceName = (DeviceName) o; + return Objects.equals(this.devicename, deviceName.devicename); + } + + @Override + public int hashCode() { + return Objects.hash(devicename); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeviceName {\n"); + sb.append(" devicename: ").append(toIndentedString(devicename)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `devicename` to the URL query string + if (getDevicename() != null) { + joiner.add(String.format("%sdevicename%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getDevicename()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/DeviceProperties.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/DeviceProperties.java new file mode 100644 index 000000000..2c4fb314a --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/DeviceProperties.java @@ -0,0 +1,331 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * Low-level device properties reported by usbmuxd / lockdown. + */ +@JsonPropertyOrder({ + DeviceProperties.JSON_PROPERTY_CONNECTION_SPEED, + DeviceProperties.JSON_PROPERTY_CONNECTION_TYPE, + DeviceProperties.JSON_PROPERTY_DEVICE_I_D, + DeviceProperties.JSON_PROPERTY_LOCATION_I_D, + DeviceProperties.JSON_PROPERTY_PRODUCT_I_D, + DeviceProperties.JSON_PROPERTY_SERIAL_NUMBER +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class DeviceProperties { + public static final String JSON_PROPERTY_CONNECTION_SPEED = "connectionSpeed"; + @jakarta.annotation.Nullable + private Integer connectionSpeed; + + public static final String JSON_PROPERTY_CONNECTION_TYPE = "connectionType"; + @jakarta.annotation.Nullable + private String connectionType; + + public static final String JSON_PROPERTY_DEVICE_I_D = "deviceID"; + @jakarta.annotation.Nullable + private Integer deviceID; + + public static final String JSON_PROPERTY_LOCATION_I_D = "locationID"; + @jakarta.annotation.Nullable + private Integer locationID; + + public static final String JSON_PROPERTY_PRODUCT_I_D = "productID"; + @jakarta.annotation.Nullable + private Integer productID; + + public static final String JSON_PROPERTY_SERIAL_NUMBER = "serialNumber"; + @jakarta.annotation.Nonnull + private String serialNumber; + + public DeviceProperties() { + } + + public DeviceProperties connectionSpeed(@jakarta.annotation.Nullable Integer connectionSpeed) { + this.connectionSpeed = connectionSpeed; + return this; + } + + /** + * Get connectionSpeed + * @return connectionSpeed + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONNECTION_SPEED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getConnectionSpeed() { + return connectionSpeed; + } + + + @JsonProperty(JSON_PROPERTY_CONNECTION_SPEED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConnectionSpeed(@jakarta.annotation.Nullable Integer connectionSpeed) { + this.connectionSpeed = connectionSpeed; + } + + + public DeviceProperties connectionType(@jakarta.annotation.Nullable String connectionType) { + this.connectionType = connectionType; + return this; + } + + /** + * Get connectionType + * @return connectionType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONNECTION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getConnectionType() { + return connectionType; + } + + + @JsonProperty(JSON_PROPERTY_CONNECTION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConnectionType(@jakarta.annotation.Nullable String connectionType) { + this.connectionType = connectionType; + } + + + public DeviceProperties deviceID(@jakarta.annotation.Nullable Integer deviceID) { + this.deviceID = deviceID; + return this; + } + + /** + * Get deviceID + * @return deviceID + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEVICE_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getDeviceID() { + return deviceID; + } + + + @JsonProperty(JSON_PROPERTY_DEVICE_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceID(@jakarta.annotation.Nullable Integer deviceID) { + this.deviceID = deviceID; + } + + + public DeviceProperties locationID(@jakarta.annotation.Nullable Integer locationID) { + this.locationID = locationID; + return this; + } + + /** + * Get locationID + * @return locationID + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOCATION_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getLocationID() { + return locationID; + } + + + @JsonProperty(JSON_PROPERTY_LOCATION_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocationID(@jakarta.annotation.Nullable Integer locationID) { + this.locationID = locationID; + } + + + public DeviceProperties productID(@jakarta.annotation.Nullable Integer productID) { + this.productID = productID; + return this; + } + + /** + * Get productID + * @return productID + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRODUCT_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getProductID() { + return productID; + } + + + @JsonProperty(JSON_PROPERTY_PRODUCT_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProductID(@jakarta.annotation.Nullable Integer productID) { + this.productID = productID; + } + + + public DeviceProperties serialNumber(@jakarta.annotation.Nonnull String serialNumber) { + this.serialNumber = serialNumber; + return this; + } + + /** + * The device udid (serial number). This is what device-scoped routes key on. + * @return serialNumber + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SERIAL_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSerialNumber() { + return serialNumber; + } + + + @JsonProperty(JSON_PROPERTY_SERIAL_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSerialNumber(@jakarta.annotation.Nonnull String serialNumber) { + this.serialNumber = serialNumber; + } + + + /** + * Return true if this DeviceProperties object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeviceProperties deviceProperties = (DeviceProperties) o; + return Objects.equals(this.connectionSpeed, deviceProperties.connectionSpeed) && + Objects.equals(this.connectionType, deviceProperties.connectionType) && + Objects.equals(this.deviceID, deviceProperties.deviceID) && + Objects.equals(this.locationID, deviceProperties.locationID) && + Objects.equals(this.productID, deviceProperties.productID) && + Objects.equals(this.serialNumber, deviceProperties.serialNumber); + } + + @Override + public int hashCode() { + return Objects.hash(connectionSpeed, connectionType, deviceID, locationID, productID, serialNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeviceProperties {\n"); + sb.append(" connectionSpeed: ").append(toIndentedString(connectionSpeed)).append("\n"); + sb.append(" connectionType: ").append(toIndentedString(connectionType)).append("\n"); + sb.append(" deviceID: ").append(toIndentedString(deviceID)).append("\n"); + sb.append(" locationID: ").append(toIndentedString(locationID)).append("\n"); + sb.append(" productID: ").append(toIndentedString(productID)).append("\n"); + sb.append(" serialNumber: ").append(toIndentedString(serialNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `connectionSpeed` to the URL query string + if (getConnectionSpeed() != null) { + joiner.add(String.format("%sconnectionSpeed%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getConnectionSpeed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `connectionType` to the URL query string + if (getConnectionType() != null) { + joiner.add(String.format("%sconnectionType%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getConnectionType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `deviceID` to the URL query string + if (getDeviceID() != null) { + joiner.add(String.format("%sdeviceID%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getDeviceID()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `locationID` to the URL query string + if (getLocationID() != null) { + joiner.add(String.format("%slocationID%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getLocationID()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `productID` to the URL query string + if (getProductID() != null) { + joiner.add(String.format("%sproductID%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getProductID()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `serialNumber` to the URL query string + if (getSerialNumber() != null) { + joiner.add(String.format("%sserialNumber%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSerialNumber()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/DevicesGetJob404Response.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/DevicesGetJob404Response.java new file mode 100644 index 000000000..7ff1c129e --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/DevicesGetJob404Response.java @@ -0,0 +1,210 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.github.danielpaulus.goios.generated.model.GenericResponse; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import com.github.danielpaulus.goios.generated.invoker.JSON; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +@JsonDeserialize(using=DevicesGetJob404Response.DevicesGetJob404ResponseDeserializer.class) +@JsonSerialize(using = DevicesGetJob404Response.DevicesGetJob404ResponseSerializer.class) +public class DevicesGetJob404Response extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(DevicesGetJob404Response.class.getName()); + + public static class DevicesGetJob404ResponseSerializer extends StdSerializer { + public DevicesGetJob404ResponseSerializer(Class t) { + super(t); + } + + public DevicesGetJob404ResponseSerializer() { + this(null); + } + + @Override + public void serialize(DevicesGetJob404Response value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class DevicesGetJob404ResponseDeserializer extends StdDeserializer { + public DevicesGetJob404ResponseDeserializer() { + this(DevicesGetJob404Response.class); + } + + public DevicesGetJob404ResponseDeserializer(Class vc) { + super(vc); + } + + @Override + public DevicesGetJob404Response deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + + Object deserialized = null; + // deserialize GenericResponse + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(GenericResponse.class); + DevicesGetJob404Response ret = new DevicesGetJob404Response(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'DevicesGetJob404Response'", e); + } + + throw new IOException(String.format("Failed deserialization for DevicesGetJob404Response: no match found")); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public DevicesGetJob404Response getNullValue(DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "DevicesGetJob404Response cannot be null"); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public DevicesGetJob404Response() { + super("anyOf", Boolean.FALSE); + } + + public DevicesGetJob404Response(GenericResponse o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("GenericResponse", GenericResponse.class); + JSON.registerDescendants(DevicesGetJob404Response.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map> getSchemas() { + return DevicesGetJob404Response.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check + * the instance parameter is valid against the anyOf child schemas: + * GenericResponse + * + * It could be an instance of the 'anyOf' schemas. + * The anyOf child schemas may themselves be a composed schema (allOf, anyOf, anyOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(GenericResponse.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be GenericResponse"); + } + + /** + * Get the actual instance, which can be the following: + * GenericResponse + * + * @return The actual instance (GenericResponse) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `GenericResponse`. If the actual instance is not `GenericResponse`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GenericResponse` + * @throws ClassCastException if the instance is not `GenericResponse` + */ + public GenericResponse getGenericResponse() throws ClassCastException { + return (GenericResponse)super.getActualInstance(); + } + + + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + return null; + } + +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/DiskSpaceInfo.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/DiskSpaceInfo.java new file mode 100644 index 000000000..2683dbae5 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/DiskSpaceInfo.java @@ -0,0 +1,259 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `GET /device/{udid}/diskspace` — AFC filesystem info (`afc.DeviceInfo`). Total/free/used bytes and block size. Open map; common keys surfaced. + */ +@JsonPropertyOrder({ + DiskSpaceInfo.JSON_PROPERTY_FS_TOTAL_BYTES, + DiskSpaceInfo.JSON_PROPERTY_FS_FREE_BYTES, + DiskSpaceInfo.JSON_PROPERTY_FS_BLOCK_SIZE, + DiskSpaceInfo.JSON_PROPERTY_MODEL +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class DiskSpaceInfo { + public static final String JSON_PROPERTY_FS_TOTAL_BYTES = "FSTotalBytes"; + @jakarta.annotation.Nullable + private Long fsTotalBytes; + + public static final String JSON_PROPERTY_FS_FREE_BYTES = "FSFreeBytes"; + @jakarta.annotation.Nullable + private Long fsFreeBytes; + + public static final String JSON_PROPERTY_FS_BLOCK_SIZE = "FSBlockSize"; + @jakarta.annotation.Nullable + private Long fsBlockSize; + + public static final String JSON_PROPERTY_MODEL = "Model"; + @jakarta.annotation.Nullable + private String model; + + public DiskSpaceInfo() { + } + + public DiskSpaceInfo fsTotalBytes(@jakarta.annotation.Nullable Long fsTotalBytes) { + this.fsTotalBytes = fsTotalBytes; + return this; + } + + /** + * Total filesystem capacity in bytes. + * @return fsTotalBytes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FS_TOTAL_BYTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getFsTotalBytes() { + return fsTotalBytes; + } + + + @JsonProperty(JSON_PROPERTY_FS_TOTAL_BYTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFsTotalBytes(@jakarta.annotation.Nullable Long fsTotalBytes) { + this.fsTotalBytes = fsTotalBytes; + } + + + public DiskSpaceInfo fsFreeBytes(@jakarta.annotation.Nullable Long fsFreeBytes) { + this.fsFreeBytes = fsFreeBytes; + return this; + } + + /** + * Free filesystem space in bytes. + * @return fsFreeBytes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FS_FREE_BYTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getFsFreeBytes() { + return fsFreeBytes; + } + + + @JsonProperty(JSON_PROPERTY_FS_FREE_BYTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFsFreeBytes(@jakarta.annotation.Nullable Long fsFreeBytes) { + this.fsFreeBytes = fsFreeBytes; + } + + + public DiskSpaceInfo fsBlockSize(@jakarta.annotation.Nullable Long fsBlockSize) { + this.fsBlockSize = fsBlockSize; + return this; + } + + /** + * Filesystem block size in bytes. + * @return fsBlockSize + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FS_BLOCK_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getFsBlockSize() { + return fsBlockSize; + } + + + @JsonProperty(JSON_PROPERTY_FS_BLOCK_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFsBlockSize(@jakarta.annotation.Nullable Long fsBlockSize) { + this.fsBlockSize = fsBlockSize; + } + + + public DiskSpaceInfo model(@jakarta.annotation.Nullable String model) { + this.model = model; + return this; + } + + /** + * AFC model identifier reported by the device. + * @return model + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getModel() { + return model; + } + + + @JsonProperty(JSON_PROPERTY_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setModel(@jakarta.annotation.Nullable String model) { + this.model = model; + } + + + /** + * Return true if this DiskSpaceInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DiskSpaceInfo diskSpaceInfo = (DiskSpaceInfo) o; + return Objects.equals(this.fsTotalBytes, diskSpaceInfo.fsTotalBytes) && + Objects.equals(this.fsFreeBytes, diskSpaceInfo.fsFreeBytes) && + Objects.equals(this.fsBlockSize, diskSpaceInfo.fsBlockSize) && + Objects.equals(this.model, diskSpaceInfo.model); + } + + @Override + public int hashCode() { + return Objects.hash(fsTotalBytes, fsFreeBytes, fsBlockSize, model); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DiskSpaceInfo {\n"); + sb.append(" fsTotalBytes: ").append(toIndentedString(fsTotalBytes)).append("\n"); + sb.append(" fsFreeBytes: ").append(toIndentedString(fsFreeBytes)).append("\n"); + sb.append(" fsBlockSize: ").append(toIndentedString(fsBlockSize)).append("\n"); + sb.append(" model: ").append(toIndentedString(model)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `FSTotalBytes` to the URL query string + if (getFsTotalBytes() != null) { + joiner.add(String.format("%sFSTotalBytes%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getFsTotalBytes()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `FSFreeBytes` to the URL query string + if (getFsFreeBytes() != null) { + joiner.add(String.format("%sFSFreeBytes%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getFsFreeBytes()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `FSBlockSize` to the URL query string + if (getFsBlockSize() != null) { + joiner.add(String.format("%sFSBlockSize%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getFsBlockSize()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `Model` to the URL query string + if (getModel() != null) { + joiner.add(String.format("%sModel%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getModel()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/EnabledRequest.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/EnabledRequest.java new file mode 100644 index 000000000..bf31832b7 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/EnabledRequest.java @@ -0,0 +1,151 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * Request body for the `enabled`-toggle settings endpoints. + */ +@JsonPropertyOrder({ + EnabledRequest.JSON_PROPERTY_ENABLED +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class EnabledRequest { + public static final String JSON_PROPERTY_ENABLED = "enabled"; + @jakarta.annotation.Nonnull + private Boolean enabled; + + public EnabledRequest() { + } + + public EnabledRequest enabled(@jakarta.annotation.Nonnull Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get enabled + * @return enabled + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getEnabled() { + return enabled; + } + + + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEnabled(@jakarta.annotation.Nonnull Boolean enabled) { + this.enabled = enabled; + } + + + /** + * Return true if this EnabledRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnabledRequest enabledRequest = (EnabledRequest) o; + return Objects.equals(this.enabled, enabledRequest.enabled); + } + + @Override + public int hashCode() { + return Objects.hash(enabled); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnabledRequest {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `enabled` to the URL query string + if (getEnabled() != null) { + joiner.add(String.format("%senabled%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getEnabled()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/FileDomain.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/FileDomain.java new file mode 100644 index 000000000..5f464dc35 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/FileDomain.java @@ -0,0 +1,203 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import com.github.danielpaulus.goios.generated.invoker.JSON; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +@JsonDeserialize(using=FileDomain.FileDomainDeserializer.class) +@JsonSerialize(using = FileDomain.FileDomainSerializer.class) +public class FileDomain extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(FileDomain.class.getName()); + + public static class FileDomainSerializer extends StdSerializer { + public FileDomainSerializer(Class t) { + super(t); + } + + public FileDomainSerializer() { + this(null); + } + + @Override + public void serialize(FileDomain value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class FileDomainDeserializer extends StdDeserializer { + public FileDomainDeserializer() { + this(FileDomain.class); + } + + public FileDomainDeserializer(Class vc) { + super(vc); + } + + @Override + public FileDomain deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + + Object deserialized = null; + // deserialize String + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(String.class); + FileDomain ret = new FileDomain(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'FileDomain'", e); + } + + throw new IOException(String.format("Failed deserialization for FileDomain: no match found")); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public FileDomain getNullValue(DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "FileDomain cannot be null"); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public FileDomain() { + super("anyOf", Boolean.FALSE); + } + + public FileDomain(String o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", String.class); + JSON.registerDescendants(FileDomain.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map> getSchemas() { + return FileDomain.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check + * the instance parameter is valid against the anyOf child schemas: + * String + * + * It could be an instance of the 'anyOf' schemas. + * The anyOf child schemas may themselves be a composed schema (allOf, anyOf, anyOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(String.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be String"); + } + + /** + * Get the actual instance, which can be the following: + * String + * + * @return The actual instance (String) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + return null; + } + +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/FileEntry.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/FileEntry.java new file mode 100644 index 000000000..704ef23e4 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/FileEntry.java @@ -0,0 +1,259 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * A single entry in a device directory listing. + */ +@JsonPropertyOrder({ + FileEntry.JSON_PROPERTY_NAME, + FileEntry.JSON_PROPERTY_PATH, + FileEntry.JSON_PROPERTY_IS_DIR, + FileEntry.JSON_PROPERTY_SIZE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class FileEntry { + public static final String JSON_PROPERTY_NAME = "name"; + @jakarta.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_PATH = "path"; + @jakarta.annotation.Nullable + private String path; + + public static final String JSON_PROPERTY_IS_DIR = "isDir"; + @jakarta.annotation.Nullable + private Boolean isDir; + + public static final String JSON_PROPERTY_SIZE = "size"; + @jakarta.annotation.Nullable + private Long size; + + public FileEntry() { + } + + public FileEntry name(@jakarta.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@jakarta.annotation.Nullable String name) { + this.name = name; + } + + + public FileEntry path(@jakarta.annotation.Nullable String path) { + this.path = path; + return this; + } + + /** + * Get path + * @return path + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@jakarta.annotation.Nullable String path) { + this.path = path; + } + + + public FileEntry isDir(@jakarta.annotation.Nullable Boolean isDir) { + this.isDir = isDir; + return this; + } + + /** + * Get isDir + * @return isDir + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_DIR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsDir() { + return isDir; + } + + + @JsonProperty(JSON_PROPERTY_IS_DIR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsDir(@jakarta.annotation.Nullable Boolean isDir) { + this.isDir = isDir; + } + + + public FileEntry size(@jakarta.annotation.Nullable Long size) { + this.size = size; + return this; + } + + /** + * Get size + * @return size + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getSize() { + return size; + } + + + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSize(@jakarta.annotation.Nullable Long size) { + this.size = size; + } + + + /** + * Return true if this FileEntry object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileEntry fileEntry = (FileEntry) o; + return Objects.equals(this.name, fileEntry.name) && + Objects.equals(this.path, fileEntry.path) && + Objects.equals(this.isDir, fileEntry.isDir) && + Objects.equals(this.size, fileEntry.size); + } + + @Override + public int hashCode() { + return Objects.hash(name, path, isDir, size); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileEntry {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" isDir: ").append(toIndentedString(isDir)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%spath%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPath()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `isDir` to the URL query string + if (getIsDir() != null) { + joiner.add(String.format("%sisDir%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getIsDir()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `size` to the URL query string + if (getSize() != null) { + joiner.add(String.format("%ssize%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSize()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/FileListing.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/FileListing.java new file mode 100644 index 000000000..83577957e --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/FileListing.java @@ -0,0 +1,239 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.github.danielpaulus.goios.generated.model.FileEntry; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `GET /device/{udid}/files` — directory listing. + */ +@JsonPropertyOrder({ + FileListing.JSON_PROPERTY_PATH, + FileListing.JSON_PROPERTY_FILES, + FileListing.JSON_PROPERTY_COUNT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class FileListing { + public static final String JSON_PROPERTY_PATH = "path"; + @jakarta.annotation.Nonnull + private String path; + + public static final String JSON_PROPERTY_FILES = "files"; + @jakarta.annotation.Nonnull + private List files = new ArrayList<>(); + + public static final String JSON_PROPERTY_COUNT = "count"; + @jakarta.annotation.Nonnull + private Integer count; + + public FileListing() { + } + + public FileListing path(@jakarta.annotation.Nonnull String path) { + this.path = path; + return this; + } + + /** + * Get path + * @return path + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPath() { + return path; + } + + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPath(@jakarta.annotation.Nonnull String path) { + this.path = path; + } + + + public FileListing files(@jakarta.annotation.Nonnull List files) { + this.files = files; + return this; + } + + public FileListing addFilesItem(FileEntry filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Get files + * @return files + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getFiles() { + return files; + } + + + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFiles(@jakarta.annotation.Nonnull List files) { + this.files = files; + } + + + public FileListing count(@jakarta.annotation.Nonnull Integer count) { + this.count = count; + return this; + } + + /** + * Get count + * @return count + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getCount() { + return count; + } + + + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCount(@jakarta.annotation.Nonnull Integer count) { + this.count = count; + } + + + /** + * Return true if this FileListing object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileListing fileListing = (FileListing) o; + return Objects.equals(this.path, fileListing.path) && + Objects.equals(this.files, fileListing.files) && + Objects.equals(this.count, fileListing.count); + } + + @Override + public int hashCode() { + return Objects.hash(path, files, count); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileListing {\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%spath%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPath()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `files` to the URL query string + if (getFiles() != null) { + for (int i = 0; i < getFiles().size(); i++) { + if (getFiles().get(i) != null) { + joiner.add(getFiles().get(i).toUrlQueryString(String.format("%sfiles%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `count` to the URL query string + if (getCount() != null) { + joiner.add(String.format("%scount%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getCount()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/FilePushResult.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/FilePushResult.java new file mode 100644 index 000000000..a9e0a8cbd --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/FilePushResult.java @@ -0,0 +1,187 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `POST /device/{udid}/files/push` — acknowledgement. + */ +@JsonPropertyOrder({ + FilePushResult.JSON_PROPERTY_REMOTE, + FilePushResult.JSON_PROPERTY_SIZE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class FilePushResult { + public static final String JSON_PROPERTY_REMOTE = "remote"; + @jakarta.annotation.Nonnull + private String remote; + + public static final String JSON_PROPERTY_SIZE = "size"; + @jakarta.annotation.Nonnull + private Long size; + + public FilePushResult() { + } + + public FilePushResult remote(@jakarta.annotation.Nonnull String remote) { + this.remote = remote; + return this; + } + + /** + * Get remote + * @return remote + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_REMOTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getRemote() { + return remote; + } + + + @JsonProperty(JSON_PROPERTY_REMOTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRemote(@jakarta.annotation.Nonnull String remote) { + this.remote = remote; + } + + + public FilePushResult size(@jakarta.annotation.Nonnull Long size) { + this.size = size; + return this; + } + + /** + * Get size + * @return size + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getSize() { + return size; + } + + + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSize(@jakarta.annotation.Nonnull Long size) { + this.size = size; + } + + + /** + * Return true if this FilePushResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FilePushResult filePushResult = (FilePushResult) o; + return Objects.equals(this.remote, filePushResult.remote) && + Objects.equals(this.size, filePushResult.size); + } + + @Override + public int hashCode() { + return Objects.hash(remote, size); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FilePushResult {\n"); + sb.append(" remote: ").append(toIndentedString(remote)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `remote` to the URL query string + if (getRemote() != null) { + joiner.add(String.format("%sremote%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getRemote()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `size` to the URL query string + if (getSize() != null) { + joiner.add(String.format("%ssize%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSize()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/ForwardRequest.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/ForwardRequest.java new file mode 100644 index 000000000..ea6d099f6 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/ForwardRequest.java @@ -0,0 +1,187 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `POST /device/{udid}/jobs/forward` request. + */ +@JsonPropertyOrder({ + ForwardRequest.JSON_PROPERTY_HOST_PORT, + ForwardRequest.JSON_PROPERTY_TARGET_PORT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class ForwardRequest { + public static final String JSON_PROPERTY_HOST_PORT = "hostPort"; + @jakarta.annotation.Nonnull + private Integer hostPort; + + public static final String JSON_PROPERTY_TARGET_PORT = "targetPort"; + @jakarta.annotation.Nonnull + private Integer targetPort; + + public ForwardRequest() { + } + + public ForwardRequest hostPort(@jakarta.annotation.Nonnull Integer hostPort) { + this.hostPort = hostPort; + return this; + } + + /** + * Local (host) TCP port to listen on. + * @return hostPort + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_HOST_PORT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getHostPort() { + return hostPort; + } + + + @JsonProperty(JSON_PROPERTY_HOST_PORT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setHostPort(@jakarta.annotation.Nonnull Integer hostPort) { + this.hostPort = hostPort; + } + + + public ForwardRequest targetPort(@jakarta.annotation.Nonnull Integer targetPort) { + this.targetPort = targetPort; + return this; + } + + /** + * Device TCP port to forward to. + * @return targetPort + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TARGET_PORT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getTargetPort() { + return targetPort; + } + + + @JsonProperty(JSON_PROPERTY_TARGET_PORT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTargetPort(@jakarta.annotation.Nonnull Integer targetPort) { + this.targetPort = targetPort; + } + + + /** + * Return true if this ForwardRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ForwardRequest forwardRequest = (ForwardRequest) o; + return Objects.equals(this.hostPort, forwardRequest.hostPort) && + Objects.equals(this.targetPort, forwardRequest.targetPort); + } + + @Override + public int hashCode() { + return Objects.hash(hostPort, targetPort); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ForwardRequest {\n"); + sb.append(" hostPort: ").append(toIndentedString(hostPort)).append("\n"); + sb.append(" targetPort: ").append(toIndentedString(targetPort)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `hostPort` to the URL query string + if (getHostPort() != null) { + joiner.add(String.format("%shostPort%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getHostPort()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `targetPort` to the URL query string + if (getTargetPort() != null) { + joiner.add(String.format("%stargetPort%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getTargetPort()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/FsyncListing.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/FsyncListing.java new file mode 100644 index 000000000..e20ca9291 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/FsyncListing.java @@ -0,0 +1,237 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `GET /device/{udid}/fsync/ls` — a directory listing over AFC. + */ +@JsonPropertyOrder({ + FsyncListing.JSON_PROPERTY_PATH, + FsyncListing.JSON_PROPERTY_FILES, + FsyncListing.JSON_PROPERTY_COUNT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class FsyncListing { + public static final String JSON_PROPERTY_PATH = "path"; + @jakarta.annotation.Nonnull + private String path; + + public static final String JSON_PROPERTY_FILES = "files"; + @jakarta.annotation.Nonnull + private List files = new ArrayList<>(); + + public static final String JSON_PROPERTY_COUNT = "count"; + @jakarta.annotation.Nonnull + private Integer count; + + public FsyncListing() { + } + + public FsyncListing path(@jakarta.annotation.Nonnull String path) { + this.path = path; + return this; + } + + /** + * The listed (cleaned) device path. + * @return path + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPath() { + return path; + } + + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPath(@jakarta.annotation.Nonnull String path) { + this.path = path; + } + + + public FsyncListing files(@jakarta.annotation.Nonnull List files) { + this.files = files; + return this; + } + + public FsyncListing addFilesItem(String filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * File/directory names in the listed directory. + * @return files + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getFiles() { + return files; + } + + + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFiles(@jakarta.annotation.Nonnull List files) { + this.files = files; + } + + + public FsyncListing count(@jakarta.annotation.Nonnull Integer count) { + this.count = count; + return this; + } + + /** + * Number of entries. + * @return count + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getCount() { + return count; + } + + + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCount(@jakarta.annotation.Nonnull Integer count) { + this.count = count; + } + + + /** + * Return true if this FsyncListing object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FsyncListing fsyncListing = (FsyncListing) o; + return Objects.equals(this.path, fsyncListing.path) && + Objects.equals(this.files, fsyncListing.files) && + Objects.equals(this.count, fsyncListing.count); + } + + @Override + public int hashCode() { + return Objects.hash(path, files, count); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FsyncListing {\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%spath%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPath()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `files` to the URL query string + if (getFiles() != null) { + for (int i = 0; i < getFiles().size(); i++) { + joiner.add(String.format("%sfiles%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(ApiClient.valueToString(getFiles().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + + // add `count` to the URL query string + if (getCount() != null) { + joiner.add(String.format("%scount%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getCount()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/FsyncMessage.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/FsyncMessage.java new file mode 100644 index 000000000..ab154ba83 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/FsyncMessage.java @@ -0,0 +1,187 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `POST /device/{udid}/fsync/mkdir` and `DELETE /device/{udid}/fsync/rm` — simple message + path acknowledgement. + */ +@JsonPropertyOrder({ + FsyncMessage.JSON_PROPERTY_MESSAGE, + FsyncMessage.JSON_PROPERTY_PATH +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class FsyncMessage { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nonnull + private String message; + + public static final String JSON_PROPERTY_PATH = "path"; + @jakarta.annotation.Nonnull + private String path; + + public FsyncMessage() { + } + + public FsyncMessage message(@jakarta.annotation.Nonnull String message) { + this.message = message; + return this; + } + + /** + * Human-readable result message (e.g. `created`, `removed`). + * @return message + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMessage(@jakarta.annotation.Nonnull String message) { + this.message = message; + } + + + public FsyncMessage path(@jakarta.annotation.Nonnull String path) { + this.path = path; + return this; + } + + /** + * The (cleaned) device path acted on. + * @return path + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPath() { + return path; + } + + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPath(@jakarta.annotation.Nonnull String path) { + this.path = path; + } + + + /** + * Return true if this FsyncMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FsyncMessage fsyncMessage = (FsyncMessage) o; + return Objects.equals(this.message, fsyncMessage.message) && + Objects.equals(this.path, fsyncMessage.path); + } + + @Override + public int hashCode() { + return Objects.hash(message, path); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FsyncMessage {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format("%smessage%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getMessage()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%spath%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPath()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/FsyncPushResult.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/FsyncPushResult.java new file mode 100644 index 000000000..300f3fdb7 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/FsyncPushResult.java @@ -0,0 +1,187 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `POST /device/{udid}/fsync/push` — result of an upload over AFC. + */ +@JsonPropertyOrder({ + FsyncPushResult.JSON_PROPERTY_PATH, + FsyncPushResult.JSON_PROPERTY_SIZE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class FsyncPushResult { + public static final String JSON_PROPERTY_PATH = "path"; + @jakarta.annotation.Nonnull + private String path; + + public static final String JSON_PROPERTY_SIZE = "size"; + @jakarta.annotation.Nonnull + private Long size; + + public FsyncPushResult() { + } + + public FsyncPushResult path(@jakarta.annotation.Nonnull String path) { + this.path = path; + return this; + } + + /** + * Destination device path written. + * @return path + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPath() { + return path; + } + + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPath(@jakarta.annotation.Nonnull String path) { + this.path = path; + } + + + public FsyncPushResult size(@jakarta.annotation.Nonnull Long size) { + this.size = size; + return this; + } + + /** + * Number of bytes written. + * @return size + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getSize() { + return size; + } + + + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSize(@jakarta.annotation.Nonnull Long size) { + this.size = size; + } + + + /** + * Return true if this FsyncPushResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FsyncPushResult fsyncPushResult = (FsyncPushResult) o; + return Objects.equals(this.path, fsyncPushResult.path) && + Objects.equals(this.size, fsyncPushResult.size); + } + + @Override + public int hashCode() { + return Objects.hash(path, size); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FsyncPushResult {\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%spath%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPath()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `size` to the URL query string + if (getSize() != null) { + joiner.add(String.format("%ssize%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSize()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/FsyncTreeEntry.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/FsyncTreeEntry.java new file mode 100644 index 000000000..187147b43 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/FsyncTreeEntry.java @@ -0,0 +1,259 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * One entry returned by the recursive `GET /device/{udid}/fsync/tree` walk. + */ +@JsonPropertyOrder({ + FsyncTreeEntry.JSON_PROPERTY_PATH, + FsyncTreeEntry.JSON_PROPERTY_NAME, + FsyncTreeEntry.JSON_PROPERTY_IS_DIR, + FsyncTreeEntry.JSON_PROPERTY_SIZE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class FsyncTreeEntry { + public static final String JSON_PROPERTY_PATH = "path"; + @jakarta.annotation.Nonnull + private String path; + + public static final String JSON_PROPERTY_NAME = "name"; + @jakarta.annotation.Nonnull + private String name; + + public static final String JSON_PROPERTY_IS_DIR = "isDir"; + @jakarta.annotation.Nonnull + private Boolean isDir; + + public static final String JSON_PROPERTY_SIZE = "size"; + @jakarta.annotation.Nonnull + private Long size; + + public FsyncTreeEntry() { + } + + public FsyncTreeEntry path(@jakarta.annotation.Nonnull String path) { + this.path = path; + return this; + } + + /** + * Full device-side path of this entry. + * @return path + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPath() { + return path; + } + + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPath(@jakarta.annotation.Nonnull String path) { + this.path = path; + } + + + public FsyncTreeEntry name(@jakarta.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Base name of the entry. + * @return name + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(@jakarta.annotation.Nonnull String name) { + this.name = name; + } + + + public FsyncTreeEntry isDir(@jakarta.annotation.Nonnull Boolean isDir) { + this.isDir = isDir; + return this; + } + + /** + * Whether the entry is a directory. + * @return isDir + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_IS_DIR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getIsDir() { + return isDir; + } + + + @JsonProperty(JSON_PROPERTY_IS_DIR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIsDir(@jakarta.annotation.Nonnull Boolean isDir) { + this.isDir = isDir; + } + + + public FsyncTreeEntry size(@jakarta.annotation.Nonnull Long size) { + this.size = size; + return this; + } + + /** + * Size in bytes. + * @return size + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getSize() { + return size; + } + + + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSize(@jakarta.annotation.Nonnull Long size) { + this.size = size; + } + + + /** + * Return true if this FsyncTreeEntry object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FsyncTreeEntry fsyncTreeEntry = (FsyncTreeEntry) o; + return Objects.equals(this.path, fsyncTreeEntry.path) && + Objects.equals(this.name, fsyncTreeEntry.name) && + Objects.equals(this.isDir, fsyncTreeEntry.isDir) && + Objects.equals(this.size, fsyncTreeEntry.size); + } + + @Override + public int hashCode() { + return Objects.hash(path, name, isDir, size); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FsyncTreeEntry {\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" isDir: ").append(toIndentedString(isDir)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%spath%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPath()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `isDir` to the URL query string + if (getIsDir() != null) { + joiner.add(String.format("%sisDir%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getIsDir()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `size` to the URL query string + if (getSize() != null) { + joiner.add(String.format("%ssize%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSize()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/FsyncTreeListing.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/FsyncTreeListing.java new file mode 100644 index 000000000..93f53429e --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/FsyncTreeListing.java @@ -0,0 +1,239 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.github.danielpaulus.goios.generated.model.FsyncTreeEntry; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `GET /device/{udid}/fsync/tree` — a recursive directory walk over AFC. + */ +@JsonPropertyOrder({ + FsyncTreeListing.JSON_PROPERTY_PATH, + FsyncTreeListing.JSON_PROPERTY_ENTRIES, + FsyncTreeListing.JSON_PROPERTY_COUNT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class FsyncTreeListing { + public static final String JSON_PROPERTY_PATH = "path"; + @jakarta.annotation.Nonnull + private String path; + + public static final String JSON_PROPERTY_ENTRIES = "entries"; + @jakarta.annotation.Nonnull + private List entries = new ArrayList<>(); + + public static final String JSON_PROPERTY_COUNT = "count"; + @jakarta.annotation.Nonnull + private Integer count; + + public FsyncTreeListing() { + } + + public FsyncTreeListing path(@jakarta.annotation.Nonnull String path) { + this.path = path; + return this; + } + + /** + * The root (cleaned) device path. + * @return path + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPath() { + return path; + } + + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPath(@jakarta.annotation.Nonnull String path) { + this.path = path; + } + + + public FsyncTreeListing entries(@jakarta.annotation.Nonnull List entries) { + this.entries = entries; + return this; + } + + public FsyncTreeListing addEntriesItem(FsyncTreeEntry entriesItem) { + if (this.entries == null) { + this.entries = new ArrayList<>(); + } + this.entries.add(entriesItem); + return this; + } + + /** + * Flattened list of entries in the subtree. + * @return entries + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ENTRIES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getEntries() { + return entries; + } + + + @JsonProperty(JSON_PROPERTY_ENTRIES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEntries(@jakarta.annotation.Nonnull List entries) { + this.entries = entries; + } + + + public FsyncTreeListing count(@jakarta.annotation.Nonnull Integer count) { + this.count = count; + return this; + } + + /** + * Number of entries. + * @return count + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getCount() { + return count; + } + + + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCount(@jakarta.annotation.Nonnull Integer count) { + this.count = count; + } + + + /** + * Return true if this FsyncTreeListing object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FsyncTreeListing fsyncTreeListing = (FsyncTreeListing) o; + return Objects.equals(this.path, fsyncTreeListing.path) && + Objects.equals(this.entries, fsyncTreeListing.entries) && + Objects.equals(this.count, fsyncTreeListing.count); + } + + @Override + public int hashCode() { + return Objects.hash(path, entries, count); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FsyncTreeListing {\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" entries: ").append(toIndentedString(entries)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%spath%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPath()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `entries` to the URL query string + if (getEntries() != null) { + for (int i = 0; i < getEntries().size(); i++) { + if (getEntries().get(i) != null) { + joiner.add(getEntries().get(i).toUrlQueryString(String.format("%sentries%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `count` to the URL query string + if (getCount() != null) { + joiner.add(String.format("%scount%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getCount()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/GenericResponse.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/GenericResponse.java new file mode 100644 index 000000000..25fba1b8d --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/GenericResponse.java @@ -0,0 +1,187 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * The dominant response envelope used across the API. Success responses set `message`; error responses set `error`. Streaming/middleware paths that emit `gin.H{\"error\"|\"message\"}` are compatible with this shape. + */ +@JsonPropertyOrder({ + GenericResponse.JSON_PROPERTY_MESSAGE, + GenericResponse.JSON_PROPERTY_ERROR +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class GenericResponse { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_ERROR = "error"; + @jakarta.annotation.Nullable + private String error; + + public GenericResponse() { + } + + public GenericResponse message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Human-readable success or status message. + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + public GenericResponse error(@jakarta.annotation.Nullable String error) { + this.error = error; + return this; + } + + /** + * Human-readable error message. Present on failures. + * @return error + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getError() { + return error; + } + + + @JsonProperty(JSON_PROPERTY_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setError(@jakarta.annotation.Nullable String error) { + this.error = error; + } + + + /** + * Return true if this GenericResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GenericResponse genericResponse = (GenericResponse) o; + return Objects.equals(this.message, genericResponse.message) && + Objects.equals(this.error, genericResponse.error); + } + + @Override + public int hashCode() { + return Objects.hash(message, error); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GenericResponse {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format("%smessage%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getMessage()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `error` to the URL query string + if (getError() != null) { + joiner.add(String.format("%serror%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getError()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/Job.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/Job.java new file mode 100644 index 000000000..7951b4fcb --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/Job.java @@ -0,0 +1,405 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.github.danielpaulus.goios.generated.model.JobStatus; +import java.time.OffsetDateTime; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * A long-running operation started via the REST API (test run, WDA runner, port forward). Mirrors the server's `jobView`. + */ +@JsonPropertyOrder({ + Job.JSON_PROPERTY_ID, + Job.JSON_PROPERTY_KIND, + Job.JSON_PROPERTY_UDID, + Job.JSON_PROPERTY_STATUS, + Job.JSON_PROPERTY_STARTED_AT, + Job.JSON_PROPERTY_FINISHED_AT, + Job.JSON_PROPERTY_ERROR, + Job.JSON_PROPERTY_RESULT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class Job { + public static final String JSON_PROPERTY_ID = "id"; + @jakarta.annotation.Nonnull + private String id; + + public static final String JSON_PROPERTY_KIND = "kind"; + @jakarta.annotation.Nonnull + private String kind; + + public static final String JSON_PROPERTY_UDID = "udid"; + @jakarta.annotation.Nonnull + private String udid; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nonnull + private JobStatus status; + + public static final String JSON_PROPERTY_STARTED_AT = "startedAt"; + @jakarta.annotation.Nonnull + private OffsetDateTime startedAt; + + public static final String JSON_PROPERTY_FINISHED_AT = "finishedAt"; + @jakarta.annotation.Nullable + private OffsetDateTime finishedAt; + + public static final String JSON_PROPERTY_ERROR = "error"; + @jakarta.annotation.Nullable + private String error; + + public static final String JSON_PROPERTY_RESULT = "result"; + @jakarta.annotation.Nullable + private Object result = null; + + public Job() { + } + + public Job id(@jakarta.annotation.Nonnull String id) { + this.id = id; + return this; + } + + /** + * Opaque job id, e.g. `runtest-3`. + * @return id + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(@jakarta.annotation.Nonnull String id) { + this.id = id; + } + + + public Job kind(@jakarta.annotation.Nonnull String kind) { + this.kind = kind; + return this; + } + + /** + * Job kind: `runtest`, `runwda` or `forward`. + * @return kind + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getKind() { + return kind; + } + + + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setKind(@jakarta.annotation.Nonnull String kind) { + this.kind = kind; + } + + + public Job udid(@jakarta.annotation.Nonnull String udid) { + this.udid = udid; + return this; + } + + /** + * The device udid the job runs on. + * @return udid + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_UDID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUdid() { + return udid; + } + + + @JsonProperty(JSON_PROPERTY_UDID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUdid(@jakarta.annotation.Nonnull String udid) { + this.udid = udid; + } + + + public Job status(@jakarta.annotation.Nonnull JobStatus status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public JobStatus getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(@jakarta.annotation.Nonnull JobStatus status) { + this.status = status; + } + + + public Job startedAt(@jakarta.annotation.Nonnull OffsetDateTime startedAt) { + this.startedAt = startedAt; + return this; + } + + /** + * When the job started (ISO-8601). + * @return startedAt + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STARTED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getStartedAt() { + return startedAt; + } + + + @JsonProperty(JSON_PROPERTY_STARTED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStartedAt(@jakarta.annotation.Nonnull OffsetDateTime startedAt) { + this.startedAt = startedAt; + } + + + public Job finishedAt(@jakarta.annotation.Nullable OffsetDateTime finishedAt) { + this.finishedAt = finishedAt; + return this; + } + + /** + * When the job reached a terminal state (absent while running). + * @return finishedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FINISHED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getFinishedAt() { + return finishedAt; + } + + + @JsonProperty(JSON_PROPERTY_FINISHED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFinishedAt(@jakarta.annotation.Nullable OffsetDateTime finishedAt) { + this.finishedAt = finishedAt; + } + + + public Job error(@jakarta.annotation.Nullable String error) { + this.error = error; + return this; + } + + /** + * Error message when `status` is `failed`. + * @return error + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getError() { + return error; + } + + + @JsonProperty(JSON_PROPERTY_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setError(@jakarta.annotation.Nullable String error) { + this.error = error; + } + + + public Job result(@jakarta.annotation.Nullable Object result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getResult() { + return result; + } + + + @JsonProperty(JSON_PROPERTY_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResult(@jakarta.annotation.Nullable Object result) { + this.result = result; + } + + + /** + * Return true if this Job object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Job job = (Job) o; + return Objects.equals(this.id, job.id) && + Objects.equals(this.kind, job.kind) && + Objects.equals(this.udid, job.udid) && + Objects.equals(this.status, job.status) && + Objects.equals(this.startedAt, job.startedAt) && + Objects.equals(this.finishedAt, job.finishedAt) && + Objects.equals(this.error, job.error) && + Objects.equals(this.result, job.result); + } + + @Override + public int hashCode() { + return Objects.hash(id, kind, udid, status, startedAt, finishedAt, error, result); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Job {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" udid: ").append(toIndentedString(udid)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" startedAt: ").append(toIndentedString(startedAt)).append("\n"); + sb.append(" finishedAt: ").append(toIndentedString(finishedAt)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `kind` to the URL query string + if (getKind() != null) { + joiner.add(String.format("%skind%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getKind()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `udid` to the URL query string + if (getUdid() != null) { + joiner.add(String.format("%sudid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getUdid()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(getStatus().toUrlQueryString(prefix + "status" + suffix)); + } + + // add `startedAt` to the URL query string + if (getStartedAt() != null) { + joiner.add(String.format("%sstartedAt%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getStartedAt()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `finishedAt` to the URL query string + if (getFinishedAt() != null) { + joiner.add(String.format("%sfinishedAt%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getFinishedAt()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `error` to the URL query string + if (getError() != null) { + joiner.add(String.format("%serror%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getError()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `result` to the URL query string + if (getResult() != null) { + joiner.add(String.format("%sresult%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getResult()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/JobLogEvents.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/JobLogEvents.java new file mode 100644 index 000000000..fdf6b55fc --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/JobLogEvents.java @@ -0,0 +1,243 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.github.danielpaulus.goios.generated.model.JobLogLine; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import com.github.danielpaulus.goios.generated.invoker.JSON; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +@JsonDeserialize(using=JobLogEvents.JobLogEventsDeserializer.class) +@JsonSerialize(using = JobLogEvents.JobLogEventsSerializer.class) +public class JobLogEvents extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(JobLogEvents.class.getName()); + + public static class JobLogEventsSerializer extends StdSerializer { + public JobLogEventsSerializer(Class t) { + super(t); + } + + public JobLogEventsSerializer() { + this(null); + } + + @Override + public void serialize(JobLogEvents value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class JobLogEventsDeserializer extends StdDeserializer { + public JobLogEventsDeserializer() { + this(JobLogEvents.class); + } + + public JobLogEventsDeserializer(Class vc) { + super(vc); + } + + @Override + public JobLogEvents deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + + Object deserialized = null; + // deserialize JobLogLine + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(JobLogLine.class); + JobLogEvents ret = new JobLogEvents(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'JobLogEvents'", e); + } + + // deserialize Object + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Object.class); + JobLogEvents ret = new JobLogEvents(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'JobLogEvents'", e); + } + + throw new IOException(String.format("Failed deserialization for JobLogEvents: no match found")); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public JobLogEvents getNullValue(DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "JobLogEvents cannot be null"); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public JobLogEvents() { + super("anyOf", Boolean.FALSE); + } + + public JobLogEvents(JobLogLine o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + public JobLogEvents(Object o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("JobLogLine", JobLogLine.class); + schemas.put("Object", Object.class); + JSON.registerDescendants(JobLogEvents.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map> getSchemas() { + return JobLogEvents.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check + * the instance parameter is valid against the anyOf child schemas: + * JobLogLine, Object + * + * It could be an instance of the 'anyOf' schemas. + * The anyOf child schemas may themselves be a composed schema (allOf, anyOf, anyOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(JobLogLine.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(Object.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be JobLogLine, Object"); + } + + /** + * Get the actual instance, which can be the following: + * JobLogLine, Object + * + * @return The actual instance (JobLogLine, Object) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `JobLogLine`. If the actual instance is not `JobLogLine`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `JobLogLine` + * @throws ClassCastException if the instance is not `JobLogLine` + */ + public JobLogLine getJobLogLine() throws ClassCastException { + return (JobLogLine)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + return null; + } + +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/JobLogLine.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/JobLogLine.java new file mode 100644 index 000000000..e3ab9c8dc --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/JobLogLine.java @@ -0,0 +1,151 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * A single line of a job's log output. + */ +@JsonPropertyOrder({ + JobLogLine.JSON_PROPERTY_LINE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class JobLogLine { + public static final String JSON_PROPERTY_LINE = "line"; + @jakarta.annotation.Nonnull + private String line; + + public JobLogLine() { + } + + public JobLogLine line(@jakarta.annotation.Nonnull String line) { + this.line = line; + return this; + } + + /** + * The raw log line (already newline-terminated in the buffer). + * @return line + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LINE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getLine() { + return line; + } + + + @JsonProperty(JSON_PROPERTY_LINE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setLine(@jakarta.annotation.Nonnull String line) { + this.line = line; + } + + + /** + * Return true if this JobLogLine object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JobLogLine jobLogLine = (JobLogLine) o; + return Objects.equals(this.line, jobLogLine.line); + } + + @Override + public int hashCode() { + return Objects.hash(line); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JobLogLine {\n"); + sb.append(" line: ").append(toIndentedString(line)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `line` to the URL query string + if (getLine() != null) { + joiner.add(String.format("%sline%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getLine()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/JobStatus.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/JobStatus.java new file mode 100644 index 000000000..338ec23c0 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/JobStatus.java @@ -0,0 +1,203 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import com.github.danielpaulus.goios.generated.invoker.JSON; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +@JsonDeserialize(using=JobStatus.JobStatusDeserializer.class) +@JsonSerialize(using = JobStatus.JobStatusSerializer.class) +public class JobStatus extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(JobStatus.class.getName()); + + public static class JobStatusSerializer extends StdSerializer { + public JobStatusSerializer(Class t) { + super(t); + } + + public JobStatusSerializer() { + this(null); + } + + @Override + public void serialize(JobStatus value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class JobStatusDeserializer extends StdDeserializer { + public JobStatusDeserializer() { + this(JobStatus.class); + } + + public JobStatusDeserializer(Class vc) { + super(vc); + } + + @Override + public JobStatus deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + + Object deserialized = null; + // deserialize String + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(String.class); + JobStatus ret = new JobStatus(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'JobStatus'", e); + } + + throw new IOException(String.format("Failed deserialization for JobStatus: no match found")); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public JobStatus getNullValue(DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "JobStatus cannot be null"); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public JobStatus() { + super("anyOf", Boolean.FALSE); + } + + public JobStatus(String o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", String.class); + JSON.registerDescendants(JobStatus.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map> getSchemas() { + return JobStatus.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check + * the instance parameter is valid against the anyOf child schemas: + * String + * + * It could be an instance of the 'anyOf' schemas. + * The anyOf child schemas may themselves be a composed schema (allOf, anyOf, anyOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(String.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be String"); + } + + /** + * Get the actual instance, which can be the following: + * String + * + * @return The actual instance (String) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + return null; + } + +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/LanguageConfiguration.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/LanguageConfiguration.java new file mode 100644 index 000000000..f8d29a9c8 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/LanguageConfiguration.java @@ -0,0 +1,285 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * Language/locale configuration (`ios.LanguageConfiguration`), returned by `GET/PUT /device/{udid}/lang`. + */ +@JsonPropertyOrder({ + LanguageConfiguration.JSON_PROPERTY_LANGUAGE, + LanguageConfiguration.JSON_PROPERTY_LOCALE, + LanguageConfiguration.JSON_PROPERTY_SUPPORTED_LOCALES, + LanguageConfiguration.JSON_PROPERTY_SUPPORTED_LANGUAGES +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class LanguageConfiguration { + public static final String JSON_PROPERTY_LANGUAGE = "Language"; + @jakarta.annotation.Nullable + private String language; + + public static final String JSON_PROPERTY_LOCALE = "Locale"; + @jakarta.annotation.Nullable + private String locale; + + public static final String JSON_PROPERTY_SUPPORTED_LOCALES = "SupportedLocales"; + @jakarta.annotation.Nullable + private List supportedLocales = new ArrayList<>(); + + public static final String JSON_PROPERTY_SUPPORTED_LANGUAGES = "SupportedLanguages"; + @jakarta.annotation.Nullable + private List supportedLanguages = new ArrayList<>(); + + public LanguageConfiguration() { + } + + public LanguageConfiguration language(@jakarta.annotation.Nullable String language) { + this.language = language; + return this; + } + + /** + * Get language + * @return language + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLanguage() { + return language; + } + + + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLanguage(@jakarta.annotation.Nullable String language) { + this.language = language; + } + + + public LanguageConfiguration locale(@jakarta.annotation.Nullable String locale) { + this.locale = locale; + return this; + } + + /** + * Get locale + * @return locale + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOCALE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLocale() { + return locale; + } + + + @JsonProperty(JSON_PROPERTY_LOCALE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocale(@jakarta.annotation.Nullable String locale) { + this.locale = locale; + } + + + public LanguageConfiguration supportedLocales(@jakarta.annotation.Nullable List supportedLocales) { + this.supportedLocales = supportedLocales; + return this; + } + + public LanguageConfiguration addSupportedLocalesItem(String supportedLocalesItem) { + if (this.supportedLocales == null) { + this.supportedLocales = new ArrayList<>(); + } + this.supportedLocales.add(supportedLocalesItem); + return this; + } + + /** + * Supported locales advertised by the device. + * @return supportedLocales + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUPPORTED_LOCALES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSupportedLocales() { + return supportedLocales; + } + + + @JsonProperty(JSON_PROPERTY_SUPPORTED_LOCALES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportedLocales(@jakarta.annotation.Nullable List supportedLocales) { + this.supportedLocales = supportedLocales; + } + + + public LanguageConfiguration supportedLanguages(@jakarta.annotation.Nullable List supportedLanguages) { + this.supportedLanguages = supportedLanguages; + return this; + } + + public LanguageConfiguration addSupportedLanguagesItem(String supportedLanguagesItem) { + if (this.supportedLanguages == null) { + this.supportedLanguages = new ArrayList<>(); + } + this.supportedLanguages.add(supportedLanguagesItem); + return this; + } + + /** + * Supported UI languages advertised by the device. + * @return supportedLanguages + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUPPORTED_LANGUAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSupportedLanguages() { + return supportedLanguages; + } + + + @JsonProperty(JSON_PROPERTY_SUPPORTED_LANGUAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSupportedLanguages(@jakarta.annotation.Nullable List supportedLanguages) { + this.supportedLanguages = supportedLanguages; + } + + + /** + * Return true if this LanguageConfiguration object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LanguageConfiguration languageConfiguration = (LanguageConfiguration) o; + return Objects.equals(this.language, languageConfiguration.language) && + Objects.equals(this.locale, languageConfiguration.locale) && + Objects.equals(this.supportedLocales, languageConfiguration.supportedLocales) && + Objects.equals(this.supportedLanguages, languageConfiguration.supportedLanguages); + } + + @Override + public int hashCode() { + return Objects.hash(language, locale, supportedLocales, supportedLanguages); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LanguageConfiguration {\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" locale: ").append(toIndentedString(locale)).append("\n"); + sb.append(" supportedLocales: ").append(toIndentedString(supportedLocales)).append("\n"); + sb.append(" supportedLanguages: ").append(toIndentedString(supportedLanguages)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Language` to the URL query string + if (getLanguage() != null) { + joiner.add(String.format("%sLanguage%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getLanguage()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `Locale` to the URL query string + if (getLocale() != null) { + joiner.add(String.format("%sLocale%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getLocale()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `SupportedLocales` to the URL query string + if (getSupportedLocales() != null) { + for (int i = 0; i < getSupportedLocales().size(); i++) { + joiner.add(String.format("%sSupportedLocales%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(ApiClient.valueToString(getSupportedLocales().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + + // add `SupportedLanguages` to the URL query string + if (getSupportedLanguages() != null) { + for (int i = 0; i < getSupportedLanguages().size(); i++) { + joiner.add(String.format("%sSupportedLanguages%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(ApiClient.valueToString(getSupportedLanguages().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/ListenEvents.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/ListenEvents.java new file mode 100644 index 000000000..2c8bc8fc0 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/ListenEvents.java @@ -0,0 +1,244 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.github.danielpaulus.goios.generated.model.AttachDetachEvent; +import com.github.danielpaulus.goios.generated.model.DeviceProperties; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import com.github.danielpaulus.goios.generated.invoker.JSON; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +@JsonDeserialize(using=ListenEvents.ListenEventsDeserializer.class) +@JsonSerialize(using = ListenEvents.ListenEventsSerializer.class) +public class ListenEvents extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(ListenEvents.class.getName()); + + public static class ListenEventsSerializer extends StdSerializer { + public ListenEventsSerializer(Class t) { + super(t); + } + + public ListenEventsSerializer() { + this(null); + } + + @Override + public void serialize(ListenEvents value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class ListenEventsDeserializer extends StdDeserializer { + public ListenEventsDeserializer() { + this(ListenEvents.class); + } + + public ListenEventsDeserializer(Class vc) { + super(vc); + } + + @Override + public ListenEvents deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + + Object deserialized = null; + // deserialize AttachDetachEvent + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(AttachDetachEvent.class); + ListenEvents ret = new ListenEvents(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'ListenEvents'", e); + } + + // deserialize Object + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Object.class); + ListenEvents ret = new ListenEvents(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'ListenEvents'", e); + } + + throw new IOException(String.format("Failed deserialization for ListenEvents: no match found")); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public ListenEvents getNullValue(DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "ListenEvents cannot be null"); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public ListenEvents() { + super("anyOf", Boolean.FALSE); + } + + public ListenEvents(AttachDetachEvent o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + public ListenEvents(Object o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("AttachDetachEvent", AttachDetachEvent.class); + schemas.put("Object", Object.class); + JSON.registerDescendants(ListenEvents.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map> getSchemas() { + return ListenEvents.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check + * the instance parameter is valid against the anyOf child schemas: + * AttachDetachEvent, Object + * + * It could be an instance of the 'anyOf' schemas. + * The anyOf child schemas may themselves be a composed schema (allOf, anyOf, anyOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(AttachDetachEvent.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(Object.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be AttachDetachEvent, Object"); + } + + /** + * Get the actual instance, which can be the following: + * AttachDetachEvent, Object + * + * @return The actual instance (AttachDetachEvent, Object) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `AttachDetachEvent`. If the actual instance is not `AttachDetachEvent`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AttachDetachEvent` + * @throws ClassCastException if the instance is not `AttachDetachEvent` + */ + public AttachDetachEvent getAttachDetachEvent() throws ClassCastException { + return (AttachDetachEvent)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + return null; + } + +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/MemLimitRequest.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/MemLimitRequest.java new file mode 100644 index 000000000..0c9f6f515 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/MemLimitRequest.java @@ -0,0 +1,151 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `POST /device/{udid}/memlimitoff` request. + */ +@JsonPropertyOrder({ + MemLimitRequest.JSON_PROPERTY_PROCESS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class MemLimitRequest { + public static final String JSON_PROPERTY_PROCESS = "process"; + @jakarta.annotation.Nonnull + private String process; + + public MemLimitRequest() { + } + + public MemLimitRequest process(@jakarta.annotation.Nonnull String process) { + this.process = process; + return this; + } + + /** + * Process name whose memory limit should be waived. + * @return process + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PROCESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getProcess() { + return process; + } + + + @JsonProperty(JSON_PROPERTY_PROCESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setProcess(@jakarta.annotation.Nonnull String process) { + this.process = process; + } + + + /** + * Return true if this MemLimitRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MemLimitRequest memLimitRequest = (MemLimitRequest) o; + return Objects.equals(this.process, memLimitRequest.process); + } + + @Override + public int hashCode() { + return Objects.hash(process); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MemLimitRequest {\n"); + sb.append(" process: ").append(toIndentedString(process)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `process` to the URL query string + if (getProcess() != null) { + joiner.add(String.format("%sprocess%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getProcess()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/MemLimitResult.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/MemLimitResult.java new file mode 100644 index 000000000..1c5c1d384 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/MemLimitResult.java @@ -0,0 +1,223 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `POST /device/{udid}/memlimitoff` response. + */ +@JsonPropertyOrder({ + MemLimitResult.JSON_PROPERTY_PROCESS, + MemLimitResult.JSON_PROPERTY_PID, + MemLimitResult.JSON_PROPERTY_DISABLED +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class MemLimitResult { + public static final String JSON_PROPERTY_PROCESS = "process"; + @jakarta.annotation.Nonnull + private String process; + + public static final String JSON_PROPERTY_PID = "pid"; + @jakarta.annotation.Nonnull + private Integer pid; + + public static final String JSON_PROPERTY_DISABLED = "disabled"; + @jakarta.annotation.Nonnull + private Boolean disabled; + + public MemLimitResult() { + } + + public MemLimitResult process(@jakarta.annotation.Nonnull String process) { + this.process = process; + return this; + } + + /** + * Get process + * @return process + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PROCESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getProcess() { + return process; + } + + + @JsonProperty(JSON_PROPERTY_PROCESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setProcess(@jakarta.annotation.Nonnull String process) { + this.process = process; + } + + + public MemLimitResult pid(@jakarta.annotation.Nonnull Integer pid) { + this.pid = pid; + return this; + } + + /** + * Get pid + * @return pid + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getPid() { + return pid; + } + + + @JsonProperty(JSON_PROPERTY_PID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPid(@jakarta.annotation.Nonnull Integer pid) { + this.pid = pid; + } + + + public MemLimitResult disabled(@jakarta.annotation.Nonnull Boolean disabled) { + this.disabled = disabled; + return this; + } + + /** + * Get disabled + * @return disabled + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DISABLED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getDisabled() { + return disabled; + } + + + @JsonProperty(JSON_PROPERTY_DISABLED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDisabled(@jakarta.annotation.Nonnull Boolean disabled) { + this.disabled = disabled; + } + + + /** + * Return true if this MemLimitResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MemLimitResult memLimitResult = (MemLimitResult) o; + return Objects.equals(this.process, memLimitResult.process) && + Objects.equals(this.pid, memLimitResult.pid) && + Objects.equals(this.disabled, memLimitResult.disabled); + } + + @Override + public int hashCode() { + return Objects.hash(process, pid, disabled); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MemLimitResult {\n"); + sb.append(" process: ").append(toIndentedString(process)).append("\n"); + sb.append(" pid: ").append(toIndentedString(pid)).append("\n"); + sb.append(" disabled: ").append(toIndentedString(disabled)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `process` to the URL query string + if (getProcess() != null) { + joiner.add(String.format("%sprocess%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getProcess()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `pid` to the URL query string + if (getPid() != null) { + joiner.add(String.format("%spid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPid()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `disabled` to the URL query string + if (getDisabled() != null) { + joiner.add(String.format("%sdisabled%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getDisabled()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/MountedImages.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/MountedImages.java new file mode 100644 index 000000000..ec9f8e537 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/MountedImages.java @@ -0,0 +1,201 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `GET /device/{udid}/image/list` — mounted DDI signatures. + */ +@JsonPropertyOrder({ + MountedImages.JSON_PROPERTY_SIGNATURES, + MountedImages.JSON_PROPERTY_COUNT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class MountedImages { + public static final String JSON_PROPERTY_SIGNATURES = "signatures"; + @jakarta.annotation.Nonnull + private List signatures = new ArrayList<>(); + + public static final String JSON_PROPERTY_COUNT = "count"; + @jakarta.annotation.Nonnull + private Integer count; + + public MountedImages() { + } + + public MountedImages signatures(@jakarta.annotation.Nonnull List signatures) { + this.signatures = signatures; + return this; + } + + public MountedImages addSignaturesItem(String signaturesItem) { + if (this.signatures == null) { + this.signatures = new ArrayList<>(); + } + this.signatures.add(signaturesItem); + return this; + } + + /** + * Hex-encoded image signatures. + * @return signatures + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIGNATURES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getSignatures() { + return signatures; + } + + + @JsonProperty(JSON_PROPERTY_SIGNATURES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSignatures(@jakarta.annotation.Nonnull List signatures) { + this.signatures = signatures; + } + + + public MountedImages count(@jakarta.annotation.Nonnull Integer count) { + this.count = count; + return this; + } + + /** + * Get count + * @return count + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getCount() { + return count; + } + + + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCount(@jakarta.annotation.Nonnull Integer count) { + this.count = count; + } + + + /** + * Return true if this MountedImages object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MountedImages mountedImages = (MountedImages) o; + return Objects.equals(this.signatures, mountedImages.signatures) && + Objects.equals(this.count, mountedImages.count); + } + + @Override + public int hashCode() { + return Objects.hash(signatures, count); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MountedImages {\n"); + sb.append(" signatures: ").append(toIndentedString(signatures)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `signatures` to the URL query string + if (getSignatures() != null) { + for (int i = 0; i < getSignatures().size(); i++) { + joiner.add(String.format("%ssignatures%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(ApiClient.valueToString(getSignatures().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + + // add `count` to the URL query string + if (getCount() != null) { + joiner.add(String.format("%scount%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getCount()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/NetworkInfo.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/NetworkInfo.java new file mode 100644 index 000000000..efb8cb0fe --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/NetworkInfo.java @@ -0,0 +1,223 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `GET /device/{udid}/ip` — device network info discovered over pcapd (`pcap.NetworkInfo`). + */ +@JsonPropertyOrder({ + NetworkInfo.JSON_PROPERTY_MAC_ADDRESS, + NetworkInfo.JSON_PROPERTY_IPV4, + NetworkInfo.JSON_PROPERTY_IPV6 +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class NetworkInfo { + public static final String JSON_PROPERTY_MAC_ADDRESS = "MacAddress"; + @jakarta.annotation.Nullable + private String macAddress; + + public static final String JSON_PROPERTY_IPV4 = "IPv4"; + @jakarta.annotation.Nullable + private String ipv4; + + public static final String JSON_PROPERTY_IPV6 = "IPv6"; + @jakarta.annotation.Nullable + private String ipv6; + + public NetworkInfo() { + } + + public NetworkInfo macAddress(@jakarta.annotation.Nullable String macAddress) { + this.macAddress = macAddress; + return this; + } + + /** + * Hardware (MAC) address. + * @return macAddress + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAC_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMacAddress() { + return macAddress; + } + + + @JsonProperty(JSON_PROPERTY_MAC_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMacAddress(@jakarta.annotation.Nullable String macAddress) { + this.macAddress = macAddress; + } + + + public NetworkInfo ipv4(@jakarta.annotation.Nullable String ipv4) { + this.ipv4 = ipv4; + return this; + } + + /** + * IPv4 address, when discovered. + * @return ipv4 + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IPV4) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIpv4() { + return ipv4; + } + + + @JsonProperty(JSON_PROPERTY_IPV4) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIpv4(@jakarta.annotation.Nullable String ipv4) { + this.ipv4 = ipv4; + } + + + public NetworkInfo ipv6(@jakarta.annotation.Nullable String ipv6) { + this.ipv6 = ipv6; + return this; + } + + /** + * IPv6 address, when discovered. + * @return ipv6 + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IPV6) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIpv6() { + return ipv6; + } + + + @JsonProperty(JSON_PROPERTY_IPV6) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIpv6(@jakarta.annotation.Nullable String ipv6) { + this.ipv6 = ipv6; + } + + + /** + * Return true if this NetworkInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NetworkInfo networkInfo = (NetworkInfo) o; + return Objects.equals(this.macAddress, networkInfo.macAddress) && + Objects.equals(this.ipv4, networkInfo.ipv4) && + Objects.equals(this.ipv6, networkInfo.ipv6); + } + + @Override + public int hashCode() { + return Objects.hash(macAddress, ipv4, ipv6); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NetworkInfo {\n"); + sb.append(" macAddress: ").append(toIndentedString(macAddress)).append("\n"); + sb.append(" ipv4: ").append(toIndentedString(ipv4)).append("\n"); + sb.append(" ipv6: ").append(toIndentedString(ipv6)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `MacAddress` to the URL query string + if (getMacAddress() != null) { + joiner.add(String.format("%sMacAddress%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getMacAddress()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `IPv4` to the URL query string + if (getIpv4() != null) { + joiner.add(String.format("%sIPv4%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getIpv4()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `IPv6` to the URL query string + if (getIpv6() != null) { + joiner.add(String.format("%sIPv6%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getIpv6()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/NotificationEvents.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/NotificationEvents.java new file mode 100644 index 000000000..8cb9a2323 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/NotificationEvents.java @@ -0,0 +1,243 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.github.danielpaulus.goios.generated.model.AppStateNotification; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import com.github.danielpaulus.goios.generated.invoker.JSON; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +@JsonDeserialize(using=NotificationEvents.NotificationEventsDeserializer.class) +@JsonSerialize(using = NotificationEvents.NotificationEventsSerializer.class) +public class NotificationEvents extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(NotificationEvents.class.getName()); + + public static class NotificationEventsSerializer extends StdSerializer { + public NotificationEventsSerializer(Class t) { + super(t); + } + + public NotificationEventsSerializer() { + this(null); + } + + @Override + public void serialize(NotificationEvents value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class NotificationEventsDeserializer extends StdDeserializer { + public NotificationEventsDeserializer() { + this(NotificationEvents.class); + } + + public NotificationEventsDeserializer(Class vc) { + super(vc); + } + + @Override + public NotificationEvents deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + + Object deserialized = null; + // deserialize AppStateNotification + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(AppStateNotification.class); + NotificationEvents ret = new NotificationEvents(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'NotificationEvents'", e); + } + + // deserialize Object + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Object.class); + NotificationEvents ret = new NotificationEvents(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'NotificationEvents'", e); + } + + throw new IOException(String.format("Failed deserialization for NotificationEvents: no match found")); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public NotificationEvents getNullValue(DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "NotificationEvents cannot be null"); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public NotificationEvents() { + super("anyOf", Boolean.FALSE); + } + + public NotificationEvents(AppStateNotification o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + public NotificationEvents(Object o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("AppStateNotification", AppStateNotification.class); + schemas.put("Object", Object.class); + JSON.registerDescendants(NotificationEvents.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map> getSchemas() { + return NotificationEvents.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check + * the instance parameter is valid against the anyOf child schemas: + * AppStateNotification, Object + * + * It could be an instance of the 'anyOf' schemas. + * The anyOf child schemas may themselves be a composed schema (allOf, anyOf, anyOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(AppStateNotification.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(Object.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be AppStateNotification, Object"); + } + + /** + * Get the actual instance, which can be the following: + * AppStateNotification, Object + * + * @return The actual instance (AppStateNotification, Object) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `AppStateNotification`. If the actual instance is not `AppStateNotification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AppStateNotification` + * @throws ClassCastException if the instance is not `AppStateNotification` + */ + public AppStateNotification getAppStateNotification() throws ClassCastException { + return (AppStateNotification)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + return null; + } + +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/OsTraceEntry.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/OsTraceEntry.java new file mode 100644 index 000000000..2d606c328 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/OsTraceEntry.java @@ -0,0 +1,367 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * A structured os_log trace entry. + */ +@JsonPropertyOrder({ + OsTraceEntry.JSON_PROPERTY_PID, + OsTraceEntry.JSON_PROPERTY_PROCESS_NAME, + OsTraceEntry.JSON_PROPERTY_LEVEL, + OsTraceEntry.JSON_PROPERTY_SUBSYSTEM, + OsTraceEntry.JSON_PROPERTY_CATEGORY, + OsTraceEntry.JSON_PROPERTY_MESSAGE, + OsTraceEntry.JSON_PROPERTY_TIMESTAMP +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class OsTraceEntry { + public static final String JSON_PROPERTY_PID = "pid"; + @jakarta.annotation.Nullable + private Integer pid; + + public static final String JSON_PROPERTY_PROCESS_NAME = "processName"; + @jakarta.annotation.Nullable + private String processName; + + public static final String JSON_PROPERTY_LEVEL = "level"; + @jakarta.annotation.Nullable + private String level; + + public static final String JSON_PROPERTY_SUBSYSTEM = "subsystem"; + @jakarta.annotation.Nullable + private String subsystem; + + public static final String JSON_PROPERTY_CATEGORY = "category"; + @jakarta.annotation.Nullable + private String category; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nonnull + private String message; + + public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; + @jakarta.annotation.Nullable + private Long timestamp; + + public OsTraceEntry() { + } + + public OsTraceEntry pid(@jakarta.annotation.Nullable Integer pid) { + this.pid = pid; + return this; + } + + /** + * Process id that emitted the entry. + * @return pid + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPid() { + return pid; + } + + + @JsonProperty(JSON_PROPERTY_PID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPid(@jakarta.annotation.Nullable Integer pid) { + this.pid = pid; + } + + + public OsTraceEntry processName(@jakarta.annotation.Nullable String processName) { + this.processName = processName; + return this; + } + + /** + * Emitting process/executable name. + * @return processName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROCESS_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProcessName() { + return processName; + } + + + @JsonProperty(JSON_PROPERTY_PROCESS_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProcessName(@jakarta.annotation.Nullable String processName) { + this.processName = processName; + } + + + public OsTraceEntry level(@jakarta.annotation.Nullable String level) { + this.level = level; + return this; + } + + /** + * Log level, e.g. `default`, `info`, `debug`, `error`, `fault`. + * @return level + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLevel() { + return level; + } + + + @JsonProperty(JSON_PROPERTY_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLevel(@jakarta.annotation.Nullable String level) { + this.level = level; + } + + + public OsTraceEntry subsystem(@jakarta.annotation.Nullable String subsystem) { + this.subsystem = subsystem; + return this; + } + + /** + * Subsystem string (e.g. `com.apple.network`). + * @return subsystem + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBSYSTEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubsystem() { + return subsystem; + } + + + @JsonProperty(JSON_PROPERTY_SUBSYSTEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubsystem(@jakarta.annotation.Nullable String subsystem) { + this.subsystem = subsystem; + } + + + public OsTraceEntry category(@jakarta.annotation.Nullable String category) { + this.category = category; + return this; + } + + /** + * Category within the subsystem. + * @return category + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCategory() { + return category; + } + + + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCategory(@jakarta.annotation.Nullable String category) { + this.category = category; + } + + + public OsTraceEntry message(@jakarta.annotation.Nonnull String message) { + this.message = message; + return this; + } + + /** + * The formatted log message. + * @return message + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMessage(@jakarta.annotation.Nonnull String message) { + this.message = message; + } + + + public OsTraceEntry timestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Unix epoch milliseconds when the entry was emitted, if known. + * @return timestamp + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TIMESTAMP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTimestamp() { + return timestamp; + } + + + @JsonProperty(JSON_PROPERTY_TIMESTAMP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTimestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + } + + + /** + * Return true if this OsTraceEntry object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OsTraceEntry osTraceEntry = (OsTraceEntry) o; + return Objects.equals(this.pid, osTraceEntry.pid) && + Objects.equals(this.processName, osTraceEntry.processName) && + Objects.equals(this.level, osTraceEntry.level) && + Objects.equals(this.subsystem, osTraceEntry.subsystem) && + Objects.equals(this.category, osTraceEntry.category) && + Objects.equals(this.message, osTraceEntry.message) && + Objects.equals(this.timestamp, osTraceEntry.timestamp); + } + + @Override + public int hashCode() { + return Objects.hash(pid, processName, level, subsystem, category, message, timestamp); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OsTraceEntry {\n"); + sb.append(" pid: ").append(toIndentedString(pid)).append("\n"); + sb.append(" processName: ").append(toIndentedString(processName)).append("\n"); + sb.append(" level: ").append(toIndentedString(level)).append("\n"); + sb.append(" subsystem: ").append(toIndentedString(subsystem)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `pid` to the URL query string + if (getPid() != null) { + joiner.add(String.format("%spid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPid()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `processName` to the URL query string + if (getProcessName() != null) { + joiner.add(String.format("%sprocessName%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getProcessName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `level` to the URL query string + if (getLevel() != null) { + joiner.add(String.format("%slevel%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getLevel()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `subsystem` to the URL query string + if (getSubsystem() != null) { + joiner.add(String.format("%ssubsystem%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSubsystem()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `category` to the URL query string + if (getCategory() != null) { + joiner.add(String.format("%scategory%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getCategory()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format("%smessage%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getMessage()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `timestamp` to the URL query string + if (getTimestamp() != null) { + joiner.add(String.format("%stimestamp%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getTimestamp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/OsTraceEvents.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/OsTraceEvents.java new file mode 100644 index 000000000..71d559676 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/OsTraceEvents.java @@ -0,0 +1,243 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.github.danielpaulus.goios.generated.model.OsTraceEntry; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import com.github.danielpaulus.goios.generated.invoker.JSON; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +@JsonDeserialize(using=OsTraceEvents.OsTraceEventsDeserializer.class) +@JsonSerialize(using = OsTraceEvents.OsTraceEventsSerializer.class) +public class OsTraceEvents extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(OsTraceEvents.class.getName()); + + public static class OsTraceEventsSerializer extends StdSerializer { + public OsTraceEventsSerializer(Class t) { + super(t); + } + + public OsTraceEventsSerializer() { + this(null); + } + + @Override + public void serialize(OsTraceEvents value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class OsTraceEventsDeserializer extends StdDeserializer { + public OsTraceEventsDeserializer() { + this(OsTraceEvents.class); + } + + public OsTraceEventsDeserializer(Class vc) { + super(vc); + } + + @Override + public OsTraceEvents deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + + Object deserialized = null; + // deserialize Object + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Object.class); + OsTraceEvents ret = new OsTraceEvents(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'OsTraceEvents'", e); + } + + // deserialize OsTraceEntry + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(OsTraceEntry.class); + OsTraceEvents ret = new OsTraceEvents(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'OsTraceEvents'", e); + } + + throw new IOException(String.format("Failed deserialization for OsTraceEvents: no match found")); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public OsTraceEvents getNullValue(DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "OsTraceEvents cannot be null"); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public OsTraceEvents() { + super("anyOf", Boolean.FALSE); + } + + public OsTraceEvents(Object o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + public OsTraceEvents(OsTraceEntry o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Object", Object.class); + schemas.put("OsTraceEntry", OsTraceEntry.class); + JSON.registerDescendants(OsTraceEvents.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map> getSchemas() { + return OsTraceEvents.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check + * the instance parameter is valid against the anyOf child schemas: + * Object, OsTraceEntry + * + * It could be an instance of the 'anyOf' schemas. + * The anyOf child schemas may themselves be a composed schema (allOf, anyOf, anyOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(Object.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(OsTraceEntry.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Object, OsTraceEntry"); + } + + /** + * Get the actual instance, which can be the following: + * Object, OsTraceEntry + * + * @return The actual instance (Object, OsTraceEntry) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * Get the actual instance of `OsTraceEntry`. If the actual instance is not `OsTraceEntry`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `OsTraceEntry` + * @throws ClassCastException if the instance is not `OsTraceEntry` + */ + public OsTraceEntry getOsTraceEntry() throws ClassCastException { + return (OsTraceEntry)super.getActualInstance(); + } + + + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + return null; + } + +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/PasteboardContent.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/PasteboardContent.java new file mode 100644 index 000000000..b94a81d67 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/PasteboardContent.java @@ -0,0 +1,187 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `GET /device/{udid}/pasteboard` — clipboard contents. + */ +@JsonPropertyOrder({ + PasteboardContent.JSON_PROPERTY_PRESENT, + PasteboardContent.JSON_PROPERTY_TEXT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class PasteboardContent { + public static final String JSON_PROPERTY_PRESENT = "present"; + @jakarta.annotation.Nonnull + private Boolean present; + + public static final String JSON_PROPERTY_TEXT = "text"; + @jakarta.annotation.Nonnull + private String text; + + public PasteboardContent() { + } + + public PasteboardContent present(@jakarta.annotation.Nonnull Boolean present) { + this.present = present; + return this; + } + + /** + * Whether any text was present on the pasteboard. + * @return present + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PRESENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getPresent() { + return present; + } + + + @JsonProperty(JSON_PROPERTY_PRESENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPresent(@jakarta.annotation.Nonnull Boolean present) { + this.present = present; + } + + + public PasteboardContent text(@jakarta.annotation.Nonnull String text) { + this.text = text; + return this; + } + + /** + * The clipboard text (empty when `present` is false). + * @return text + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getText() { + return text; + } + + + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setText(@jakarta.annotation.Nonnull String text) { + this.text = text; + } + + + /** + * Return true if this PasteboardContent object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasteboardContent pasteboardContent = (PasteboardContent) o; + return Objects.equals(this.present, pasteboardContent.present) && + Objects.equals(this.text, pasteboardContent.text); + } + + @Override + public int hashCode() { + return Objects.hash(present, text); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasteboardContent {\n"); + sb.append(" present: ").append(toIndentedString(present)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `present` to the URL query string + if (getPresent() != null) { + joiner.add(String.format("%spresent%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPresent()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `text` to the URL query string + if (getText() != null) { + joiner.add(String.format("%stext%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getText()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/PrepareResult.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/PrepareResult.java new file mode 100644 index 000000000..ea09b58bc --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/PrepareResult.java @@ -0,0 +1,187 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `POST /device/{udid}/prepare` — device preparation acknowledgement. + */ +@JsonPropertyOrder({ + PrepareResult.JSON_PROPERTY_STATUS, + PrepareResult.JSON_PROPERTY_SUPERVISED +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class PrepareResult { + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nonnull + private String status; + + public static final String JSON_PROPERTY_SUPERVISED = "supervised"; + @jakarta.annotation.Nonnull + private Boolean supervised; + + public PrepareResult() { + } + + public PrepareResult status(@jakarta.annotation.Nonnull String status) { + this.status = status; + return this; + } + + /** + * Always `prepared`. + * @return status + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(@jakarta.annotation.Nonnull String status) { + this.status = status; + } + + + public PrepareResult supervised(@jakarta.annotation.Nonnull Boolean supervised) { + this.supervised = supervised; + return this; + } + + /** + * Whether the device was supervised (a supervision cert was supplied). + * @return supervised + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SUPERVISED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getSupervised() { + return supervised; + } + + + @JsonProperty(JSON_PROPERTY_SUPERVISED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSupervised(@jakarta.annotation.Nonnull Boolean supervised) { + this.supervised = supervised; + } + + + /** + * Return true if this PrepareResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PrepareResult prepareResult = (PrepareResult) o; + return Objects.equals(this.status, prepareResult.status) && + Objects.equals(this.supervised, prepareResult.supervised); + } + + @Override + public int hashCode() { + return Objects.hash(status, supervised); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PrepareResult {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" supervised: ").append(toIndentedString(supervised)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getStatus()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `supervised` to the URL query string + if (getSupervised() != null) { + joiner.add(String.format("%ssupervised%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSupervised()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/PrepareSkipOptions.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/PrepareSkipOptions.java new file mode 100644 index 000000000..d03101b6a --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/PrepareSkipOptions.java @@ -0,0 +1,201 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `GET /prepare/skip-options` — the static list of setup-pane skip options usable when preparing a device. Host-scoped (device-free). + */ +@JsonPropertyOrder({ + PrepareSkipOptions.JSON_PROPERTY_OPTIONS, + PrepareSkipOptions.JSON_PROPERTY_COUNT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class PrepareSkipOptions { + public static final String JSON_PROPERTY_OPTIONS = "options"; + @jakarta.annotation.Nonnull + private List options = new ArrayList<>(); + + public static final String JSON_PROPERTY_COUNT = "count"; + @jakarta.annotation.Nonnull + private Integer count; + + public PrepareSkipOptions() { + } + + public PrepareSkipOptions options(@jakarta.annotation.Nonnull List options) { + this.options = options; + return this; + } + + public PrepareSkipOptions addOptionsItem(String optionsItem) { + if (this.options == null) { + this.options = new ArrayList<>(); + } + this.options.add(optionsItem); + return this; + } + + /** + * All available skip-option identifiers. + * @return options + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getOptions() { + return options; + } + + + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setOptions(@jakarta.annotation.Nonnull List options) { + this.options = options; + } + + + public PrepareSkipOptions count(@jakarta.annotation.Nonnull Integer count) { + this.count = count; + return this; + } + + /** + * Number of options. + * @return count + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getCount() { + return count; + } + + + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCount(@jakarta.annotation.Nonnull Integer count) { + this.count = count; + } + + + /** + * Return true if this PrepareSkipOptions object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PrepareSkipOptions prepareSkipOptions = (PrepareSkipOptions) o; + return Objects.equals(this.options, prepareSkipOptions.options) && + Objects.equals(this.count, prepareSkipOptions.count); + } + + @Override + public int hashCode() { + return Objects.hash(options, count); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PrepareSkipOptions {\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `options` to the URL query string + if (getOptions() != null) { + for (int i = 0; i < getOptions().size(); i++) { + joiner.add(String.format("%soptions%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(ApiClient.valueToString(getOptions().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + + // add `count` to the URL query string + if (getCount() != null) { + joiner.add(String.format("%scount%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getCount()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/ProcessInfo.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/ProcessInfo.java new file mode 100644 index 000000000..39475177a --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/ProcessInfo.java @@ -0,0 +1,296 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * A running process entry (`instruments.ProcessInfo`) from `GET /device/{udid}/processes`. + */ +@JsonPropertyOrder({ + ProcessInfo.JSON_PROPERTY_PID, + ProcessInfo.JSON_PROPERTY_NAME, + ProcessInfo.JSON_PROPERTY_REAL_APP_NAME, + ProcessInfo.JSON_PROPERTY_IS_APPLICATION, + ProcessInfo.JSON_PROPERTY_START_DATE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class ProcessInfo { + public static final String JSON_PROPERTY_PID = "pid"; + @jakarta.annotation.Nonnull + private Integer pid; + + public static final String JSON_PROPERTY_NAME = "name"; + @jakarta.annotation.Nonnull + private String name; + + public static final String JSON_PROPERTY_REAL_APP_NAME = "realAppName"; + @jakarta.annotation.Nullable + private String realAppName; + + public static final String JSON_PROPERTY_IS_APPLICATION = "isApplication"; + @jakarta.annotation.Nullable + private Boolean isApplication; + + public static final String JSON_PROPERTY_START_DATE = "startDate"; + @jakarta.annotation.Nullable + private OffsetDateTime startDate; + + public ProcessInfo() { + } + + public ProcessInfo pid(@jakarta.annotation.Nonnull Integer pid) { + this.pid = pid; + return this; + } + + /** + * Get pid + * @return pid + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getPid() { + return pid; + } + + + @JsonProperty(JSON_PROPERTY_PID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPid(@jakarta.annotation.Nonnull Integer pid) { + this.pid = pid; + } + + + public ProcessInfo name(@jakarta.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(@jakarta.annotation.Nonnull String name) { + this.name = name; + } + + + public ProcessInfo realAppName(@jakarta.annotation.Nullable String realAppName) { + this.realAppName = realAppName; + return this; + } + + /** + * Get realAppName + * @return realAppName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REAL_APP_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRealAppName() { + return realAppName; + } + + + @JsonProperty(JSON_PROPERTY_REAL_APP_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRealAppName(@jakarta.annotation.Nullable String realAppName) { + this.realAppName = realAppName; + } + + + public ProcessInfo isApplication(@jakarta.annotation.Nullable Boolean isApplication) { + this.isApplication = isApplication; + return this; + } + + /** + * Get isApplication + * @return isApplication + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_APPLICATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsApplication() { + return isApplication; + } + + + @JsonProperty(JSON_PROPERTY_IS_APPLICATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsApplication(@jakarta.annotation.Nullable Boolean isApplication) { + this.isApplication = isApplication; + } + + + public ProcessInfo startDate(@jakarta.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Process start time, ISO-8601. + * @return startDate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getStartDate() { + return startDate; + } + + + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartDate(@jakarta.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + } + + + /** + * Return true if this ProcessInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProcessInfo processInfo = (ProcessInfo) o; + return Objects.equals(this.pid, processInfo.pid) && + Objects.equals(this.name, processInfo.name) && + Objects.equals(this.realAppName, processInfo.realAppName) && + Objects.equals(this.isApplication, processInfo.isApplication) && + Objects.equals(this.startDate, processInfo.startDate); + } + + @Override + public int hashCode() { + return Objects.hash(pid, name, realAppName, isApplication, startDate); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProcessInfo {\n"); + sb.append(" pid: ").append(toIndentedString(pid)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" realAppName: ").append(toIndentedString(realAppName)).append("\n"); + sb.append(" isApplication: ").append(toIndentedString(isApplication)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `pid` to the URL query string + if (getPid() != null) { + joiner.add(String.format("%spid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPid()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `realAppName` to the URL query string + if (getRealAppName() != null) { + joiner.add(String.format("%srealAppName%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getRealAppName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `isApplication` to the URL query string + if (getIsApplication() != null) { + joiner.add(String.format("%sisApplication%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getIsApplication()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `startDate` to the URL query string + if (getStartDate() != null) { + joiner.add(String.format("%sstartDate%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getStartDate()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/Profile.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/Profile.java new file mode 100644 index 000000000..b8c95b57c --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/Profile.java @@ -0,0 +1,223 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * A single condition profile within a `ProfileType`. + */ +@JsonPropertyOrder({ + Profile.JSON_PROPERTY_DESCRIPTION, + Profile.JSON_PROPERTY_IDENTIFIER, + Profile.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class Profile { + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + @jakarta.annotation.Nullable + private String description; + + public static final String JSON_PROPERTY_IDENTIFIER = "identifier"; + @jakarta.annotation.Nonnull + private String identifier; + + public static final String JSON_PROPERTY_NAME = "name"; + @jakarta.annotation.Nonnull + private String name; + + public Profile() { + } + + public Profile description(@jakarta.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(@jakarta.annotation.Nullable String description) { + this.description = description; + } + + + public Profile identifier(@jakarta.annotation.Nonnull String identifier) { + this.identifier = identifier; + return this; + } + + /** + * Get identifier + * @return identifier + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_IDENTIFIER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getIdentifier() { + return identifier; + } + + + @JsonProperty(JSON_PROPERTY_IDENTIFIER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIdentifier(@jakarta.annotation.Nonnull String identifier) { + this.identifier = identifier; + } + + + public Profile name(@jakarta.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(@jakarta.annotation.Nonnull String name) { + this.name = name; + } + + + /** + * Return true if this Profile object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Profile profile = (Profile) o; + return Objects.equals(this.description, profile.description) && + Objects.equals(this.identifier, profile.identifier) && + Objects.equals(this.name, profile.name); + } + + @Override + public int hashCode() { + return Objects.hash(description, identifier, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Profile {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" identifier: ").append(toIndentedString(identifier)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `description` to the URL query string + if (getDescription() != null) { + joiner.add(String.format("%sdescription%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getDescription()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `identifier` to the URL query string + if (getIdentifier() != null) { + joiner.add(String.format("%sidentifier%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getIdentifier()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/ProfileType.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/ProfileType.java new file mode 100644 index 000000000..2f42cd8f1 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/ProfileType.java @@ -0,0 +1,419 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.github.danielpaulus.goios.generated.model.Profile; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * A condition inducer profile type (e.g. thermal, network) with its variants. + */ +@JsonPropertyOrder({ + ProfileType.JSON_PROPERTY_ACTIVE_PROFILE, + ProfileType.JSON_PROPERTY_IDENTIFIER, + ProfileType.JSON_PROPERTY_PROFILES_SORTED, + ProfileType.JSON_PROPERTY_IS_ACTIVE, + ProfileType.JSON_PROPERTY_NAME, + ProfileType.JSON_PROPERTY_IS_DESTRUCTIVE, + ProfileType.JSON_PROPERTY_IS_INTERNAL, + ProfileType.JSON_PROPERTY_PROFILES +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class ProfileType { + public static final String JSON_PROPERTY_ACTIVE_PROFILE = "activeProfile"; + @jakarta.annotation.Nullable + private String activeProfile; + + public static final String JSON_PROPERTY_IDENTIFIER = "identifier"; + @jakarta.annotation.Nonnull + private String identifier; + + public static final String JSON_PROPERTY_PROFILES_SORTED = "profilesSorted"; + @jakarta.annotation.Nullable + private Boolean profilesSorted; + + public static final String JSON_PROPERTY_IS_ACTIVE = "isActive"; + @jakarta.annotation.Nullable + private Boolean isActive; + + public static final String JSON_PROPERTY_NAME = "name"; + @jakarta.annotation.Nonnull + private String name; + + public static final String JSON_PROPERTY_IS_DESTRUCTIVE = "isDestructive"; + @jakarta.annotation.Nullable + private Boolean isDestructive; + + public static final String JSON_PROPERTY_IS_INTERNAL = "isInternal"; + @jakarta.annotation.Nullable + private Boolean isInternal; + + public static final String JSON_PROPERTY_PROFILES = "profiles"; + @jakarta.annotation.Nonnull + private List profiles = new ArrayList<>(); + + public ProfileType() { + } + + public ProfileType activeProfile(@jakarta.annotation.Nullable String activeProfile) { + this.activeProfile = activeProfile; + return this; + } + + /** + * Get activeProfile + * @return activeProfile + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACTIVE_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getActiveProfile() { + return activeProfile; + } + + + @JsonProperty(JSON_PROPERTY_ACTIVE_PROFILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setActiveProfile(@jakarta.annotation.Nullable String activeProfile) { + this.activeProfile = activeProfile; + } + + + public ProfileType identifier(@jakarta.annotation.Nonnull String identifier) { + this.identifier = identifier; + return this; + } + + /** + * Get identifier + * @return identifier + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_IDENTIFIER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getIdentifier() { + return identifier; + } + + + @JsonProperty(JSON_PROPERTY_IDENTIFIER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIdentifier(@jakarta.annotation.Nonnull String identifier) { + this.identifier = identifier; + } + + + public ProfileType profilesSorted(@jakarta.annotation.Nullable Boolean profilesSorted) { + this.profilesSorted = profilesSorted; + return this; + } + + /** + * Get profilesSorted + * @return profilesSorted + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROFILES_SORTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getProfilesSorted() { + return profilesSorted; + } + + + @JsonProperty(JSON_PROPERTY_PROFILES_SORTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProfilesSorted(@jakarta.annotation.Nullable Boolean profilesSorted) { + this.profilesSorted = profilesSorted; + } + + + public ProfileType isActive(@jakarta.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Get isActive + * @return isActive + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsActive() { + return isActive; + } + + + @JsonProperty(JSON_PROPERTY_IS_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsActive(@jakarta.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + } + + + public ProfileType name(@jakarta.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(@jakarta.annotation.Nonnull String name) { + this.name = name; + } + + + public ProfileType isDestructive(@jakarta.annotation.Nullable Boolean isDestructive) { + this.isDestructive = isDestructive; + return this; + } + + /** + * Get isDestructive + * @return isDestructive + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_DESTRUCTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsDestructive() { + return isDestructive; + } + + + @JsonProperty(JSON_PROPERTY_IS_DESTRUCTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsDestructive(@jakarta.annotation.Nullable Boolean isDestructive) { + this.isDestructive = isDestructive; + } + + + public ProfileType isInternal(@jakarta.annotation.Nullable Boolean isInternal) { + this.isInternal = isInternal; + return this; + } + + /** + * Get isInternal + * @return isInternal + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_INTERNAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsInternal() { + return isInternal; + } + + + @JsonProperty(JSON_PROPERTY_IS_INTERNAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsInternal(@jakarta.annotation.Nullable Boolean isInternal) { + this.isInternal = isInternal; + } + + + public ProfileType profiles(@jakarta.annotation.Nonnull List profiles) { + this.profiles = profiles; + return this; + } + + public ProfileType addProfilesItem(Profile profilesItem) { + if (this.profiles == null) { + this.profiles = new ArrayList<>(); + } + this.profiles.add(profilesItem); + return this; + } + + /** + * Get profiles + * @return profiles + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PROFILES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getProfiles() { + return profiles; + } + + + @JsonProperty(JSON_PROPERTY_PROFILES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setProfiles(@jakarta.annotation.Nonnull List profiles) { + this.profiles = profiles; + } + + + /** + * Return true if this ProfileType object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileType profileType = (ProfileType) o; + return Objects.equals(this.activeProfile, profileType.activeProfile) && + Objects.equals(this.identifier, profileType.identifier) && + Objects.equals(this.profilesSorted, profileType.profilesSorted) && + Objects.equals(this.isActive, profileType.isActive) && + Objects.equals(this.name, profileType.name) && + Objects.equals(this.isDestructive, profileType.isDestructive) && + Objects.equals(this.isInternal, profileType.isInternal) && + Objects.equals(this.profiles, profileType.profiles); + } + + @Override + public int hashCode() { + return Objects.hash(activeProfile, identifier, profilesSorted, isActive, name, isDestructive, isInternal, profiles); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileType {\n"); + sb.append(" activeProfile: ").append(toIndentedString(activeProfile)).append("\n"); + sb.append(" identifier: ").append(toIndentedString(identifier)).append("\n"); + sb.append(" profilesSorted: ").append(toIndentedString(profilesSorted)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" isDestructive: ").append(toIndentedString(isDestructive)).append("\n"); + sb.append(" isInternal: ").append(toIndentedString(isInternal)).append("\n"); + sb.append(" profiles: ").append(toIndentedString(profiles)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `activeProfile` to the URL query string + if (getActiveProfile() != null) { + joiner.add(String.format("%sactiveProfile%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getActiveProfile()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `identifier` to the URL query string + if (getIdentifier() != null) { + joiner.add(String.format("%sidentifier%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getIdentifier()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `profilesSorted` to the URL query string + if (getProfilesSorted() != null) { + joiner.add(String.format("%sprofilesSorted%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getProfilesSorted()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `isActive` to the URL query string + if (getIsActive() != null) { + joiner.add(String.format("%sisActive%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getIsActive()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `isDestructive` to the URL query string + if (getIsDestructive() != null) { + joiner.add(String.format("%sisDestructive%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getIsDestructive()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `isInternal` to the URL query string + if (getIsInternal() != null) { + joiner.add(String.format("%sisInternal%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getIsInternal()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `profiles` to the URL query string + if (getProfiles() != null) { + for (int i = 0; i < getProfiles().size(); i++) { + if (getProfiles().get(i) != null) { + joiner.add(getProfiles().get(i).toUrlQueryString(String.format("%sprofiles%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/ProvisioningResult.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/ProvisioningResult.java new file mode 100644 index 000000000..3364292d8 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/ProvisioningResult.java @@ -0,0 +1,295 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `POST /sign/provision` — provisioning assets envelope. The mobileprovision (and optionally the P12) are base64-encoded so one JSON response can carry both binary artifacts. Host-scoped (device-free). + */ +@JsonPropertyOrder({ + ProvisioningResult.JSON_PROPERTY_BUNDLE_ID, + ProvisioningResult.JSON_PROPERTY_CERTIFICATE_ID, + ProvisioningResult.JSON_PROPERTY_MOBILEPROVISION_BASE64, + ProvisioningResult.JSON_PROPERTY_P12_BASE64, + ProvisioningResult.JSON_PROPERTY_P12_PASSWORD +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class ProvisioningResult { + public static final String JSON_PROPERTY_BUNDLE_ID = "bundleId"; + @jakarta.annotation.Nonnull + private String bundleId; + + public static final String JSON_PROPERTY_CERTIFICATE_ID = "certificateId"; + @jakarta.annotation.Nonnull + private String certificateId; + + public static final String JSON_PROPERTY_MOBILEPROVISION_BASE64 = "mobileprovisionBase64"; + @jakarta.annotation.Nonnull + private String mobileprovisionBase64; + + public static final String JSON_PROPERTY_P12_BASE64 = "p12Base64"; + @jakarta.annotation.Nullable + private String p12Base64; + + public static final String JSON_PROPERTY_P12_PASSWORD = "p12Password"; + @jakarta.annotation.Nullable + private String p12Password; + + public ProvisioningResult() { + } + + public ProvisioningResult bundleId(@jakarta.annotation.Nonnull String bundleId) { + this.bundleId = bundleId; + return this; + } + + /** + * The app bundle identifier registered with App Store Connect. + * @return bundleId + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_BUNDLE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getBundleId() { + return bundleId; + } + + + @JsonProperty(JSON_PROPERTY_BUNDLE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setBundleId(@jakarta.annotation.Nonnull String bundleId) { + this.bundleId = bundleId; + } + + + public ProvisioningResult certificateId(@jakarta.annotation.Nonnull String certificateId) { + this.certificateId = certificateId; + return this; + } + + /** + * The signing certificate resource id. + * @return certificateId + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CERTIFICATE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCertificateId() { + return certificateId; + } + + + @JsonProperty(JSON_PROPERTY_CERTIFICATE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCertificateId(@jakarta.annotation.Nonnull String certificateId) { + this.certificateId = certificateId; + } + + + public ProvisioningResult mobileprovisionBase64(@jakarta.annotation.Nonnull String mobileprovisionBase64) { + this.mobileprovisionBase64 = mobileprovisionBase64; + return this; + } + + /** + * The `.mobileprovision`, base64-encoded. + * @return mobileprovisionBase64 + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MOBILEPROVISION_BASE64) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getMobileprovisionBase64() { + return mobileprovisionBase64; + } + + + @JsonProperty(JSON_PROPERTY_MOBILEPROVISION_BASE64) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMobileprovisionBase64(@jakarta.annotation.Nonnull String mobileprovisionBase64) { + this.mobileprovisionBase64 = mobileprovisionBase64; + } + + + public ProvisioningResult p12Base64(@jakarta.annotation.Nullable String p12Base64) { + this.p12Base64 = p12Base64; + return this; + } + + /** + * The generated `.p12`, base64-encoded (absent when reusing a certificate). + * @return p12Base64 + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_P12_BASE64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getP12Base64() { + return p12Base64; + } + + + @JsonProperty(JSON_PROPERTY_P12_BASE64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setP12Base64(@jakarta.annotation.Nullable String p12Base64) { + this.p12Base64 = p12Base64; + } + + + public ProvisioningResult p12Password(@jakarta.annotation.Nullable String p12Password) { + this.p12Password = p12Password; + return this; + } + + /** + * The password protecting `p12Base64`, echoed back (client-supplied). + * @return p12Password + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_P12_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getP12Password() { + return p12Password; + } + + + @JsonProperty(JSON_PROPERTY_P12_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setP12Password(@jakarta.annotation.Nullable String p12Password) { + this.p12Password = p12Password; + } + + + /** + * Return true if this ProvisioningResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProvisioningResult provisioningResult = (ProvisioningResult) o; + return Objects.equals(this.bundleId, provisioningResult.bundleId) && + Objects.equals(this.certificateId, provisioningResult.certificateId) && + Objects.equals(this.mobileprovisionBase64, provisioningResult.mobileprovisionBase64) && + Objects.equals(this.p12Base64, provisioningResult.p12Base64) && + Objects.equals(this.p12Password, provisioningResult.p12Password); + } + + @Override + public int hashCode() { + return Objects.hash(bundleId, certificateId, mobileprovisionBase64, p12Base64, p12Password); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProvisioningResult {\n"); + sb.append(" bundleId: ").append(toIndentedString(bundleId)).append("\n"); + sb.append(" certificateId: ").append(toIndentedString(certificateId)).append("\n"); + sb.append(" mobileprovisionBase64: ").append(toIndentedString(mobileprovisionBase64)).append("\n"); + sb.append(" p12Base64: ").append(toIndentedString(p12Base64)).append("\n"); + sb.append(" p12Password: ").append(toIndentedString(p12Password)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `bundleId` to the URL query string + if (getBundleId() != null) { + joiner.add(String.format("%sbundleId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getBundleId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `certificateId` to the URL query string + if (getCertificateId() != null) { + joiner.add(String.format("%scertificateId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getCertificateId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `mobileprovisionBase64` to the URL query string + if (getMobileprovisionBase64() != null) { + joiner.add(String.format("%smobileprovisionBase64%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getMobileprovisionBase64()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `p12Base64` to the URL query string + if (getP12Base64() != null) { + joiner.add(String.format("%sp12Base64%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getP12Base64()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `p12Password` to the URL query string + if (getP12Password() != null) { + joiner.add(String.format("%sp12Password%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getP12Password()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/RsdServiceEntry.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/RsdServiceEntry.java new file mode 100644 index 000000000..09e855ae0 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/RsdServiceEntry.java @@ -0,0 +1,187 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * A single RSD (Remote Service Discovery) service entry. + */ +@JsonPropertyOrder({ + RsdServiceEntry.JSON_PROPERTY_PORT, + RsdServiceEntry.JSON_PROPERTY_PROTOCOL_TYPE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class RsdServiceEntry { + public static final String JSON_PROPERTY_PORT = "Port"; + @jakarta.annotation.Nullable + private Integer port; + + public static final String JSON_PROPERTY_PROTOCOL_TYPE = "ProtocolType"; + @jakarta.annotation.Nullable + private String protocolType; + + public RsdServiceEntry() { + } + + public RsdServiceEntry port(@jakarta.annotation.Nullable Integer port) { + this.port = port; + return this; + } + + /** + * TCP port the service is reachable on over the tunnel. + * @return port + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPort() { + return port; + } + + + @JsonProperty(JSON_PROPERTY_PORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPort(@jakarta.annotation.Nullable Integer port) { + this.port = port; + } + + + public RsdServiceEntry protocolType(@jakarta.annotation.Nullable String protocolType) { + this.protocolType = protocolType; + return this; + } + + /** + * Wire protocol (e.g. `tcp`). + * @return protocolType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROTOCOL_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProtocolType() { + return protocolType; + } + + + @JsonProperty(JSON_PROPERTY_PROTOCOL_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProtocolType(@jakarta.annotation.Nullable String protocolType) { + this.protocolType = protocolType; + } + + + /** + * Return true if this RsdServiceEntry object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RsdServiceEntry rsdServiceEntry = (RsdServiceEntry) o; + return Objects.equals(this.port, rsdServiceEntry.port) && + Objects.equals(this.protocolType, rsdServiceEntry.protocolType); + } + + @Override + public int hashCode() { + return Objects.hash(port, protocolType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RsdServiceEntry {\n"); + sb.append(" port: ").append(toIndentedString(port)).append("\n"); + sb.append(" protocolType: ").append(toIndentedString(protocolType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Port` to the URL query string + if (getPort() != null) { + joiner.add(String.format("%sPort%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPort()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `ProtocolType` to the URL query string + if (getProtocolType() != null) { + joiner.add(String.format("%sProtocolType%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getProtocolType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/RunTestRequest.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/RunTestRequest.java new file mode 100644 index 000000000..7d78b0981 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/RunTestRequest.java @@ -0,0 +1,441 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `POST /device/{udid}/jobs/runtest` (and `runwda`) request. + */ +@JsonPropertyOrder({ + RunTestRequest.JSON_PROPERTY_BUNDLE_ID, + RunTestRequest.JSON_PROPERTY_TEST_RUNNER_BUNDLE_ID, + RunTestRequest.JSON_PROPERTY_XCTEST_CONFIG, + RunTestRequest.JSON_PROPERTY_ENV, + RunTestRequest.JSON_PROPERTY_ARGS, + RunTestRequest.JSON_PROPERTY_TESTS_TO_RUN, + RunTestRequest.JSON_PROPERTY_TESTS_TO_SKIP, + RunTestRequest.JSON_PROPERTY_XCTEST +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class RunTestRequest { + public static final String JSON_PROPERTY_BUNDLE_ID = "bundleId"; + @jakarta.annotation.Nullable + private String bundleId; + + public static final String JSON_PROPERTY_TEST_RUNNER_BUNDLE_ID = "testRunnerBundleId"; + @jakarta.annotation.Nullable + private String testRunnerBundleId; + + public static final String JSON_PROPERTY_XCTEST_CONFIG = "xctestConfig"; + @jakarta.annotation.Nullable + private String xctestConfig; + + public static final String JSON_PROPERTY_ENV = "env"; + @jakarta.annotation.Nullable + private Object env; + + public static final String JSON_PROPERTY_ARGS = "args"; + @jakarta.annotation.Nullable + private List args = new ArrayList<>(); + + public static final String JSON_PROPERTY_TESTS_TO_RUN = "testsToRun"; + @jakarta.annotation.Nullable + private List testsToRun = new ArrayList<>(); + + public static final String JSON_PROPERTY_TESTS_TO_SKIP = "testsToSkip"; + @jakarta.annotation.Nullable + private List testsToSkip = new ArrayList<>(); + + public static final String JSON_PROPERTY_XCTEST = "xctest"; + @jakarta.annotation.Nullable + private Boolean xctest; + + public RunTestRequest() { + } + + public RunTestRequest bundleId(@jakarta.annotation.Nullable String bundleId) { + this.bundleId = bundleId; + return this; + } + + /** + * Bundle id of the app under test. + * @return bundleId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BUNDLE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBundleId() { + return bundleId; + } + + + @JsonProperty(JSON_PROPERTY_BUNDLE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBundleId(@jakarta.annotation.Nullable String bundleId) { + this.bundleId = bundleId; + } + + + public RunTestRequest testRunnerBundleId(@jakarta.annotation.Nullable String testRunnerBundleId) { + this.testRunnerBundleId = testRunnerBundleId; + return this; + } + + /** + * Bundle id of the test runner. Defaults to `bundleId` if omitted. + * @return testRunnerBundleId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEST_RUNNER_BUNDLE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTestRunnerBundleId() { + return testRunnerBundleId; + } + + + @JsonProperty(JSON_PROPERTY_TEST_RUNNER_BUNDLE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestRunnerBundleId(@jakarta.annotation.Nullable String testRunnerBundleId) { + this.testRunnerBundleId = testRunnerBundleId; + } + + + public RunTestRequest xctestConfig(@jakarta.annotation.Nullable String xctestConfig) { + this.xctestConfig = xctestConfig; + return this; + } + + /** + * Name of the `.xctestconfiguration`. + * @return xctestConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_XCTEST_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getXctestConfig() { + return xctestConfig; + } + + + @JsonProperty(JSON_PROPERTY_XCTEST_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setXctestConfig(@jakarta.annotation.Nullable String xctestConfig) { + this.xctestConfig = xctestConfig; + } + + + public RunTestRequest env(@jakarta.annotation.Nullable Object env) { + this.env = env; + return this; + } + + /** + * Extra environment variables for the test runner. + * @return env + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENV) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getEnv() { + return env; + } + + + @JsonProperty(JSON_PROPERTY_ENV) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnv(@jakarta.annotation.Nullable Object env) { + this.env = env; + } + + + public RunTestRequest args(@jakarta.annotation.Nullable List args) { + this.args = args; + return this; + } + + public RunTestRequest addArgsItem(String argsItem) { + if (this.args == null) { + this.args = new ArrayList<>(); + } + this.args.add(argsItem); + return this; + } + + /** + * Extra process arguments for the test runner. + * @return args + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ARGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArgs() { + return args; + } + + + @JsonProperty(JSON_PROPERTY_ARGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArgs(@jakarta.annotation.Nullable List args) { + this.args = args; + } + + + public RunTestRequest testsToRun(@jakarta.annotation.Nullable List testsToRun) { + this.testsToRun = testsToRun; + return this; + } + + public RunTestRequest addTestsToRunItem(String testsToRunItem) { + if (this.testsToRun == null) { + this.testsToRun = new ArrayList<>(); + } + this.testsToRun.add(testsToRunItem); + return this; + } + + /** + * Only run these tests (`Class/method` identifiers). + * @return testsToRun + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TESTS_TO_RUN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTestsToRun() { + return testsToRun; + } + + + @JsonProperty(JSON_PROPERTY_TESTS_TO_RUN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestsToRun(@jakarta.annotation.Nullable List testsToRun) { + this.testsToRun = testsToRun; + } + + + public RunTestRequest testsToSkip(@jakarta.annotation.Nullable List testsToSkip) { + this.testsToSkip = testsToSkip; + return this; + } + + public RunTestRequest addTestsToSkipItem(String testsToSkipItem) { + if (this.testsToSkip == null) { + this.testsToSkip = new ArrayList<>(); + } + this.testsToSkip.add(testsToSkipItem); + return this; + } + + /** + * Skip these tests. + * @return testsToSkip + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TESTS_TO_SKIP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTestsToSkip() { + return testsToSkip; + } + + + @JsonProperty(JSON_PROPERTY_TESTS_TO_SKIP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestsToSkip(@jakarta.annotation.Nullable List testsToSkip) { + this.testsToSkip = testsToSkip; + } + + + public RunTestRequest xctest(@jakarta.annotation.Nullable Boolean xctest) { + this.xctest = xctest; + return this; + } + + /** + * Run as a plain XCTest (vs XCUITest). + * @return xctest + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_XCTEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getXctest() { + return xctest; + } + + + @JsonProperty(JSON_PROPERTY_XCTEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setXctest(@jakarta.annotation.Nullable Boolean xctest) { + this.xctest = xctest; + } + + + /** + * Return true if this RunTestRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunTestRequest runTestRequest = (RunTestRequest) o; + return Objects.equals(this.bundleId, runTestRequest.bundleId) && + Objects.equals(this.testRunnerBundleId, runTestRequest.testRunnerBundleId) && + Objects.equals(this.xctestConfig, runTestRequest.xctestConfig) && + Objects.equals(this.env, runTestRequest.env) && + Objects.equals(this.args, runTestRequest.args) && + Objects.equals(this.testsToRun, runTestRequest.testsToRun) && + Objects.equals(this.testsToSkip, runTestRequest.testsToSkip) && + Objects.equals(this.xctest, runTestRequest.xctest); + } + + @Override + public int hashCode() { + return Objects.hash(bundleId, testRunnerBundleId, xctestConfig, env, args, testsToRun, testsToSkip, xctest); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunTestRequest {\n"); + sb.append(" bundleId: ").append(toIndentedString(bundleId)).append("\n"); + sb.append(" testRunnerBundleId: ").append(toIndentedString(testRunnerBundleId)).append("\n"); + sb.append(" xctestConfig: ").append(toIndentedString(xctestConfig)).append("\n"); + sb.append(" env: ").append(toIndentedString(env)).append("\n"); + sb.append(" args: ").append(toIndentedString(args)).append("\n"); + sb.append(" testsToRun: ").append(toIndentedString(testsToRun)).append("\n"); + sb.append(" testsToSkip: ").append(toIndentedString(testsToSkip)).append("\n"); + sb.append(" xctest: ").append(toIndentedString(xctest)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `bundleId` to the URL query string + if (getBundleId() != null) { + joiner.add(String.format("%sbundleId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getBundleId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `testRunnerBundleId` to the URL query string + if (getTestRunnerBundleId() != null) { + joiner.add(String.format("%stestRunnerBundleId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getTestRunnerBundleId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `xctestConfig` to the URL query string + if (getXctestConfig() != null) { + joiner.add(String.format("%sxctestConfig%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getXctestConfig()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `env` to the URL query string + if (getEnv() != null) { + joiner.add(String.format("%senv%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getEnv()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `args` to the URL query string + if (getArgs() != null) { + for (int i = 0; i < getArgs().size(); i++) { + joiner.add(String.format("%sargs%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(ApiClient.valueToString(getArgs().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + + // add `testsToRun` to the URL query string + if (getTestsToRun() != null) { + for (int i = 0; i < getTestsToRun().size(); i++) { + joiner.add(String.format("%stestsToRun%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(ApiClient.valueToString(getTestsToRun().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + + // add `testsToSkip` to the URL query string + if (getTestsToSkip() != null) { + for (int i = 0; i < getTestsToSkip().size(); i++) { + joiner.add(String.format("%stestsToSkip%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(ApiClient.valueToString(getTestsToSkip().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + + // add `xctest` to the URL query string + if (getXctest() != null) { + joiner.add(String.format("%sxctest%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getXctest()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/SetLanguageRequest.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/SetLanguageRequest.java new file mode 100644 index 000000000..1f56506ab --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/SetLanguageRequest.java @@ -0,0 +1,187 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `PUT /device/{udid}/lang` request. + */ +@JsonPropertyOrder({ + SetLanguageRequest.JSON_PROPERTY_LANGUAGE, + SetLanguageRequest.JSON_PROPERTY_LOCALE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class SetLanguageRequest { + public static final String JSON_PROPERTY_LANGUAGE = "language"; + @jakarta.annotation.Nullable + private String language; + + public static final String JSON_PROPERTY_LOCALE = "locale"; + @jakarta.annotation.Nullable + private String locale; + + public SetLanguageRequest() { + } + + public SetLanguageRequest language(@jakarta.annotation.Nullable String language) { + this.language = language; + return this; + } + + /** + * Get language + * @return language + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLanguage() { + return language; + } + + + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLanguage(@jakarta.annotation.Nullable String language) { + this.language = language; + } + + + public SetLanguageRequest locale(@jakarta.annotation.Nullable String locale) { + this.locale = locale; + return this; + } + + /** + * Get locale + * @return locale + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOCALE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLocale() { + return locale; + } + + + @JsonProperty(JSON_PROPERTY_LOCALE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocale(@jakarta.annotation.Nullable String locale) { + this.locale = locale; + } + + + /** + * Return true if this SetLanguageRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetLanguageRequest setLanguageRequest = (SetLanguageRequest) o; + return Objects.equals(this.language, setLanguageRequest.language) && + Objects.equals(this.locale, setLanguageRequest.locale); + } + + @Override + public int hashCode() { + return Objects.hash(language, locale); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetLanguageRequest {\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" locale: ").append(toIndentedString(locale)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `language` to the URL query string + if (getLanguage() != null) { + joiner.add(String.format("%slanguage%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getLanguage()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `locale` to the URL query string + if (getLocale() != null) { + joiner.add(String.format("%slocale%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getLocale()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/StatusOk.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/StatusOk.java new file mode 100644 index 000000000..7c10d142d --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/StatusOk.java @@ -0,0 +1,151 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * Simple `{ \"status\": \"ok\" }` acknowledgement used by MDM clear operations. + */ +@JsonPropertyOrder({ + StatusOk.JSON_PROPERTY_STATUS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class StatusOk { + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nonnull + private String status; + + public StatusOk() { + } + + public StatusOk status(@jakarta.annotation.Nonnull String status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(@jakarta.annotation.Nonnull String status) { + this.status = status; + } + + + /** + * Return true if this StatusOk object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StatusOk statusOk = (StatusOk) o; + return Objects.equals(this.status, statusOk.status); + } + + @Override + public int hashCode() { + return Objects.hash(status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StatusOk {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getStatus()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/SupervisionCert.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/SupervisionCert.java new file mode 100644 index 000000000..e3d89af44 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/SupervisionCert.java @@ -0,0 +1,259 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `POST /prepare/create-cert` — a generated self-signed supervision identity, returned as DER (base64) and PEM for both the certificate and private key. Host-scoped (device-free). + */ +@JsonPropertyOrder({ + SupervisionCert.JSON_PROPERTY_CERT_DER_BASE64, + SupervisionCert.JSON_PROPERTY_CERT_PEM, + SupervisionCert.JSON_PROPERTY_PRIVATE_KEY_DER_BASE64, + SupervisionCert.JSON_PROPERTY_PRIVATE_KEY_PEM +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class SupervisionCert { + public static final String JSON_PROPERTY_CERT_DER_BASE64 = "certDerBase64"; + @jakarta.annotation.Nonnull + private String certDerBase64; + + public static final String JSON_PROPERTY_CERT_PEM = "certPem"; + @jakarta.annotation.Nonnull + private String certPem; + + public static final String JSON_PROPERTY_PRIVATE_KEY_DER_BASE64 = "privateKeyDerBase64"; + @jakarta.annotation.Nonnull + private String privateKeyDerBase64; + + public static final String JSON_PROPERTY_PRIVATE_KEY_PEM = "privateKeyPem"; + @jakarta.annotation.Nonnull + private String privateKeyPem; + + public SupervisionCert() { + } + + public SupervisionCert certDerBase64(@jakarta.annotation.Nonnull String certDerBase64) { + this.certDerBase64 = certDerBase64; + return this; + } + + /** + * Certificate in DER form, base64-encoded. + * @return certDerBase64 + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CERT_DER_BASE64) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCertDerBase64() { + return certDerBase64; + } + + + @JsonProperty(JSON_PROPERTY_CERT_DER_BASE64) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCertDerBase64(@jakarta.annotation.Nonnull String certDerBase64) { + this.certDerBase64 = certDerBase64; + } + + + public SupervisionCert certPem(@jakarta.annotation.Nonnull String certPem) { + this.certPem = certPem; + return this; + } + + /** + * Certificate in PEM form. + * @return certPem + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CERT_PEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCertPem() { + return certPem; + } + + + @JsonProperty(JSON_PROPERTY_CERT_PEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCertPem(@jakarta.annotation.Nonnull String certPem) { + this.certPem = certPem; + } + + + public SupervisionCert privateKeyDerBase64(@jakarta.annotation.Nonnull String privateKeyDerBase64) { + this.privateKeyDerBase64 = privateKeyDerBase64; + return this; + } + + /** + * Private key in DER form, base64-encoded. + * @return privateKeyDerBase64 + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PRIVATE_KEY_DER_BASE64) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPrivateKeyDerBase64() { + return privateKeyDerBase64; + } + + + @JsonProperty(JSON_PROPERTY_PRIVATE_KEY_DER_BASE64) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPrivateKeyDerBase64(@jakarta.annotation.Nonnull String privateKeyDerBase64) { + this.privateKeyDerBase64 = privateKeyDerBase64; + } + + + public SupervisionCert privateKeyPem(@jakarta.annotation.Nonnull String privateKeyPem) { + this.privateKeyPem = privateKeyPem; + return this; + } + + /** + * Private key in PEM form. + * @return privateKeyPem + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PRIVATE_KEY_PEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPrivateKeyPem() { + return privateKeyPem; + } + + + @JsonProperty(JSON_PROPERTY_PRIVATE_KEY_PEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPrivateKeyPem(@jakarta.annotation.Nonnull String privateKeyPem) { + this.privateKeyPem = privateKeyPem; + } + + + /** + * Return true if this SupervisionCert object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SupervisionCert supervisionCert = (SupervisionCert) o; + return Objects.equals(this.certDerBase64, supervisionCert.certDerBase64) && + Objects.equals(this.certPem, supervisionCert.certPem) && + Objects.equals(this.privateKeyDerBase64, supervisionCert.privateKeyDerBase64) && + Objects.equals(this.privateKeyPem, supervisionCert.privateKeyPem); + } + + @Override + public int hashCode() { + return Objects.hash(certDerBase64, certPem, privateKeyDerBase64, privateKeyPem); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SupervisionCert {\n"); + sb.append(" certDerBase64: ").append(toIndentedString(certDerBase64)).append("\n"); + sb.append(" certPem: ").append(toIndentedString(certPem)).append("\n"); + sb.append(" privateKeyDerBase64: ").append(toIndentedString(privateKeyDerBase64)).append("\n"); + sb.append(" privateKeyPem: ").append(toIndentedString(privateKeyPem)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `certDerBase64` to the URL query string + if (getCertDerBase64() != null) { + joiner.add(String.format("%scertDerBase64%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getCertDerBase64()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `certPem` to the URL query string + if (getCertPem() != null) { + joiner.add(String.format("%scertPem%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getCertPem()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `privateKeyDerBase64` to the URL query string + if (getPrivateKeyDerBase64() != null) { + joiner.add(String.format("%sprivateKeyDerBase64%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPrivateKeyDerBase64()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `privateKeyPem` to the URL query string + if (getPrivateKeyPem() != null) { + joiner.add(String.format("%sprivateKeyPem%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPrivateKeyPem()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/SyslogEvents.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/SyslogEvents.java new file mode 100644 index 000000000..6b17bca8a --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/SyslogEvents.java @@ -0,0 +1,243 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.github.danielpaulus.goios.generated.model.SyslogMessage; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import com.github.danielpaulus.goios.generated.invoker.JSON; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +@JsonDeserialize(using=SyslogEvents.SyslogEventsDeserializer.class) +@JsonSerialize(using = SyslogEvents.SyslogEventsSerializer.class) +public class SyslogEvents extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(SyslogEvents.class.getName()); + + public static class SyslogEventsSerializer extends StdSerializer { + public SyslogEventsSerializer(Class t) { + super(t); + } + + public SyslogEventsSerializer() { + this(null); + } + + @Override + public void serialize(SyslogEvents value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class SyslogEventsDeserializer extends StdDeserializer { + public SyslogEventsDeserializer() { + this(SyslogEvents.class); + } + + public SyslogEventsDeserializer(Class vc) { + super(vc); + } + + @Override + public SyslogEvents deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + + Object deserialized = null; + // deserialize Object + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Object.class); + SyslogEvents ret = new SyslogEvents(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'SyslogEvents'", e); + } + + // deserialize SyslogMessage + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(SyslogMessage.class); + SyslogEvents ret = new SyslogEvents(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'SyslogEvents'", e); + } + + throw new IOException(String.format("Failed deserialization for SyslogEvents: no match found")); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public SyslogEvents getNullValue(DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "SyslogEvents cannot be null"); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public SyslogEvents() { + super("anyOf", Boolean.FALSE); + } + + public SyslogEvents(Object o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + public SyslogEvents(SyslogMessage o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Object", Object.class); + schemas.put("SyslogMessage", SyslogMessage.class); + JSON.registerDescendants(SyslogEvents.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map> getSchemas() { + return SyslogEvents.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check + * the instance parameter is valid against the anyOf child schemas: + * Object, SyslogMessage + * + * It could be an instance of the 'anyOf' schemas. + * The anyOf child schemas may themselves be a composed schema (allOf, anyOf, anyOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(Object.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(SyslogMessage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Object, SyslogMessage"); + } + + /** + * Get the actual instance, which can be the following: + * Object, SyslogMessage + * + * @return The actual instance (Object, SyslogMessage) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * Get the actual instance of `SyslogMessage`. If the actual instance is not `SyslogMessage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `SyslogMessage` + * @throws ClassCastException if the instance is not `SyslogMessage` + */ + public SyslogMessage getSyslogMessage() throws ClassCastException { + return (SyslogMessage)super.getActualInstance(); + } + + + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + return null; + } + +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/SyslogMessage.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/SyslogMessage.java new file mode 100644 index 000000000..21a5884b3 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/SyslogMessage.java @@ -0,0 +1,187 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * A single syslog line from the device. + */ +@JsonPropertyOrder({ + SyslogMessage.JSON_PROPERTY_MESSAGE, + SyslogMessage.JSON_PROPERTY_TIMESTAMP +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class SyslogMessage { + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nonnull + private String message; + + public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; + @jakarta.annotation.Nullable + private Long timestamp; + + public SyslogMessage() { + } + + public SyslogMessage message(@jakarta.annotation.Nonnull String message) { + this.message = message; + return this; + } + + /** + * The raw log message text. + * @return message + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMessage(@jakarta.annotation.Nonnull String message) { + this.message = message; + } + + + public SyslogMessage timestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Unix epoch milliseconds when the line was emitted, if known. + * @return timestamp + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TIMESTAMP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTimestamp() { + return timestamp; + } + + + @JsonProperty(JSON_PROPERTY_TIMESTAMP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTimestamp(@jakarta.annotation.Nullable Long timestamp) { + this.timestamp = timestamp; + } + + + /** + * Return true if this SyslogMessage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyslogMessage syslogMessage = (SyslogMessage) o; + return Objects.equals(this.message, syslogMessage.message) && + Objects.equals(this.timestamp, syslogMessage.timestamp); + } + + @Override + public int hashCode() { + return Objects.hash(message, timestamp); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyslogMessage {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format("%smessage%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getMessage()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `timestamp` to the URL query string + if (getTimestamp() != null) { + joiner.add(String.format("%stimestamp%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getTimestamp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/SysmontapEvents.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/SysmontapEvents.java new file mode 100644 index 000000000..255f7f9af --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/SysmontapEvents.java @@ -0,0 +1,243 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.github.danielpaulus.goios.generated.model.CpuUsageSample; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import com.github.danielpaulus.goios.generated.invoker.JSON; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +@JsonDeserialize(using=SysmontapEvents.SysmontapEventsDeserializer.class) +@JsonSerialize(using = SysmontapEvents.SysmontapEventsSerializer.class) +public class SysmontapEvents extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(SysmontapEvents.class.getName()); + + public static class SysmontapEventsSerializer extends StdSerializer { + public SysmontapEventsSerializer(Class t) { + super(t); + } + + public SysmontapEventsSerializer() { + this(null); + } + + @Override + public void serialize(SysmontapEvents value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class SysmontapEventsDeserializer extends StdDeserializer { + public SysmontapEventsDeserializer() { + this(SysmontapEvents.class); + } + + public SysmontapEventsDeserializer(Class vc) { + super(vc); + } + + @Override + public SysmontapEvents deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + + Object deserialized = null; + // deserialize CpuUsageSample + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(CpuUsageSample.class); + SysmontapEvents ret = new SysmontapEvents(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'SysmontapEvents'", e); + } + + // deserialize Object + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Object.class); + SysmontapEvents ret = new SysmontapEvents(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'SysmontapEvents'", e); + } + + throw new IOException(String.format("Failed deserialization for SysmontapEvents: no match found")); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public SysmontapEvents getNullValue(DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "SysmontapEvents cannot be null"); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public SysmontapEvents() { + super("anyOf", Boolean.FALSE); + } + + public SysmontapEvents(CpuUsageSample o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + public SysmontapEvents(Object o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("CpuUsageSample", CpuUsageSample.class); + schemas.put("Object", Object.class); + JSON.registerDescendants(SysmontapEvents.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map> getSchemas() { + return SysmontapEvents.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check + * the instance parameter is valid against the anyOf child schemas: + * CpuUsageSample, Object + * + * It could be an instance of the 'anyOf' schemas. + * The anyOf child schemas may themselves be a composed schema (allOf, anyOf, anyOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(CpuUsageSample.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(Object.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be CpuUsageSample, Object"); + } + + /** + * Get the actual instance, which can be the following: + * CpuUsageSample, Object + * + * @return The actual instance (CpuUsageSample, Object) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `CpuUsageSample`. If the actual instance is not `CpuUsageSample`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `CpuUsageSample` + * @throws ClassCastException if the instance is not `CpuUsageSample` + */ + public CpuUsageSample getCpuUsageSample() throws ClassCastException { + return (CpuUsageSample)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + return null; + } + +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/TimeFormatRequest.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/TimeFormatRequest.java new file mode 100644 index 000000000..62ab524db --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/TimeFormatRequest.java @@ -0,0 +1,151 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `PUT /device/{udid}/timeformat` request. + */ +@JsonPropertyOrder({ + TimeFormatRequest.JSON_PROPERTY_USES24_HOUR +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class TimeFormatRequest { + public static final String JSON_PROPERTY_USES24_HOUR = "uses24Hour"; + @jakarta.annotation.Nonnull + private Boolean uses24Hour; + + public TimeFormatRequest() { + } + + public TimeFormatRequest uses24Hour(@jakarta.annotation.Nonnull Boolean uses24Hour) { + this.uses24Hour = uses24Hour; + return this; + } + + /** + * Get uses24Hour + * @return uses24Hour + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_USES24_HOUR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getUses24Hour() { + return uses24Hour; + } + + + @JsonProperty(JSON_PROPERTY_USES24_HOUR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUses24Hour(@jakarta.annotation.Nonnull Boolean uses24Hour) { + this.uses24Hour = uses24Hour; + } + + + /** + * Return true if this TimeFormatRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimeFormatRequest timeFormatRequest = (TimeFormatRequest) o; + return Objects.equals(this.uses24Hour, timeFormatRequest.uses24Hour); + } + + @Override + public int hashCode() { + return Objects.hash(uses24Hour); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimeFormatRequest {\n"); + sb.append(" uses24Hour: ").append(toIndentedString(uses24Hour)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `uses24Hour` to the URL query string + if (getUses24Hour() != null) { + joiner.add(String.format("%suses24Hour%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getUses24Hour()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/TimeFormatState.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/TimeFormatState.java new file mode 100644 index 000000000..a14c0e632 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/TimeFormatState.java @@ -0,0 +1,151 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `GET /device/{udid}/timeformat` — 24-hour clock state. + */ +@JsonPropertyOrder({ + TimeFormatState.JSON_PROPERTY_USES24_HOUR_CLOCK +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class TimeFormatState { + public static final String JSON_PROPERTY_USES24_HOUR_CLOCK = "Uses24HourClock"; + @jakarta.annotation.Nonnull + private Boolean uses24HourClock; + + public TimeFormatState() { + } + + public TimeFormatState uses24HourClock(@jakarta.annotation.Nonnull Boolean uses24HourClock) { + this.uses24HourClock = uses24HourClock; + return this; + } + + /** + * Get uses24HourClock + * @return uses24HourClock + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_USES24_HOUR_CLOCK) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getUses24HourClock() { + return uses24HourClock; + } + + + @JsonProperty(JSON_PROPERTY_USES24_HOUR_CLOCK) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUses24HourClock(@jakarta.annotation.Nonnull Boolean uses24HourClock) { + this.uses24HourClock = uses24HourClock; + } + + + /** + * Return true if this TimeFormatState object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimeFormatState timeFormatState = (TimeFormatState) o; + return Objects.equals(this.uses24HourClock, timeFormatState.uses24HourClock); + } + + @Override + public int hashCode() { + return Objects.hash(uses24HourClock); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimeFormatState {\n"); + sb.append(" uses24HourClock: ").append(toIndentedString(uses24HourClock)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Uses24HourClock` to the URL query string + if (getUses24HourClock() != null) { + joiner.add(String.format("%sUses24HourClock%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getUses24HourClock()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/Tunnel.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/Tunnel.java new file mode 100644 index 000000000..06ea13adf --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/Tunnel.java @@ -0,0 +1,295 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * A running device tunnel as reported by the tunnel agent (`GET /tunnels`, `POST /tunnels/{udid}/refresh`). Mirrors `tunnel.Tunnel`. + */ +@JsonPropertyOrder({ + Tunnel.JSON_PROPERTY_UDID, + Tunnel.JSON_PROPERTY_ADDRESS, + Tunnel.JSON_PROPERTY_RSD_PORT, + Tunnel.JSON_PROPERTY_USERSPACE_T_U_N, + Tunnel.JSON_PROPERTY_USERSPACE_T_U_N_PORT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class Tunnel { + public static final String JSON_PROPERTY_UDID = "Udid"; + @jakarta.annotation.Nonnull + private String udid; + + public static final String JSON_PROPERTY_ADDRESS = "Address"; + @jakarta.annotation.Nonnull + private String address; + + public static final String JSON_PROPERTY_RSD_PORT = "RsdPort"; + @jakarta.annotation.Nonnull + private Integer rsdPort; + + public static final String JSON_PROPERTY_USERSPACE_T_U_N = "UserspaceTUN"; + @jakarta.annotation.Nullable + private Boolean userspaceTUN; + + public static final String JSON_PROPERTY_USERSPACE_T_U_N_PORT = "UserspaceTUNPort"; + @jakarta.annotation.Nullable + private Integer userspaceTUNPort; + + public Tunnel() { + } + + public Tunnel udid(@jakarta.annotation.Nonnull String udid) { + this.udid = udid; + return this; + } + + /** + * The device udid this tunnel serves. + * @return udid + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_UDID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUdid() { + return udid; + } + + + @JsonProperty(JSON_PROPERTY_UDID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUdid(@jakarta.annotation.Nonnull String udid) { + this.udid = udid; + } + + + public Tunnel address(@jakarta.annotation.Nonnull String address) { + this.address = address; + return this; + } + + /** + * Tunnel address (IPv6) reachable for RemoteXPC/RSD. + * @return address + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAddress() { + return address; + } + + + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAddress(@jakarta.annotation.Nonnull String address) { + this.address = address; + } + + + public Tunnel rsdPort(@jakarta.annotation.Nonnull Integer rsdPort) { + this.rsdPort = rsdPort; + return this; + } + + /** + * RemoteServiceDiscovery port on the tunnel. + * @return rsdPort + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_RSD_PORT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getRsdPort() { + return rsdPort; + } + + + @JsonProperty(JSON_PROPERTY_RSD_PORT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRsdPort(@jakarta.annotation.Nonnull Integer rsdPort) { + this.rsdPort = rsdPort; + } + + + public Tunnel userspaceTUN(@jakarta.annotation.Nullable Boolean userspaceTUN) { + this.userspaceTUN = userspaceTUN; + return this; + } + + /** + * Whether this tunnel is a userspace TUN. + * @return userspaceTUN + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERSPACE_T_U_N) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getUserspaceTUN() { + return userspaceTUN; + } + + + @JsonProperty(JSON_PROPERTY_USERSPACE_T_U_N) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserspaceTUN(@jakarta.annotation.Nullable Boolean userspaceTUN) { + this.userspaceTUN = userspaceTUN; + } + + + public Tunnel userspaceTUNPort(@jakarta.annotation.Nullable Integer userspaceTUNPort) { + this.userspaceTUNPort = userspaceTUNPort; + return this; + } + + /** + * Userspace TUN port, when `UserspaceTUN` is true. + * @return userspaceTUNPort + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERSPACE_T_U_N_PORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getUserspaceTUNPort() { + return userspaceTUNPort; + } + + + @JsonProperty(JSON_PROPERTY_USERSPACE_T_U_N_PORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserspaceTUNPort(@jakarta.annotation.Nullable Integer userspaceTUNPort) { + this.userspaceTUNPort = userspaceTUNPort; + } + + + /** + * Return true if this Tunnel object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Tunnel tunnel = (Tunnel) o; + return Objects.equals(this.udid, tunnel.udid) && + Objects.equals(this.address, tunnel.address) && + Objects.equals(this.rsdPort, tunnel.rsdPort) && + Objects.equals(this.userspaceTUN, tunnel.userspaceTUN) && + Objects.equals(this.userspaceTUNPort, tunnel.userspaceTUNPort); + } + + @Override + public int hashCode() { + return Objects.hash(udid, address, rsdPort, userspaceTUN, userspaceTUNPort); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tunnel {\n"); + sb.append(" udid: ").append(toIndentedString(udid)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" rsdPort: ").append(toIndentedString(rsdPort)).append("\n"); + sb.append(" userspaceTUN: ").append(toIndentedString(userspaceTUN)).append("\n"); + sb.append(" userspaceTUNPort: ").append(toIndentedString(userspaceTUNPort)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `Udid` to the URL query string + if (getUdid() != null) { + joiner.add(String.format("%sUdid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getUdid()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `Address` to the URL query string + if (getAddress() != null) { + joiner.add(String.format("%sAddress%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getAddress()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `RsdPort` to the URL query string + if (getRsdPort() != null) { + joiner.add(String.format("%sRsdPort%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getRsdPort()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `UserspaceTUN` to the URL query string + if (getUserspaceTUN() != null) { + joiner.add(String.format("%sUserspaceTUN%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getUserspaceTUN()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `UserspaceTUNPort` to the URL query string + if (getUserspaceTUNPort() != null) { + joiner.add(String.format("%sUserspaceTUNPort%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getUserspaceTUNPort()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/TunnelStopped.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/TunnelStopped.java new file mode 100644 index 000000000..63272b81b --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/TunnelStopped.java @@ -0,0 +1,187 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `DELETE /tunnels/{udid}` — acknowledgement that the tunnel was stopped. + */ +@JsonPropertyOrder({ + TunnelStopped.JSON_PROPERTY_UDID, + TunnelStopped.JSON_PROPERTY_STATUS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class TunnelStopped { + public static final String JSON_PROPERTY_UDID = "udid"; + @jakarta.annotation.Nonnull + private String udid; + + public static final String JSON_PROPERTY_STATUS = "status"; + @jakarta.annotation.Nonnull + private String status; + + public TunnelStopped() { + } + + public TunnelStopped udid(@jakarta.annotation.Nonnull String udid) { + this.udid = udid; + return this; + } + + /** + * Get udid + * @return udid + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_UDID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUdid() { + return udid; + } + + + @JsonProperty(JSON_PROPERTY_UDID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUdid(@jakarta.annotation.Nonnull String udid) { + this.udid = udid; + } + + + public TunnelStopped status(@jakarta.annotation.Nonnull String status) { + this.status = status; + return this; + } + + /** + * Always `stopped`. + * @return status + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatus(@jakarta.annotation.Nonnull String status) { + this.status = status; + } + + + /** + * Return true if this TunnelStopped object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TunnelStopped tunnelStopped = (TunnelStopped) o; + return Objects.equals(this.udid, tunnelStopped.udid) && + Objects.equals(this.status, tunnelStopped.status); + } + + @Override + public int hashCode() { + return Objects.hash(udid, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TunnelStopped {\n"); + sb.append(" udid: ").append(toIndentedString(udid)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `udid` to the URL query string + if (getUdid() != null) { + joiner.add(String.format("%sudid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getUdid()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getStatus()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/UIAPIRequest.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/UIAPIRequest.java new file mode 100644 index 000000000..f6d7b0b80 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/UIAPIRequest.java @@ -0,0 +1,295 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `POST /device/{udid}/ui/api` request — raw passthrough to the backend (`uidriver.APIRequest`). For WDA supply `method`/`path`/`body`; for DeviceKit supply `rpcMethod`/`rpcParams`. + */ +@JsonPropertyOrder({ + UIAPIRequest.JSON_PROPERTY_METHOD, + UIAPIRequest.JSON_PROPERTY_PATH, + UIAPIRequest.JSON_PROPERTY_BODY, + UIAPIRequest.JSON_PROPERTY_RPC_METHOD, + UIAPIRequest.JSON_PROPERTY_RPC_PARAMS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class UIAPIRequest { + public static final String JSON_PROPERTY_METHOD = "method"; + @jakarta.annotation.Nullable + private String method; + + public static final String JSON_PROPERTY_PATH = "path"; + @jakarta.annotation.Nullable + private String path; + + public static final String JSON_PROPERTY_BODY = "body"; + @jakarta.annotation.Nullable + private String body; + + public static final String JSON_PROPERTY_RPC_METHOD = "rpcMethod"; + @jakarta.annotation.Nullable + private String rpcMethod; + + public static final String JSON_PROPERTY_RPC_PARAMS = "rpcParams"; + @jakarta.annotation.Nullable + private Object rpcParams = null; + + public UIAPIRequest() { + } + + public UIAPIRequest method(@jakarta.annotation.Nullable String method) { + this.method = method; + return this; + } + + /** + * HTTP method for a WDA passthrough (defaults to GET). + * @return method + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMethod() { + return method; + } + + + @JsonProperty(JSON_PROPERTY_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMethod(@jakarta.annotation.Nullable String method) { + this.method = method; + } + + + public UIAPIRequest path(@jakarta.annotation.Nullable String path) { + this.path = path; + return this; + } + + /** + * HTTP path for a WDA passthrough (required for the wda backend). + * @return path + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPath() { + return path; + } + + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(@jakarta.annotation.Nullable String path) { + this.path = path; + } + + + public UIAPIRequest body(@jakarta.annotation.Nullable String body) { + this.body = body; + return this; + } + + /** + * Raw HTTP request body for a WDA passthrough (base64 bytes on the wire). + * @return body + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BODY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBody() { + return body; + } + + + @JsonProperty(JSON_PROPERTY_BODY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBody(@jakarta.annotation.Nullable String body) { + this.body = body; + } + + + public UIAPIRequest rpcMethod(@jakarta.annotation.Nullable String rpcMethod) { + this.rpcMethod = rpcMethod; + return this; + } + + /** + * JSON-RPC method name for a DeviceKit passthrough. + * @return rpcMethod + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RPC_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRpcMethod() { + return rpcMethod; + } + + + @JsonProperty(JSON_PROPERTY_RPC_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRpcMethod(@jakarta.annotation.Nullable String rpcMethod) { + this.rpcMethod = rpcMethod; + } + + + public UIAPIRequest rpcParams(@jakarta.annotation.Nullable Object rpcParams) { + this.rpcParams = rpcParams; + return this; + } + + /** + * Get rpcParams + * @return rpcParams + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RPC_PARAMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getRpcParams() { + return rpcParams; + } + + + @JsonProperty(JSON_PROPERTY_RPC_PARAMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRpcParams(@jakarta.annotation.Nullable Object rpcParams) { + this.rpcParams = rpcParams; + } + + + /** + * Return true if this UIAPIRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UIAPIRequest uiAPIRequest = (UIAPIRequest) o; + return Objects.equals(this.method, uiAPIRequest.method) && + Objects.equals(this.path, uiAPIRequest.path) && + Objects.equals(this.body, uiAPIRequest.body) && + Objects.equals(this.rpcMethod, uiAPIRequest.rpcMethod) && + Objects.equals(this.rpcParams, uiAPIRequest.rpcParams); + } + + @Override + public int hashCode() { + return Objects.hash(method, path, body, rpcMethod, rpcParams); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UIAPIRequest {\n"); + sb.append(" method: ").append(toIndentedString(method)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" body: ").append(toIndentedString(body)).append("\n"); + sb.append(" rpcMethod: ").append(toIndentedString(rpcMethod)).append("\n"); + sb.append(" rpcParams: ").append(toIndentedString(rpcParams)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `method` to the URL query string + if (getMethod() != null) { + joiner.add(String.format("%smethod%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getMethod()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `path` to the URL query string + if (getPath() != null) { + joiner.add(String.format("%spath%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPath()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `body` to the URL query string + if (getBody() != null) { + joiner.add(String.format("%sbody%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getBody()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `rpcMethod` to the URL query string + if (getRpcMethod() != null) { + joiner.add(String.format("%srpcMethod%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getRpcMethod()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `rpcParams` to the URL query string + if (getRpcParams() != null) { + joiner.add(String.format("%srpcParams%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getRpcParams()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/UIAppRequest.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/UIAppRequest.java new file mode 100644 index 000000000..7ba84f1ee --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/UIAppRequest.java @@ -0,0 +1,151 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `POST /device/{udid}/ui/app/{launch,terminate}` request. + */ +@JsonPropertyOrder({ + UIAppRequest.JSON_PROPERTY_BUNDLE_ID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class UIAppRequest { + public static final String JSON_PROPERTY_BUNDLE_ID = "bundleId"; + @jakarta.annotation.Nonnull + private String bundleId; + + public UIAppRequest() { + } + + public UIAppRequest bundleId(@jakarta.annotation.Nonnull String bundleId) { + this.bundleId = bundleId; + return this; + } + + /** + * Get bundleId + * @return bundleId + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_BUNDLE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getBundleId() { + return bundleId; + } + + + @JsonProperty(JSON_PROPERTY_BUNDLE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setBundleId(@jakarta.annotation.Nonnull String bundleId) { + this.bundleId = bundleId; + } + + + /** + * Return true if this UIAppRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UIAppRequest uiAppRequest = (UIAppRequest) o; + return Objects.equals(this.bundleId, uiAppRequest.bundleId); + } + + @Override + public int hashCode() { + return Objects.hash(bundleId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UIAppRequest {\n"); + sb.append(" bundleId: ").append(toIndentedString(bundleId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `bundleId` to the URL query string + if (getBundleId() != null) { + joiner.add(String.format("%sbundleId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getBundleId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/UIButtonRequest.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/UIButtonRequest.java new file mode 100644 index 000000000..5d32db4a7 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/UIButtonRequest.java @@ -0,0 +1,151 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `POST /device/{udid}/ui/button` request — hardware button by name. + */ +@JsonPropertyOrder({ + UIButtonRequest.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class UIButtonRequest { + public static final String JSON_PROPERTY_NAME = "name"; + @jakarta.annotation.Nonnull + private String name; + + public UIButtonRequest() { + } + + public UIButtonRequest name(@jakarta.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Button name (e.g. `home`, `volumeup`). WDA supports only `home`. + * @return name + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(@jakarta.annotation.Nonnull String name) { + this.name = name; + } + + + /** + * Return true if this UIButtonRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UIButtonRequest uiButtonRequest = (UIButtonRequest) o; + return Objects.equals(this.name, uiButtonRequest.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UIButtonRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/UILongPressRequest.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/UILongPressRequest.java new file mode 100644 index 000000000..fa1ec436d --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/UILongPressRequest.java @@ -0,0 +1,223 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `POST /device/{udid}/ui/longpress` request — press and hold at (x,y). + */ +@JsonPropertyOrder({ + UILongPressRequest.JSON_PROPERTY_X, + UILongPressRequest.JSON_PROPERTY_Y, + UILongPressRequest.JSON_PROPERTY_DURATION +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class UILongPressRequest { + public static final String JSON_PROPERTY_X = "x"; + @jakarta.annotation.Nonnull + private Integer x; + + public static final String JSON_PROPERTY_Y = "y"; + @jakarta.annotation.Nonnull + private Integer y; + + public static final String JSON_PROPERTY_DURATION = "duration"; + @jakarta.annotation.Nullable + private Double duration; + + public UILongPressRequest() { + } + + public UILongPressRequest x(@jakarta.annotation.Nonnull Integer x) { + this.x = x; + return this; + } + + /** + * Get x + * @return x + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_X) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getX() { + return x; + } + + + @JsonProperty(JSON_PROPERTY_X) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setX(@jakarta.annotation.Nonnull Integer x) { + this.x = x; + } + + + public UILongPressRequest y(@jakarta.annotation.Nonnull Integer y) { + this.y = y; + return this; + } + + /** + * Get y + * @return y + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_Y) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getY() { + return y; + } + + + @JsonProperty(JSON_PROPERTY_Y) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setY(@jakarta.annotation.Nonnull Integer y) { + this.y = y; + } + + + public UILongPressRequest duration(@jakarta.annotation.Nullable Double duration) { + this.duration = duration; + return this; + } + + /** + * Hold duration in seconds. + * @return duration + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getDuration() { + return duration; + } + + + @JsonProperty(JSON_PROPERTY_DURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDuration(@jakarta.annotation.Nullable Double duration) { + this.duration = duration; + } + + + /** + * Return true if this UILongPressRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UILongPressRequest uiLongPressRequest = (UILongPressRequest) o; + return Objects.equals(this.x, uiLongPressRequest.x) && + Objects.equals(this.y, uiLongPressRequest.y) && + Objects.equals(this.duration, uiLongPressRequest.duration); + } + + @Override + public int hashCode() { + return Objects.hash(x, y, duration); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UILongPressRequest {\n"); + sb.append(" x: ").append(toIndentedString(x)).append("\n"); + sb.append(" y: ").append(toIndentedString(y)).append("\n"); + sb.append(" duration: ").append(toIndentedString(duration)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `x` to the URL query string + if (getX() != null) { + joiner.add(String.format("%sx%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getX()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `y` to the URL query string + if (getY() != null) { + joiner.add(String.format("%sy%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getY()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `duration` to the URL query string + if (getDuration() != null) { + joiner.add(String.format("%sduration%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getDuration()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/UIOrientationRequest.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/UIOrientationRequest.java new file mode 100644 index 000000000..951b74cfe --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/UIOrientationRequest.java @@ -0,0 +1,151 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `PUT /device/{udid}/ui/orientation` request. + */ +@JsonPropertyOrder({ + UIOrientationRequest.JSON_PROPERTY_ORIENTATION +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class UIOrientationRequest { + public static final String JSON_PROPERTY_ORIENTATION = "orientation"; + @jakarta.annotation.Nonnull + private String orientation; + + public UIOrientationRequest() { + } + + public UIOrientationRequest orientation(@jakarta.annotation.Nonnull String orientation) { + this.orientation = orientation; + return this; + } + + /** + * Target orientation (e.g. `PORTRAIT`, `LANDSCAPE`). + * @return orientation + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ORIENTATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getOrientation() { + return orientation; + } + + + @JsonProperty(JSON_PROPERTY_ORIENTATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setOrientation(@jakarta.annotation.Nonnull String orientation) { + this.orientation = orientation; + } + + + /** + * Return true if this UIOrientationRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UIOrientationRequest uiOrientationRequest = (UIOrientationRequest) o; + return Objects.equals(this.orientation, uiOrientationRequest.orientation); + } + + @Override + public int hashCode() { + return Objects.hash(orientation); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UIOrientationRequest {\n"); + sb.append(" orientation: ").append(toIndentedString(orientation)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `orientation` to the URL query string + if (getOrientation() != null) { + joiner.add(String.format("%sorientation%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getOrientation()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/UISwipeRequest.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/UISwipeRequest.java new file mode 100644 index 000000000..e6242b8a6 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/UISwipeRequest.java @@ -0,0 +1,295 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `POST /device/{udid}/ui/swipe` request — drag from (x1,y1) to (x2,y2). + */ +@JsonPropertyOrder({ + UISwipeRequest.JSON_PROPERTY_X1, + UISwipeRequest.JSON_PROPERTY_Y1, + UISwipeRequest.JSON_PROPERTY_X2, + UISwipeRequest.JSON_PROPERTY_Y2, + UISwipeRequest.JSON_PROPERTY_DURATION +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class UISwipeRequest { + public static final String JSON_PROPERTY_X1 = "x1"; + @jakarta.annotation.Nonnull + private Integer x1; + + public static final String JSON_PROPERTY_Y1 = "y1"; + @jakarta.annotation.Nonnull + private Integer y1; + + public static final String JSON_PROPERTY_X2 = "x2"; + @jakarta.annotation.Nonnull + private Integer x2; + + public static final String JSON_PROPERTY_Y2 = "y2"; + @jakarta.annotation.Nonnull + private Integer y2; + + public static final String JSON_PROPERTY_DURATION = "duration"; + @jakarta.annotation.Nullable + private Double duration; + + public UISwipeRequest() { + } + + public UISwipeRequest x1(@jakarta.annotation.Nonnull Integer x1) { + this.x1 = x1; + return this; + } + + /** + * Get x1 + * @return x1 + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_X1) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getX1() { + return x1; + } + + + @JsonProperty(JSON_PROPERTY_X1) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setX1(@jakarta.annotation.Nonnull Integer x1) { + this.x1 = x1; + } + + + public UISwipeRequest y1(@jakarta.annotation.Nonnull Integer y1) { + this.y1 = y1; + return this; + } + + /** + * Get y1 + * @return y1 + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_Y1) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getY1() { + return y1; + } + + + @JsonProperty(JSON_PROPERTY_Y1) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setY1(@jakarta.annotation.Nonnull Integer y1) { + this.y1 = y1; + } + + + public UISwipeRequest x2(@jakarta.annotation.Nonnull Integer x2) { + this.x2 = x2; + return this; + } + + /** + * Get x2 + * @return x2 + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_X2) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getX2() { + return x2; + } + + + @JsonProperty(JSON_PROPERTY_X2) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setX2(@jakarta.annotation.Nonnull Integer x2) { + this.x2 = x2; + } + + + public UISwipeRequest y2(@jakarta.annotation.Nonnull Integer y2) { + this.y2 = y2; + return this; + } + + /** + * Get y2 + * @return y2 + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_Y2) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getY2() { + return y2; + } + + + @JsonProperty(JSON_PROPERTY_Y2) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setY2(@jakarta.annotation.Nonnull Integer y2) { + this.y2 = y2; + } + + + public UISwipeRequest duration(@jakarta.annotation.Nullable Double duration) { + this.duration = duration; + return this; + } + + /** + * Gesture duration in seconds. + * @return duration + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getDuration() { + return duration; + } + + + @JsonProperty(JSON_PROPERTY_DURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDuration(@jakarta.annotation.Nullable Double duration) { + this.duration = duration; + } + + + /** + * Return true if this UISwipeRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UISwipeRequest uiSwipeRequest = (UISwipeRequest) o; + return Objects.equals(this.x1, uiSwipeRequest.x1) && + Objects.equals(this.y1, uiSwipeRequest.y1) && + Objects.equals(this.x2, uiSwipeRequest.x2) && + Objects.equals(this.y2, uiSwipeRequest.y2) && + Objects.equals(this.duration, uiSwipeRequest.duration); + } + + @Override + public int hashCode() { + return Objects.hash(x1, y1, x2, y2, duration); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UISwipeRequest {\n"); + sb.append(" x1: ").append(toIndentedString(x1)).append("\n"); + sb.append(" y1: ").append(toIndentedString(y1)).append("\n"); + sb.append(" x2: ").append(toIndentedString(x2)).append("\n"); + sb.append(" y2: ").append(toIndentedString(y2)).append("\n"); + sb.append(" duration: ").append(toIndentedString(duration)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `x1` to the URL query string + if (getX1() != null) { + joiner.add(String.format("%sx1%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getX1()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `y1` to the URL query string + if (getY1() != null) { + joiner.add(String.format("%sy1%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getY1()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `x2` to the URL query string + if (getX2() != null) { + joiner.add(String.format("%sx2%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getX2()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `y2` to the URL query string + if (getY2() != null) { + joiner.add(String.format("%sy2%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getY2()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `duration` to the URL query string + if (getDuration() != null) { + joiner.add(String.format("%sduration%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getDuration()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/UITapRequest.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/UITapRequest.java new file mode 100644 index 000000000..5e45d5953 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/UITapRequest.java @@ -0,0 +1,187 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `POST /device/{udid}/ui/tap` request — absolute coordinates. + */ +@JsonPropertyOrder({ + UITapRequest.JSON_PROPERTY_X, + UITapRequest.JSON_PROPERTY_Y +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class UITapRequest { + public static final String JSON_PROPERTY_X = "x"; + @jakarta.annotation.Nonnull + private Integer x; + + public static final String JSON_PROPERTY_Y = "y"; + @jakarta.annotation.Nonnull + private Integer y; + + public UITapRequest() { + } + + public UITapRequest x(@jakarta.annotation.Nonnull Integer x) { + this.x = x; + return this; + } + + /** + * Get x + * @return x + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_X) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getX() { + return x; + } + + + @JsonProperty(JSON_PROPERTY_X) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setX(@jakarta.annotation.Nonnull Integer x) { + this.x = x; + } + + + public UITapRequest y(@jakarta.annotation.Nonnull Integer y) { + this.y = y; + return this; + } + + /** + * Get y + * @return y + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_Y) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getY() { + return y; + } + + + @JsonProperty(JSON_PROPERTY_Y) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setY(@jakarta.annotation.Nonnull Integer y) { + this.y = y; + } + + + /** + * Return true if this UITapRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UITapRequest uiTapRequest = (UITapRequest) o; + return Objects.equals(this.x, uiTapRequest.x) && + Objects.equals(this.y, uiTapRequest.y); + } + + @Override + public int hashCode() { + return Objects.hash(x, y); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UITapRequest {\n"); + sb.append(" x: ").append(toIndentedString(x)).append("\n"); + sb.append(" y: ").append(toIndentedString(y)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `x` to the URL query string + if (getX() != null) { + joiner.add(String.format("%sx%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getX()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `y` to the URL query string + if (getY() != null) { + joiner.add(String.format("%sy%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getY()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/UITypeRequest.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/UITypeRequest.java new file mode 100644 index 000000000..1d494d23c --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/UITypeRequest.java @@ -0,0 +1,151 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `POST /device/{udid}/ui/type` request — keyboard input. + */ +@JsonPropertyOrder({ + UITypeRequest.JSON_PROPERTY_TEXT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class UITypeRequest { + public static final String JSON_PROPERTY_TEXT = "text"; + @jakarta.annotation.Nonnull + private String text; + + public UITypeRequest() { + } + + public UITypeRequest text(@jakarta.annotation.Nonnull String text) { + this.text = text; + return this; + } + + /** + * Get text + * @return text + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getText() { + return text; + } + + + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setText(@jakarta.annotation.Nonnull String text) { + this.text = text; + } + + + /** + * Return true if this UITypeRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UITypeRequest uiTypeRequest = (UITypeRequest) o; + return Objects.equals(this.text, uiTypeRequest.text); + } + + @Override + public int hashCode() { + return Objects.hash(text); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UITypeRequest {\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `text` to the URL query string + if (getText() != null) { + joiner.add(String.format("%stext%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getText()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/UnlockToken.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/UnlockToken.java new file mode 100644 index 000000000..809a5d678 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/UnlockToken.java @@ -0,0 +1,151 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `POST /device/{udid}/mdm/fetch-unlock-token` — base64 escrow unlock token. + */ +@JsonPropertyOrder({ + UnlockToken.JSON_PROPERTY_TOKEN +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class UnlockToken { + public static final String JSON_PROPERTY_TOKEN = "token"; + @jakarta.annotation.Nonnull + private String token; + + public UnlockToken() { + } + + public UnlockToken token(@jakarta.annotation.Nonnull String token) { + this.token = token; + return this; + } + + /** + * Base64-encoded escrow unlock token. + * @return token + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TOKEN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getToken() { + return token; + } + + + @JsonProperty(JSON_PROPERTY_TOKEN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setToken(@jakarta.annotation.Nonnull String token) { + this.token = token; + } + + + /** + * Return true if this UnlockToken object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnlockToken unlockToken = (UnlockToken) o; + return Objects.equals(this.token, unlockToken.token); + } + + @Override + public int hashCode() { + return Objects.hash(token); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnlockToken {\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `token` to the URL query string + if (getToken() != null) { + joiner.add(String.format("%stoken%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getToken()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/VoiceOverState.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/VoiceOverState.java new file mode 100644 index 000000000..4fb1e9973 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/VoiceOverState.java @@ -0,0 +1,151 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `GET|PUT /device/{udid}/voiceover` — VoiceOver enabled state. + */ +@JsonPropertyOrder({ + VoiceOverState.JSON_PROPERTY_VOICE_OVER_ENABLED +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class VoiceOverState { + public static final String JSON_PROPERTY_VOICE_OVER_ENABLED = "VoiceOverEnabled"; + @jakarta.annotation.Nonnull + private Boolean voiceOverEnabled; + + public VoiceOverState() { + } + + public VoiceOverState voiceOverEnabled(@jakarta.annotation.Nonnull Boolean voiceOverEnabled) { + this.voiceOverEnabled = voiceOverEnabled; + return this; + } + + /** + * Get voiceOverEnabled + * @return voiceOverEnabled + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VOICE_OVER_ENABLED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getVoiceOverEnabled() { + return voiceOverEnabled; + } + + + @JsonProperty(JSON_PROPERTY_VOICE_OVER_ENABLED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setVoiceOverEnabled(@jakarta.annotation.Nonnull Boolean voiceOverEnabled) { + this.voiceOverEnabled = voiceOverEnabled; + } + + + /** + * Return true if this VoiceOverState object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VoiceOverState voiceOverState = (VoiceOverState) o; + return Objects.equals(this.voiceOverEnabled, voiceOverState.voiceOverEnabled); + } + + @Override + public int hashCode() { + return Objects.hash(voiceOverEnabled); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VoiceOverState {\n"); + sb.append(" voiceOverEnabled: ").append(toIndentedString(voiceOverEnabled)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `VoiceOverEnabled` to the URL query string + if (getVoiceOverEnabled() != null) { + joiner.add(String.format("%sVoiceOverEnabled%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getVoiceOverEnabled()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/WdaConfig.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/WdaConfig.java new file mode 100644 index 000000000..6f3ba5b83 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/WdaConfig.java @@ -0,0 +1,309 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * Configuration for launching a WebDriverAgent (XCUITest) runner session. + */ +@JsonPropertyOrder({ + WdaConfig.JSON_PROPERTY_BUNDLE_ID, + WdaConfig.JSON_PROPERTY_TEST_BUNDLE_ID, + WdaConfig.JSON_PROPERTY_XC_TEST_CONFIG, + WdaConfig.JSON_PROPERTY_ARGS, + WdaConfig.JSON_PROPERTY_ENV +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class WdaConfig { + public static final String JSON_PROPERTY_BUNDLE_ID = "bundleId"; + @jakarta.annotation.Nonnull + private String bundleId; + + public static final String JSON_PROPERTY_TEST_BUNDLE_ID = "testBundleId"; + @jakarta.annotation.Nonnull + private String testBundleId; + + public static final String JSON_PROPERTY_XC_TEST_CONFIG = "xcTestConfig"; + @jakarta.annotation.Nonnull + private String xcTestConfig; + + public static final String JSON_PROPERTY_ARGS = "args"; + @jakarta.annotation.Nullable + private List args = new ArrayList<>(); + + public static final String JSON_PROPERTY_ENV = "env"; + @jakarta.annotation.Nullable + private Object env; + + public WdaConfig() { + } + + public WdaConfig bundleId(@jakarta.annotation.Nonnull String bundleId) { + this.bundleId = bundleId; + return this; + } + + /** + * Bundle id of the WDA runner host app (e.g. `com.facebook.WebDriverAgentRunner.xctrunner`). + * @return bundleId + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_BUNDLE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getBundleId() { + return bundleId; + } + + + @JsonProperty(JSON_PROPERTY_BUNDLE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setBundleId(@jakarta.annotation.Nonnull String bundleId) { + this.bundleId = bundleId; + } + + + public WdaConfig testBundleId(@jakarta.annotation.Nonnull String testBundleId) { + this.testBundleId = testBundleId; + return this; + } + + /** + * Bundle id of the XCTest test bundle. + * @return testBundleId + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEST_BUNDLE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTestBundleId() { + return testBundleId; + } + + + @JsonProperty(JSON_PROPERTY_TEST_BUNDLE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTestBundleId(@jakarta.annotation.Nonnull String testBundleId) { + this.testBundleId = testBundleId; + } + + + public WdaConfig xcTestConfig(@jakarta.annotation.Nonnull String xcTestConfig) { + this.xcTestConfig = xcTestConfig; + return this; + } + + /** + * Path/name of the `.xctestconfiguration` to use. + * @return xcTestConfig + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_XC_TEST_CONFIG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getXcTestConfig() { + return xcTestConfig; + } + + + @JsonProperty(JSON_PROPERTY_XC_TEST_CONFIG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setXcTestConfig(@jakarta.annotation.Nonnull String xcTestConfig) { + this.xcTestConfig = xcTestConfig; + } + + + public WdaConfig args(@jakarta.annotation.Nullable List args) { + this.args = args; + return this; + } + + public WdaConfig addArgsItem(String argsItem) { + if (this.args == null) { + this.args = new ArrayList<>(); + } + this.args.add(argsItem); + return this; + } + + /** + * Extra process arguments passed to the runner. + * @return args + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ARGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArgs() { + return args; + } + + + @JsonProperty(JSON_PROPERTY_ARGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArgs(@jakarta.annotation.Nullable List args) { + this.args = args; + } + + + public WdaConfig env(@jakarta.annotation.Nullable Object env) { + this.env = env; + return this; + } + + /** + * Extra environment variables passed to the runner. + * @return env + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENV) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getEnv() { + return env; + } + + + @JsonProperty(JSON_PROPERTY_ENV) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnv(@jakarta.annotation.Nullable Object env) { + this.env = env; + } + + + /** + * Return true if this WdaConfig object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WdaConfig wdaConfig = (WdaConfig) o; + return Objects.equals(this.bundleId, wdaConfig.bundleId) && + Objects.equals(this.testBundleId, wdaConfig.testBundleId) && + Objects.equals(this.xcTestConfig, wdaConfig.xcTestConfig) && + Objects.equals(this.args, wdaConfig.args) && + Objects.equals(this.env, wdaConfig.env); + } + + @Override + public int hashCode() { + return Objects.hash(bundleId, testBundleId, xcTestConfig, args, env); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WdaConfig {\n"); + sb.append(" bundleId: ").append(toIndentedString(bundleId)).append("\n"); + sb.append(" testBundleId: ").append(toIndentedString(testBundleId)).append("\n"); + sb.append(" xcTestConfig: ").append(toIndentedString(xcTestConfig)).append("\n"); + sb.append(" args: ").append(toIndentedString(args)).append("\n"); + sb.append(" env: ").append(toIndentedString(env)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `bundleId` to the URL query string + if (getBundleId() != null) { + joiner.add(String.format("%sbundleId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getBundleId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `testBundleId` to the URL query string + if (getTestBundleId() != null) { + joiner.add(String.format("%stestBundleId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getTestBundleId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `xcTestConfig` to the URL query string + if (getXcTestConfig() != null) { + joiner.add(String.format("%sxcTestConfig%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getXcTestConfig()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `args` to the URL query string + if (getArgs() != null) { + for (int i = 0; i < getArgs().size(); i++) { + joiner.add(String.format("%sargs%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(ApiClient.valueToString(getArgs().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + + // add `env` to the URL query string + if (getEnv() != null) { + joiner.add(String.format("%senv%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getEnv()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/WdaSession.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/WdaSession.java new file mode 100644 index 000000000..71caece8b --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/WdaSession.java @@ -0,0 +1,224 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.github.danielpaulus.goios.generated.model.WdaConfig; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * A running WebDriverAgent session. + */ +@JsonPropertyOrder({ + WdaSession.JSON_PROPERTY_CONFIG, + WdaSession.JSON_PROPERTY_SESSION_ID, + WdaSession.JSON_PROPERTY_UDID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class WdaSession { + public static final String JSON_PROPERTY_CONFIG = "config"; + @jakarta.annotation.Nonnull + private WdaConfig config; + + public static final String JSON_PROPERTY_SESSION_ID = "sessionId"; + @jakarta.annotation.Nonnull + private String sessionId; + + public static final String JSON_PROPERTY_UDID = "udid"; + @jakarta.annotation.Nonnull + private String udid; + + public WdaSession() { + } + + public WdaSession config(@jakarta.annotation.Nonnull WdaConfig config) { + this.config = config; + return this; + } + + /** + * The configuration the session was started with. + * @return config + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CONFIG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public WdaConfig getConfig() { + return config; + } + + + @JsonProperty(JSON_PROPERTY_CONFIG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setConfig(@jakarta.annotation.Nonnull WdaConfig config) { + this.config = config; + } + + + public WdaSession sessionId(@jakarta.annotation.Nonnull String sessionId) { + this.sessionId = sessionId; + return this; + } + + /** + * Opaque session identifier. + * @return sessionId + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSessionId() { + return sessionId; + } + + + @JsonProperty(JSON_PROPERTY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSessionId(@jakarta.annotation.Nonnull String sessionId) { + this.sessionId = sessionId; + } + + + public WdaSession udid(@jakarta.annotation.Nonnull String udid) { + this.udid = udid; + return this; + } + + /** + * The device udid the session runs on. + * @return udid + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_UDID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUdid() { + return udid; + } + + + @JsonProperty(JSON_PROPERTY_UDID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUdid(@jakarta.annotation.Nonnull String udid) { + this.udid = udid; + } + + + /** + * Return true if this WdaSession object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WdaSession wdaSession = (WdaSession) o; + return Objects.equals(this.config, wdaSession.config) && + Objects.equals(this.sessionId, wdaSession.sessionId) && + Objects.equals(this.udid, wdaSession.udid); + } + + @Override + public int hashCode() { + return Objects.hash(config, sessionId, udid); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WdaSession {\n"); + sb.append(" config: ").append(toIndentedString(config)).append("\n"); + sb.append(" sessionId: ").append(toIndentedString(sessionId)).append("\n"); + sb.append(" udid: ").append(toIndentedString(udid)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `config` to the URL query string + if (getConfig() != null) { + joiner.add(getConfig().toUrlQueryString(prefix + "config" + suffix)); + } + + // add `sessionId` to the URL query string + if (getSessionId() != null) { + joiner.add(String.format("%ssessionId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSessionId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `udid` to the URL query string + if (getUdid() != null) { + joiner.add(String.format("%sudid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getUdid()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/WebInspectorEvalRequest.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/WebInspectorEvalRequest.java new file mode 100644 index 000000000..2661f34a4 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/WebInspectorEvalRequest.java @@ -0,0 +1,223 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `POST /device/{udid}/webinspector/eval` request body. + */ +@JsonPropertyOrder({ + WebInspectorEvalRequest.JSON_PROPERTY_PAGE, + WebInspectorEvalRequest.JSON_PROPERTY_BUNDLE_ID, + WebInspectorEvalRequest.JSON_PROPERTY_SCRIPT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class WebInspectorEvalRequest { + public static final String JSON_PROPERTY_PAGE = "page"; + @jakarta.annotation.Nullable + private String page; + + public static final String JSON_PROPERTY_BUNDLE_ID = "bundleId"; + @jakarta.annotation.Nullable + private String bundleId; + + public static final String JSON_PROPERTY_SCRIPT = "script"; + @jakarta.annotation.Nonnull + private String script; + + public WebInspectorEvalRequest() { + } + + public WebInspectorEvalRequest page(@jakarta.annotation.Nullable String page) { + this.page = page; + return this; + } + + /** + * Inspectable page key. When empty the first matching web/javascript page (optionally scoped by `bundleId`) is used. + * @return page + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPage() { + return page; + } + + + @JsonProperty(JSON_PROPERTY_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPage(@jakarta.annotation.Nullable String page) { + this.page = page; + } + + + public WebInspectorEvalRequest bundleId(@jakarta.annotation.Nullable String bundleId) { + this.bundleId = bundleId; + return this; + } + + /** + * Optional bundle id to scope page selection. + * @return bundleId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BUNDLE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBundleId() { + return bundleId; + } + + + @JsonProperty(JSON_PROPERTY_BUNDLE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBundleId(@jakarta.annotation.Nullable String bundleId) { + this.bundleId = bundleId; + } + + + public WebInspectorEvalRequest script(@jakarta.annotation.Nonnull String script) { + this.script = script; + return this; + } + + /** + * JavaScript source to evaluate. Required. + * @return script + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SCRIPT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getScript() { + return script; + } + + + @JsonProperty(JSON_PROPERTY_SCRIPT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setScript(@jakarta.annotation.Nonnull String script) { + this.script = script; + } + + + /** + * Return true if this WebInspectorEvalRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebInspectorEvalRequest webInspectorEvalRequest = (WebInspectorEvalRequest) o; + return Objects.equals(this.page, webInspectorEvalRequest.page) && + Objects.equals(this.bundleId, webInspectorEvalRequest.bundleId) && + Objects.equals(this.script, webInspectorEvalRequest.script); + } + + @Override + public int hashCode() { + return Objects.hash(page, bundleId, script); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebInspectorEvalRequest {\n"); + sb.append(" page: ").append(toIndentedString(page)).append("\n"); + sb.append(" bundleId: ").append(toIndentedString(bundleId)).append("\n"); + sb.append(" script: ").append(toIndentedString(script)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `page` to the URL query string + if (getPage() != null) { + joiner.add(String.format("%spage%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPage()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `bundleId` to the URL query string + if (getBundleId() != null) { + joiner.add(String.format("%sbundleId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getBundleId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `script` to the URL query string + if (getScript() != null) { + joiner.add(String.format("%sscript%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getScript()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/WebInspectorEvalResult.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/WebInspectorEvalResult.java new file mode 100644 index 000000000..4e7a17a69 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/WebInspectorEvalResult.java @@ -0,0 +1,187 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `POST /device/{udid}/webinspector/eval` — evaluation result. + */ +@JsonPropertyOrder({ + WebInspectorEvalResult.JSON_PROPERTY_PAGE, + WebInspectorEvalResult.JSON_PROPERTY_RESULT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class WebInspectorEvalResult { + public static final String JSON_PROPERTY_PAGE = "page"; + @jakarta.annotation.Nonnull + private String page; + + public static final String JSON_PROPERTY_RESULT = "result"; + @jakarta.annotation.Nullable + private Object result = null; + + public WebInspectorEvalResult() { + } + + public WebInspectorEvalResult page(@jakarta.annotation.Nonnull String page) { + this.page = page; + return this; + } + + /** + * The page key the script ran in. + * @return page + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPage() { + return page; + } + + + @JsonProperty(JSON_PROPERTY_PAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPage(@jakarta.annotation.Nonnull String page) { + this.page = page; + } + + + public WebInspectorEvalResult result(@jakarta.annotation.Nullable Object result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESULT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Object getResult() { + return result; + } + + + @JsonProperty(JSON_PROPERTY_RESULT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setResult(@jakarta.annotation.Nullable Object result) { + this.result = result; + } + + + /** + * Return true if this WebInspectorEvalResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebInspectorEvalResult webInspectorEvalResult = (WebInspectorEvalResult) o; + return Objects.equals(this.page, webInspectorEvalResult.page) && + Objects.equals(this.result, webInspectorEvalResult.result); + } + + @Override + public int hashCode() { + return Objects.hash(page, result); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebInspectorEvalResult {\n"); + sb.append(" page: ").append(toIndentedString(page)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `page` to the URL query string + if (getPage() != null) { + joiner.add(String.format("%spage%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPage()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `result` to the URL query string + if (getResult() != null) { + joiner.add(String.format("%sresult%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getResult()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/WebInspectorLaunchRequest.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/WebInspectorLaunchRequest.java new file mode 100644 index 000000000..8f658192e --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/WebInspectorLaunchRequest.java @@ -0,0 +1,187 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `POST /device/{udid}/webinspector/launch` request body. + */ +@JsonPropertyOrder({ + WebInspectorLaunchRequest.JSON_PROPERTY_URL, + WebInspectorLaunchRequest.JSON_PROPERTY_BUNDLE_ID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class WebInspectorLaunchRequest { + public static final String JSON_PROPERTY_URL = "url"; + @jakarta.annotation.Nullable + private String url; + + public static final String JSON_PROPERTY_BUNDLE_ID = "bundleId"; + @jakarta.annotation.Nullable + private String bundleId; + + public WebInspectorLaunchRequest() { + } + + public WebInspectorLaunchRequest url(@jakarta.annotation.Nullable String url) { + this.url = url; + return this; + } + + /** + * URL to open. May alternatively be supplied as the `url` query param. + * @return url + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrl() { + return url; + } + + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(@jakarta.annotation.Nullable String url) { + this.url = url; + } + + + public WebInspectorLaunchRequest bundleId(@jakarta.annotation.Nullable String bundleId) { + this.bundleId = bundleId; + return this; + } + + /** + * Bundle id to open the URL in. Defaults to Safari. + * @return bundleId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BUNDLE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBundleId() { + return bundleId; + } + + + @JsonProperty(JSON_PROPERTY_BUNDLE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBundleId(@jakarta.annotation.Nullable String bundleId) { + this.bundleId = bundleId; + } + + + /** + * Return true if this WebInspectorLaunchRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebInspectorLaunchRequest webInspectorLaunchRequest = (WebInspectorLaunchRequest) o; + return Objects.equals(this.url, webInspectorLaunchRequest.url) && + Objects.equals(this.bundleId, webInspectorLaunchRequest.bundleId); + } + + @Override + public int hashCode() { + return Objects.hash(url, bundleId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebInspectorLaunchRequest {\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" bundleId: ").append(toIndentedString(bundleId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `url` to the URL query string + if (getUrl() != null) { + joiner.add(String.format("%surl%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getUrl()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `bundleId` to the URL query string + if (getBundleId() != null) { + joiner.add(String.format("%sbundleId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getBundleId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/WebInspectorLaunchResult.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/WebInspectorLaunchResult.java new file mode 100644 index 000000000..ab18b4b68 --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/WebInspectorLaunchResult.java @@ -0,0 +1,223 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `POST /device/{udid}/webinspector/launch` — result of opening a URL. + */ +@JsonPropertyOrder({ + WebInspectorLaunchResult.JSON_PROPERTY_BUNDLE_ID, + WebInspectorLaunchResult.JSON_PROPERTY_URL, + WebInspectorLaunchResult.JSON_PROPERTY_TITLE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class WebInspectorLaunchResult { + public static final String JSON_PROPERTY_BUNDLE_ID = "bundleId"; + @jakarta.annotation.Nonnull + private String bundleId; + + public static final String JSON_PROPERTY_URL = "url"; + @jakarta.annotation.Nonnull + private String url; + + public static final String JSON_PROPERTY_TITLE = "title"; + @jakarta.annotation.Nonnull + private String title; + + public WebInspectorLaunchResult() { + } + + public WebInspectorLaunchResult bundleId(@jakarta.annotation.Nonnull String bundleId) { + this.bundleId = bundleId; + return this; + } + + /** + * Bundle id the page was opened in. + * @return bundleId + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_BUNDLE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getBundleId() { + return bundleId; + } + + + @JsonProperty(JSON_PROPERTY_BUNDLE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setBundleId(@jakarta.annotation.Nonnull String bundleId) { + this.bundleId = bundleId; + } + + + public WebInspectorLaunchResult url(@jakarta.annotation.Nonnull String url) { + this.url = url; + return this; + } + + /** + * The resolved current URL after navigation. + * @return url + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUrl() { + return url; + } + + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUrl(@jakarta.annotation.Nonnull String url) { + this.url = url; + } + + + public WebInspectorLaunchResult title(@jakarta.annotation.Nonnull String title) { + this.title = title; + return this; + } + + /** + * The page title after navigation. + * @return title + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTitle(@jakarta.annotation.Nonnull String title) { + this.title = title; + } + + + /** + * Return true if this WebInspectorLaunchResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebInspectorLaunchResult webInspectorLaunchResult = (WebInspectorLaunchResult) o; + return Objects.equals(this.bundleId, webInspectorLaunchResult.bundleId) && + Objects.equals(this.url, webInspectorLaunchResult.url) && + Objects.equals(this.title, webInspectorLaunchResult.title); + } + + @Override + public int hashCode() { + return Objects.hash(bundleId, url, title); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebInspectorLaunchResult {\n"); + sb.append(" bundleId: ").append(toIndentedString(bundleId)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `bundleId` to the URL query string + if (getBundleId() != null) { + joiner.add(String.format("%sbundleId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getBundleId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `url` to the URL query string + if (getUrl() != null) { + joiner.add(String.format("%surl%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getUrl()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `title` to the URL query string + if (getTitle() != null) { + joiner.add(String.format("%stitle%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getTitle()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/WifiRequest.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/WifiRequest.java new file mode 100644 index 000000000..7607b079b --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/WifiRequest.java @@ -0,0 +1,223 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `PUT /device/{udid}/wifi` request. + */ +@JsonPropertyOrder({ + WifiRequest.JSON_PROPERTY_SSID, + WifiRequest.JSON_PROPERTY_PASSWORD, + WifiRequest.JSON_PROPERTY_ENC_TYPE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class WifiRequest { + public static final String JSON_PROPERTY_SSID = "ssid"; + @jakarta.annotation.Nonnull + private String ssid; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + @jakarta.annotation.Nullable + private String password; + + public static final String JSON_PROPERTY_ENC_TYPE = "encType"; + @jakarta.annotation.Nullable + private String encType; + + public WifiRequest() { + } + + public WifiRequest ssid(@jakarta.annotation.Nonnull String ssid) { + this.ssid = ssid; + return this; + } + + /** + * Get ssid + * @return ssid + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SSID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSsid() { + return ssid; + } + + + @JsonProperty(JSON_PROPERTY_SSID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSsid(@jakarta.annotation.Nonnull String ssid) { + this.ssid = ssid; + } + + + public WifiRequest password(@jakarta.annotation.Nullable String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { + return password; + } + + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(@jakarta.annotation.Nullable String password) { + this.password = password; + } + + + public WifiRequest encType(@jakarta.annotation.Nullable String encType) { + this.encType = encType; + return this; + } + + /** + * Encryption type, e.g. `WPA2`, `WPA`, `WEP`, `None`. + * @return encType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENC_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEncType() { + return encType; + } + + + @JsonProperty(JSON_PROPERTY_ENC_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEncType(@jakarta.annotation.Nullable String encType) { + this.encType = encType; + } + + + /** + * Return true if this WifiRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WifiRequest wifiRequest = (WifiRequest) o; + return Objects.equals(this.ssid, wifiRequest.ssid) && + Objects.equals(this.password, wifiRequest.password) && + Objects.equals(this.encType, wifiRequest.encType); + } + + @Override + public int hashCode() { + return Objects.hash(ssid, password, encType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WifiRequest {\n"); + sb.append(" ssid: ").append(toIndentedString(ssid)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" encType: ").append(toIndentedString(encType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ssid` to the URL query string + if (getSsid() != null) { + joiner.add(String.format("%sssid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSsid()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `password` to the URL query string + if (getPassword() != null) { + joiner.add(String.format("%spassword%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPassword()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `encType` to the URL query string + if (getEncType() != null) { + joiner.add(String.format("%sencType%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getEncType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/ZoomTouchState.java b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/ZoomTouchState.java new file mode 100644 index 000000000..62b53a38d --- /dev/null +++ b/sdks/packages/java/generated/src/main/java/com/github/danielpaulus/goios/generated/model/ZoomTouchState.java @@ -0,0 +1,151 @@ +/* + * go-ios REST API + * go-ios REST API. This is the *ideal* contract for the go-ios REST server. It is authored spec-first in TypeSpec and emitted to OpenAPI 3.1; the go-ios server conforms to this document (there is no backward-compatibility constraint yet). ## Authentication Every route under `/api/v1` requires a bearer token: `Authorization: Bearer `. The server refuses to start unless either an API key is configured or it is launched with `--disable-auth`. When the server is started with `--disable-auth`, authentication is **not** enforced and the `Authorization` header may be omitted. The Swagger UI (`/swagger/_*`) is always unauthenticated and lives outside `/api/v1`, so it is not modeled here. ## Device routing Device-scoped routes live under `/device/{udid}`. A middleware resolves the udid: an unknown udid yields `404`, an empty udid yields `422`. The `/device/{udid}/apps` subgroup is serialized per-udid (one concurrent request per device). ## Streaming Long-lived endpoints (`/notifications`, `/ostrace`, `/syslog`, `/listen`, `/sysmontap` and the async `/jobs/{id}/logs`) are modeled as real Server-Sent Events (`text/event-stream`) with typed event payloads. See streaming.tsp. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.github.danielpaulus.goios.generated.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.github.danielpaulus.goios.generated.invoker.ApiClient; +/** + * `GET|PUT /device/{udid}/zoom` — ZoomTouch enabled state. + */ +@JsonPropertyOrder({ + ZoomTouchState.JSON_PROPERTY_ZOOM_TOUCH_ENABLED +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.11.0") +public class ZoomTouchState { + public static final String JSON_PROPERTY_ZOOM_TOUCH_ENABLED = "ZoomTouchEnabled"; + @jakarta.annotation.Nonnull + private Boolean zoomTouchEnabled; + + public ZoomTouchState() { + } + + public ZoomTouchState zoomTouchEnabled(@jakarta.annotation.Nonnull Boolean zoomTouchEnabled) { + this.zoomTouchEnabled = zoomTouchEnabled; + return this; + } + + /** + * Get zoomTouchEnabled + * @return zoomTouchEnabled + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ZOOM_TOUCH_ENABLED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getZoomTouchEnabled() { + return zoomTouchEnabled; + } + + + @JsonProperty(JSON_PROPERTY_ZOOM_TOUCH_ENABLED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setZoomTouchEnabled(@jakarta.annotation.Nonnull Boolean zoomTouchEnabled) { + this.zoomTouchEnabled = zoomTouchEnabled; + } + + + /** + * Return true if this ZoomTouchState object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ZoomTouchState zoomTouchState = (ZoomTouchState) o; + return Objects.equals(this.zoomTouchEnabled, zoomTouchState.zoomTouchEnabled); + } + + @Override + public int hashCode() { + return Objects.hash(zoomTouchEnabled); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ZoomTouchState {\n"); + sb.append(" zoomTouchEnabled: ").append(toIndentedString(zoomTouchEnabled)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ZoomTouchEnabled` to the URL query string + if (getZoomTouchEnabled() != null) { + joiner.add(String.format("%sZoomTouchEnabled%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getZoomTouchEnabled()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/sdks/packages/java/openapi-generator-config.yaml b/sdks/packages/java/openapi-generator-config.yaml new file mode 100644 index 000000000..7473b6fbd --- /dev/null +++ b/sdks/packages/java/openapi-generator-config.yaml @@ -0,0 +1,34 @@ +# openapi-generator config for the go-ios Java SDK low-level client. +# +# Generator: java (openapi-generator 7.11.0), pinned in scripts/generate.sh. +# HTTP library: native (java.net.http.HttpClient), Java 17 baseline. +# +# Regenerate with: ./scripts/generate.sh +# Generated sources land in generated/ and ARE committed (see README). +generatorName: java +library: native +inputSpec: ../../spec/openapi/openapi.yaml +outputDir: generated + +# Only emit the source tree we need; the hand-written facade + Maven build +# own packaging, tests, and docs. +globalProperties: + models: "" + apis: "" + supportingFiles: "" + modelDocs: "false" + apiDocs: "false" + modelTests: "false" + apiTests: "false" + +additionalProperties: + apiPackage: com.github.danielpaulus.goios.generated.api + modelPackage: com.github.danielpaulus.goios.generated.model + invokerPackage: com.github.danielpaulus.goios.generated.invoker + # We build the generated sources inside the parent Maven module, so skip the + # generator's own pom/gradle scaffolding. + hideGenerationTimestamp: true + openApiNullable: false + useJakartaEe: true + disallowAdditionalPropertiesIfNotPresent: false + sourceFolder: src/main/java diff --git a/sdks/packages/java/pom.xml b/sdks/packages/java/pom.xml new file mode 100644 index 000000000..7141f20fe --- /dev/null +++ b/sdks/packages/java/pom.xml @@ -0,0 +1,195 @@ + + + 4.0.0 + + com.github.danielpaulus + go-ios-sdk + 0.1.0-SNAPSHOT + jar + + go-ios Java SDK + Java SDK for the go-ios REST API: device automation, apps, WebDriverAgent, and typed Server-Sent Event streams. + https://github.com/danielpaulus/go-ios + + + + MIT License + https://opensource.org/licenses/MIT + repo + + + + + + danielpaulus + Daniel Paulus + https://github.com/danielpaulus + + + + + scm:git:https://github.com/danielpaulus/go-ios-sdks.git + scm:git:ssh://git@github.com/danielpaulus/go-ios-sdks.git + https://github.com/danielpaulus/go-ios-sdks + + + + UTF-8 + 17 + 2.18.2 + 5.11.4 + + + + + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson.version} + + + + org.apache.httpcomponents + httpmime + 4.5.14 + + + + jakarta.annotation + jakarta.annotation-api + 3.0.0 + + + + + org.junit.jupiter + junit-jupiter + ${junit.version} + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.6.0 + + + add-generated-sources + generate-sources + + add-source + + + + ${project.basedir}/generated/src/main/java + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.13.0 + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.5.2 + + + + org.apache.maven.plugins + maven-source-plugin + 3.3.1 + + + attach-sources + + jar-no-fork + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.11.2 + + + none + true + + + + attach-javadocs + + jar + + + + + + + + + + + release + + + + org.sonatype.central + central-publishing-maven-plugin + 0.7.0 + true + + central + false + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.2.7 + + + sign-artifacts + verify + + sign + + + + + + + + + diff --git a/sdks/packages/java/scripts/generate.sh b/sdks/packages/java/scripts/generate.sh new file mode 100755 index 000000000..98953ed58 --- /dev/null +++ b/sdks/packages/java/scripts/generate.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# Regenerate the low-level go-ios Java client from the canonical OpenAPI 3.1 spec. +# +# Pinned to openapi-generator-cli 7.11.0 (java generator, native HTTP library). +# Generated sources land in packages/java/generated/ and are committed. +set -euo pipefail + +OPENAPI_GENERATOR_VERSION="7.11.0" +HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +JAR="${HERE}/.tools/openapi-generator-cli.jar" +JAR_URL="https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/${OPENAPI_GENERATOR_VERSION}/openapi-generator-cli-${OPENAPI_GENERATOR_VERSION}.jar" + +if [[ ! -f "${JAR}" ]]; then + echo "Downloading openapi-generator-cli ${OPENAPI_GENERATOR_VERSION}..." + mkdir -p "${HERE}/.tools" + curl -sSL -o "${JAR}" "${JAR_URL}" +fi + +echo "Cleaning generated/ ..." +rm -rf "${HERE}/generated" + +echo "Generating client (java / native, Java 17)..." +cd "${HERE}" +java -jar "${JAR}" generate -c "${HERE}/openapi-generator-config.yaml" + +echo "Done. Generated sources under ${HERE}/generated/src/main/java" diff --git a/sdks/packages/java/scripts/verify.sh b/sdks/packages/java/scripts/verify.sh new file mode 100755 index 000000000..315d56085 --- /dev/null +++ b/sdks/packages/java/scripts/verify.sh @@ -0,0 +1,59 @@ +#!/usr/bin/env bash +# Compile the go-ios Java SDK (committed generated client + hand-written facade) +# and run the JUnit test suite WITHOUT Maven, using javac and the JUnit Platform +# Console Standalone launcher. +# +# This mirrors what `mvn -q package` does, for environments where only a JDK 17+ +# is available. Dependency jars and the JUnit launcher are downloaded once into +# .tools/lib/ (gitignored). +set -euo pipefail + +HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +LIB="${HERE}/.tools/lib" +M="https://repo1.maven.org/maven2" + +JACKSON="2.18.2" +HTTPCORE="4.4.16" +HTTPCLIENT="4.5.14" +JUNIT_LAUNCHER="1.11.4" + +deps=( + "com/fasterxml/jackson/core/jackson-databind/${JACKSON}/jackson-databind-${JACKSON}.jar" + "com/fasterxml/jackson/core/jackson-core/${JACKSON}/jackson-core-${JACKSON}.jar" + "com/fasterxml/jackson/core/jackson-annotations/${JACKSON}/jackson-annotations-${JACKSON}.jar" + "com/fasterxml/jackson/datatype/jackson-datatype-jsr310/${JACKSON}/jackson-datatype-jsr310-${JACKSON}.jar" + "org/apache/httpcomponents/httpmime/${HTTPCLIENT}/httpmime-${HTTPCLIENT}.jar" + "org/apache/httpcomponents/httpclient/${HTTPCLIENT}/httpclient-${HTTPCLIENT}.jar" + "org/apache/httpcomponents/httpcore/${HTTPCORE}/httpcore-${HTTPCORE}.jar" + "jakarta/annotation/jakarta.annotation-api/3.0.0/jakarta.annotation-api-3.0.0.jar" + "org/junit/platform/junit-platform-console-standalone/${JUNIT_LAUNCHER}/junit-platform-console-standalone-${JUNIT_LAUNCHER}.jar" +) + +mkdir -p "${LIB}" +for d in "${deps[@]}"; do + f="${LIB}/$(basename "$d")" + if [[ ! -f "$f" ]]; then + echo "Downloading $(basename "$d")..." + curl -sSL -o "$f" "${M}/${d}" + fi +done + +CP="$(printf '%s:' "${LIB}"/*.jar)" + +echo "Compiling generated client + facade (javac --release 17)..." +rm -rf "${HERE}/target/classes" +mkdir -p "${HERE}/target/classes" +find "${HERE}/generated/src/main/java" "${HERE}/src/main/java" -name '*.java' > "${HERE}/.tools/sources.txt" +javac --release 17 -cp "${CP}" -d "${HERE}/target/classes" @"${HERE}/.tools/sources.txt" + +echo "Compiling tests..." +rm -rf "${HERE}/target/test-classes" +mkdir -p "${HERE}/target/test-classes" +find "${HERE}/src/test/java" -name '*.java' > "${HERE}/.tools/test-sources.txt" +javac --release 17 -cp "${CP}${HERE}/target/classes" -d "${HERE}/target/test-classes" \ + @"${HERE}/.tools/test-sources.txt" + +echo "Running JUnit console..." +java -jar "${LIB}/junit-platform-console-standalone-${JUNIT_LAUNCHER}.jar" execute \ + -cp "${HERE}/target/classes:${HERE}/target/test-classes:${CP}" \ + --scan-classpath diff --git a/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Apps.java b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Apps.java new file mode 100644 index 000000000..dcf1c0443 --- /dev/null +++ b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Apps.java @@ -0,0 +1,52 @@ +package com.github.danielpaulus.goios; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.github.danielpaulus.goios.generated.model.AppInfo; +import com.github.danielpaulus.goios.generated.model.GenericResponse; + +import java.util.List; +import java.util.Map; + +/** App-management operations for a single device. */ +public final class Apps { + + private final Device d; + + Apps(Device d) { + this.d = d; + } + + /** List installed apps ({@code GET /apps/}). */ + public List list() { + List apps = d.http().getJson(d.devicePath("/apps/"), null, + new TypeReference>() { }); + return apps == null ? List.of() : apps; + } + + /** Launch an app by bundle id ({@code POST /apps/launch}). */ + public GenericResponse launch(String bundleId) { + Map q = RawHttp.query(); + q.put("bundleID", bundleId); + return d.http().postJson(d.devicePath("/apps/launch"), q, null, GenericResponse.class); + } + + /** Kill a running app by bundle id ({@code POST /apps/kill}). */ + public GenericResponse kill(String bundleId) { + Map q = RawHttp.query(); + q.put("bundleID", bundleId); + return d.http().postJson(d.devicePath("/apps/kill"), q, null, GenericResponse.class); + } + + /** Install an {@code .ipa}/{@code .app} archive ({@code POST /apps/install}), multipart. */ + public GenericResponse install(byte[] ipa) { + return d.http().multipart("POST", d.devicePath("/apps/install"), null, + RawHttp.parts(RawHttp.Part.file("file", "app.ipa", ipa)), GenericResponse.class); + } + + /** Uninstall an app by bundle id ({@code POST /apps/uninstall}). */ + public GenericResponse uninstall(String bundleId) { + Map q = RawHttp.query(); + q.put("bundleID", bundleId); + return d.http().postJson(d.devicePath("/apps/uninstall"), q, null, GenericResponse.class); + } +} diff --git a/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Crashes.java b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Crashes.java new file mode 100644 index 000000000..fc2d8ca57 --- /dev/null +++ b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Crashes.java @@ -0,0 +1,41 @@ +package com.github.danielpaulus.goios; + +import com.github.danielpaulus.goios.generated.model.CrashListing; +import com.github.danielpaulus.goios.generated.model.GenericResponse; + +import java.util.Map; + +/** Crash-report operations for a single device. */ +public final class Crashes { + + private final Device d; + + Crashes(Device d) { + this.d = d; + } + + /** List crash reports ({@code GET /crashes}); matches all reports. */ + public CrashListing list() { + return list("*"); + } + + /** List crash reports matching {@code pattern} ({@code GET /crashes}). */ + public CrashListing list(String pattern) { + Map q = RawHttp.query(); + q.put("pattern", pattern); + return d.http().getJson(d.devicePath("/crashes"), q, CrashListing.class); + } + + /** Remove crash reports matching {@code pattern} under the current dir ({@code DELETE /crashes}). */ + public GenericResponse remove(String pattern) { + return remove(pattern, "."); + } + + /** Remove crash reports matching {@code pattern} under {@code cwd} ({@code DELETE /crashes}). */ + public GenericResponse remove(String pattern, String cwd) { + Map q = RawHttp.query(); + q.put("cwd", cwd); + q.put("pattern", pattern); + return d.http().deleteJson(d.devicePath("/crashes"), q, GenericResponse.class); + } +} diff --git a/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Device.java b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Device.java new file mode 100644 index 000000000..6541dd5b7 --- /dev/null +++ b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Device.java @@ -0,0 +1,606 @@ +package com.github.danielpaulus.goios; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.github.danielpaulus.goios.generated.model.AssistiveTouchState; +import com.github.danielpaulus.goios.generated.model.BatteryInfo; +import com.github.danielpaulus.goios.generated.model.BatteryRegistry; +import com.github.danielpaulus.goios.generated.model.CrashListing; +import com.github.danielpaulus.goios.generated.model.DevModeState; +import com.github.danielpaulus.goios.generated.model.DeviceDate; +import com.github.danielpaulus.goios.generated.model.DeviceName; +import com.github.danielpaulus.goios.generated.model.DiskSpaceInfo; +import com.github.danielpaulus.goios.generated.model.FileListing; +import com.github.danielpaulus.goios.generated.model.FilePushResult; +import com.github.danielpaulus.goios.generated.model.GenericResponse; +import com.github.danielpaulus.goios.generated.model.LanguageConfiguration; +import com.github.danielpaulus.goios.generated.model.MemLimitResult; +import com.github.danielpaulus.goios.generated.model.MountedImages; +import com.github.danielpaulus.goios.generated.model.NetworkInfo; +import com.github.danielpaulus.goios.generated.model.PasteboardContent; +import com.github.danielpaulus.goios.generated.model.PrepareResult; +import com.github.danielpaulus.goios.generated.model.StatusOk; +import com.github.danielpaulus.goios.generated.model.TimeFormatState; +import com.github.danielpaulus.goios.generated.model.UnlockToken; +import com.github.danielpaulus.goios.generated.model.VoiceOverState; +import com.github.danielpaulus.goios.generated.model.ZoomTouchState; +import com.github.danielpaulus.goios.stream.BinaryStream; +import com.github.danielpaulus.goios.stream.EventDecoder; +import com.github.danielpaulus.goios.stream.SseReader; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.Map; + +/** + * All operations scoped to a single device udid. Grouped sub-facades + * ({@link #apps()}, {@link #files()}, {@link #ui()}, …) mirror the CLI/REST + * grouping; flat device-level operations (battery, reboot, screenshot, streams) + * live directly on this type. + */ +public final class Device { + + private final RawHttp http; + private final String udid; + + // Grouped sub-facades. + private final Apps apps; + private final Wda wda; + private final Files files; + private final Crashes crashes; + private final Jobs jobs; + private final Settings settings; + private final Media media; + private final Mdm mdm; + private final Fsync fsync; + private final WebInspector webinspector; + private final Ui ui; + + Device(RawHttp http, String udid) { + this.http = http; + this.udid = udid; + this.apps = new Apps(this); + this.wda = new Wda(this); + this.files = new Files(this); + this.crashes = new Crashes(this); + this.jobs = new Jobs(this); + this.settings = new Settings(this); + this.media = new Media(this); + this.mdm = new Mdm(this); + this.fsync = new Fsync(this); + this.webinspector = new WebInspector(this); + this.ui = new Ui(this); + } + + /** The udid this handle is scoped to. */ + public String udid() { + return udid; + } + + // -- URL helpers ------------------------------------------------------- + + static String seg(String s) { + return URLEncoder.encode(s, StandardCharsets.UTF_8); + } + + private String path(String suffix) { + return "/device/" + seg(udid) + suffix; + } + + private static String bool(boolean b) { + return b ? "true" : "false"; + } + + // -- device info ------------------------------------------------------- + + /** Get device info (lockdown + instruments values) ({@code GET /info}). */ + public Object info() { + return http.getJson(path("/info"), null, Object.class); + } + + /** Get the device name ({@code GET /devicename}). */ + public DeviceName deviceName() { + return http.getJson(path("/devicename"), null, DeviceName.class); + } + + /** Get the device date/time ({@code GET /date}). */ + public DeviceDate date() { + return http.getJson(path("/date"), null, DeviceDate.class); + } + + /** Get battery info ({@code GET /battery}). */ + public BatteryInfo battery() { + return http.getJson(path("/battery"), null, BatteryInfo.class); + } + + /** Get raw IOKit battery-registry values ({@code GET /battery/registry}). */ + public BatteryRegistry batteryRegistry() { + return http.getJson(path("/battery/registry"), null, BatteryRegistry.class); + } + + /** Get IORegistry diagnostics ({@code GET /diagnostics}). */ + public Object diagnostics() { + return http.getJson(path("/diagnostics"), null, Object.class); + } + + /** Get filesystem disk-space usage ({@code GET /diskspace}). */ + public DiskSpaceInfo diskSpace() { + return http.getJson(path("/diskspace"), null, DiskSpaceInfo.class); + } + + /** Get the device's network/IP info ({@code GET /ip}). */ + public NetworkInfo ip() { + return http.getJson(path("/ip"), null, NetworkInfo.class); + } + + /** List RemoteServiceDiscovery services exposed over the tunnel ({@code GET /rsd}). */ + public Object rsd() { + return http.getJson(path("/rsd"), null, Object.class); + } + + /** Query MobileGestalt values by key ({@code GET /mobilegestalt}). */ + public Object mobileGestalt(List keys) { + Map q = RawHttp.query(); + if (keys != null && !keys.isEmpty()) { + q.put("key", String.join(",", keys)); // spec: explode:false -> comma-joined + } + return http.getJson(path("/mobilegestalt"), q, Object.class); + } + + /** List running processes ({@code GET /processes}). */ + public Object processes(Boolean apps) { + Map q = RawHttp.query(); + if (apps != null) { + q.put("apps", bool(apps)); + } + return http.getJson(path("/processes"), q, Object.class); + } + + /** Read all lockdown values ({@code GET /lockdown}). */ + public Object lockdown() { + return http.getJson(path("/lockdown"), null, Object.class); + } + + /** Read lockdown values scoped to a domain ({@code GET /lockdown?domain=...}). */ + public Object lockdown(String domain) { + Map q = RawHttp.query(); + if (domain != null) { + q.put("domain", domain); + } + return http.getJson(path("/lockdown"), q, Object.class); + } + + // -- management -------------------------------------------------------- + + /** Activate the device ({@code POST /activate}). */ + public GenericResponse activate() { + return http.postJson(path("/activate"), null, null, GenericResponse.class); + } + + /** Reboot the device ({@code POST /reboot}). */ + public GenericResponse reboot() { + return http.postJson(path("/reboot"), null, null, GenericResponse.class); + } + + /** Shut down the device ({@code POST /shutdown}). */ + public GenericResponse shutdown() { + return http.postJson(path("/shutdown"), null, null, GenericResponse.class); + } + + /** Erase the device ({@code POST /erase}); requires {@code confirm=true}. */ + public GenericResponse erase(boolean confirm) { + Map q = RawHttp.query(); + q.put("confirm", bool(confirm)); + return http.postJson(path("/erase"), q, null, GenericResponse.class); + } + + /** Get developer-mode state ({@code GET /devmode}). */ + public DevModeState devMode() { + return http.getJson(path("/devmode"), null, DevModeState.class); + } + + /** Set developer mode ({@code POST /devmode}); {@code action} is {@code enable} or {@code reveal}. */ + public GenericResponse setDevMode(String action, Boolean enablePostRestart) { + Map body = new java.util.LinkedHashMap<>(); + body.put("action", action); + if (enablePostRestart != null) { + body.put("enablePostRestart", enablePostRestart); + } + return http.postJson(path("/devmode"), null, body, GenericResponse.class); + } + + /** Get language/locale configuration ({@code GET /lang}). */ + public LanguageConfiguration lang() { + return http.getJson(path("/lang"), null, LanguageConfiguration.class); + } + + /** Set language and/or locale ({@code PUT /lang}). */ + public LanguageConfiguration setLang(String language, String locale) { + Map body = new java.util.LinkedHashMap<>(); + if (language != null) { + body.put("language", language); + } + if (locale != null) { + body.put("locale", locale); + } + return http.putJson(path("/lang"), null, body, LanguageConfiguration.class); + } + + /** Waive the memory limit for a process ({@code POST /memlimitoff}). */ + public MemLimitResult memlimitoff(String process) { + Map body = new java.util.LinkedHashMap<>(); + if (process != null) { + body.put("process", process); + } + return http.postJson(path("/memlimitoff"), null, body, MemLimitResult.class); + } + + // -- location ---------------------------------------------------------- + + /** Set a simulated GPS location ({@code PUT /setlocation}). */ + public GenericResponse setLocation(double latitude, double longitude) { + Map q = RawHttp.query(); + q.put("latitude", Double.toString(latitude)); + q.put("longitude", Double.toString(longitude)); + return http.requestJson("PUT", path("/setlocation"), q, null, null, GenericResponse.class); + } + + /** Replay a GPX track as simulated location ({@code PUT /setlocation/gpx}), multipart {@code gpx}. */ + public GenericResponse setLocationGpx(byte[] gpx) { + return http.multipart("PUT", path("/setlocation/gpx"), null, + RawHttp.parts(RawHttp.Part.file("gpx", "track.gpx", gpx)), + GenericResponse.class); + } + + /** Reset the simulated location ({@code POST /resetlocation}). */ + public GenericResponse resetLocation() { + return http.postJson(path("/resetlocation"), null, null, GenericResponse.class); + } + + /** Reset accessibility settings ({@code POST /resetaccessibility}). */ + public GenericResponse resetAccessibility() { + return http.postJson(path("/resetaccessibility"), null, null, GenericResponse.class); + } + + // -- accessibility ----------------------------------------------------- + + /** Get a snapshot of the focused accessibility element ({@code GET /ax}). */ + public Object ax() { + return http.getJson(path("/ax"), null, Object.class); + } + + /** Run the accessibility audit against the focused app ({@code POST /ax/audit}). */ + public Object axAudit(Integer timeoutSeconds) { + Map q = RawHttp.query(); + if (timeoutSeconds != null) { + q.put("timeout", Integer.toString(timeoutSeconds)); + } + return http.postJson(path("/ax/audit"), q, null, Object.class); + } + + /** Get VoiceOver state ({@code GET /voiceover}). */ + public VoiceOverState voiceOver() { + return http.getJson(path("/voiceover"), null, VoiceOverState.class); + } + + /** Enable/disable VoiceOver ({@code PUT /voiceover}). */ + public VoiceOverState setVoiceOver(boolean enabled) { + return http.putJson(path("/voiceover"), null, Map.of("enabled", enabled), VoiceOverState.class); + } + + /** Get Zoom (touch) state ({@code GET /zoom}). */ + public ZoomTouchState zoom() { + return http.getJson(path("/zoom"), null, ZoomTouchState.class); + } + + /** Enable/disable Zoom (touch) ({@code PUT /zoom}). */ + public ZoomTouchState setZoom(boolean enabled) { + return http.putJson(path("/zoom"), null, Map.of("enabled", enabled), ZoomTouchState.class); + } + + // -- screenshot / media flat ops --------------------------------------- + + /** Capture a PNG screenshot as raw bytes ({@code GET /screenshot}). */ + public byte[] screenshot() { + return http.getBytes(path("/screenshot"), null); + } + + // -- conditions / images / profiles ------------------------------------ + + /** List available condition profile types ({@code GET /conditions}). */ + public Object conditions() { + return http.getJson(path("/conditions"), null, Object.class); + } + + /** Enable a device condition ({@code PUT /enable-condition}). */ + public GenericResponse enableCondition(String profileTypeId, String profileId) { + Map q = RawHttp.query(); + q.put("profileTypeID", profileTypeId); + q.put("profileID", profileId); + return http.requestJson("PUT", path("/enable-condition"), q, null, null, GenericResponse.class); + } + + /** Disable the active device condition ({@code POST /disable-condition}). */ + public GenericResponse disableCondition() { + return http.postJson(path("/disable-condition"), null, null, GenericResponse.class); + } + + /** List available developer disk images on the server ({@code GET /image}). */ + public Object images() { + return http.getJson(path("/image"), null, Object.class); + } + + /** List mounted developer disk images ({@code GET /image/list}). */ + public MountedImages mountedImages() { + return http.getJson(path("/image/list"), null, MountedImages.class); + } + + /** Auto-resolve and mount the matching developer disk image ({@code PUT /image?auto=true}). */ + public GenericResponse mountImageAuto(String basedir) { + Map q = RawHttp.query(); + q.put("auto", "true"); + if (basedir != null) { + q.put("basedir", basedir); + } + return http.requestJson("PUT", path("/image"), q, null, null, GenericResponse.class); + } + + /** Mount a developer disk image from raw bytes ({@code PUT /image}). */ + public GenericResponse mountImage(byte[] image) { + return http.requestJson("PUT", path("/image"), null, image, + "application/octet-stream", GenericResponse.class); + } + + /** Unmount the developer disk image ({@code DELETE /image}). */ + public GenericResponse unmountImage() { + return http.deleteJson(path("/image"), null, GenericResponse.class); + } + + /** List installed configuration profiles ({@code GET /profiles}). */ + public Object profiles() { + return http.getJson(path("/profiles"), null, Object.class); + } + + /** Install a {@code .mobileconfig} profile ({@code POST /profiles}), multipart. */ + public GenericResponse addProfile(byte[] profile, byte[] p12, String password) { + return http.multipart("POST", path("/profiles"), null, RawHttp.parts( + RawHttp.Part.file("profile", "profile.mobileconfig", profile), + p12 == null ? null : RawHttp.Part.file("p12", "identity.p12", p12), + password == null ? null : RawHttp.Part.field("password", password)), + GenericResponse.class); + } + + /** Remove an installed profile by identifier ({@code DELETE /profiles/{name}}). */ + public GenericResponse removeProfile(String name) { + return http.deleteJson(path("/profiles/" + seg(name)), null, GenericResponse.class); + } + + // -- pairing / prepare / proxy ----------------------------------------- + + /** Pair the device ({@code POST /pair}); pass {@code p12} for supervised pairing. */ + public GenericResponse pair(boolean supervised, byte[] p12, String supervisionPassword) { + Map q = RawHttp.query(); + q.put("supervised", bool(supervised)); + if (p12 == null) { + return http.postJson(path("/pair"), q, null, GenericResponse.class); + } + return http.multipart("POST", path("/pair"), q, RawHttp.parts( + RawHttp.Part.file("p12file", "identity.p12", p12), + supervisionPassword == null ? null + : RawHttp.Part.field("supervisionPassword", supervisionPassword)), + GenericResponse.class); + } + + /** + * Run the device preparation/provisioning flow ({@code POST /prepare}), multipart. + * Pass {@code cert} to supervise; omit it to prepare unsupervised. + */ + public PrepareResult prepare(byte[] cert, String p12password, List skip, + String orgname, String locale, String lang) { + java.util.List parts = new java.util.ArrayList<>(); + if (cert != null) { + parts.add(RawHttp.Part.file("cert", "supervision.p12", cert)); + } + if (p12password != null) { + parts.add(RawHttp.Part.field("p12password", p12password)); + } + if (skip != null) { + for (String s : skip) { + parts.add(RawHttp.Part.field("skip", s)); + } + } + if (orgname != null) { + parts.add(RawHttp.Part.field("orgname", orgname)); + } + if (locale != null) { + parts.add(RawHttp.Part.field("locale", locale)); + } + if (lang != null) { + parts.add(RawHttp.Part.field("lang", lang)); + } + return http.multipart("POST", path("/prepare"), null, parts, PrepareResult.class); + } + + /** Set a global HTTP proxy (supervised) ({@code PUT /httpproxy}), multipart. */ + public GenericResponse setHttpProxy(String host, String port, String user, String pass, + byte[] p12, String p12password) { + return http.multipart("PUT", path("/httpproxy"), null, RawHttp.parts( + RawHttp.Part.field("host", host), + RawHttp.Part.field("port", port), + user == null ? null : RawHttp.Part.field("user", user), + pass == null ? null : RawHttp.Part.field("pass", pass), + p12 == null ? null : RawHttp.Part.file("p12", "identity.p12", p12), + p12password == null ? null : RawHttp.Part.field("password", p12password)), + GenericResponse.class); + } + + /** Remove the global HTTP proxy ({@code DELETE /httpproxy}). */ + public GenericResponse removeHttpProxy() { + return http.deleteJson(path("/httpproxy"), null, GenericResponse.class); + } + + // -- mdm (also exposed via mdm() group) -------------------------------- + + /** MDM security info ({@code POST /mdm/security-info}), multipart. */ + public Object securityInfo(byte[] p12, String password) { + return mdm.securityInfo(p12, password); + } + + /** Fetch the escrow unlock token ({@code POST /mdm/fetch-unlock-token}), multipart. */ + public UnlockToken fetchUnlockToken(byte[] p12, String password) { + return mdm.fetchUnlockToken(p12, password); + } + + // -- SSE streams ------------------------------------------------------- + + /** Stream syslog messages ({@code GET /syslog}). */ + public SseReader syslog() { + return syslog(false); + } + + public SseReader syslog(boolean includeHeartbeats) { + return http.sseStream(path("/syslog"), null, EventDecoder.SYSLOG, includeHeartbeats); + } + + /** Stream app-state notifications ({@code GET /notifications}). */ + public SseReader notifications() { + return notifications(false); + } + + public SseReader notifications(boolean includeHeartbeats) { + return http.sseStream(path("/notifications"), null, EventDecoder.NOTIFICATIONS, includeHeartbeats); + } + + /** Stream os_trace entries ({@code GET /ostrace}) with optional AND filters. */ + public SseReader ostrace(Integer pid, String level, String subsystem, + String match, String exclude, boolean includeHeartbeats) { + Map q = RawHttp.query(); + if (pid != null) { + q.put("pid", Integer.toString(pid)); + } + if (level != null) { + q.put("level", level); + } + if (subsystem != null) { + q.put("subsystem", subsystem); + } + if (match != null) { + q.put("match", match); + } + if (exclude != null) { + q.put("exclude", exclude); + } + return http.sseStream(path("/ostrace"), q, EventDecoder.OSTRACE, includeHeartbeats); + } + + public SseReader ostrace() { + return ostrace(null, null, null, null, null, false); + } + + /** Stream device attach/detach/pair events ({@code GET /listen}). */ + public SseReader listen() { + return listen(false); + } + + public SseReader listen(boolean includeHeartbeats) { + return http.sseStream(path("/listen"), null, EventDecoder.LISTEN, includeHeartbeats); + } + + /** Stream CPU-usage samples ({@code GET /sysmontap}). */ + public SseReader sysmontap() { + return sysmontap(false); + } + + public SseReader sysmontap(boolean includeHeartbeats) { + return http.sseStream(path("/sysmontap"), null, EventDecoder.SYSMONTAP, includeHeartbeats); + } + + // -- binary streams ---------------------------------------------------- + + /** Live MJPEG screenshot stream ({@code GET /screenshot/stream}); returns raw bytes. */ + public BinaryStream screenshotStream() { + return screenshotStream(null); + } + + public BinaryStream screenshotStream(Integer quality) { + Map q = RawHttp.query(); + if (quality != null) { + q.put("quality", Integer.toString(quality)); + } + return http.binaryStream(path("/screenshot/stream"), q); + } + + /** Live packet capture as a libpcap byte stream ({@code GET /pcap}). */ + public BinaryStream pcap() { + return pcap(null); + } + + public BinaryStream pcap(Integer timeoutSeconds) { + Map q = RawHttp.query(); + if (timeoutSeconds != null) { + q.put("timeout", Integer.toString(timeoutSeconds)); + } + return http.binaryStream(path("/pcap"), q); + } + + // -- group accessors --------------------------------------------------- + + public Apps apps() { + return apps; + } + + public Wda wda() { + return wda; + } + + public Files files() { + return files; + } + + public Crashes crashes() { + return crashes; + } + + public Jobs jobs() { + return jobs; + } + + public Settings settings() { + return settings; + } + + public Media media() { + return media; + } + + public Mdm mdm() { + return mdm; + } + + public Fsync fsync() { + return fsync; + } + + /** Read the device supervision/cloud configuration ({@code GET /cloudconfig}). */ + public Object cloudConfig() { + return http.getJson(path("/cloudconfig"), null, Object.class); + } + + public WebInspector webinspector() { + return webinspector; + } + + public Ui ui() { + return ui; + } + + // -- internal accessors for grouped sub-facades ------------------------ + + RawHttp http() { + return http; + } + + String devicePath(String suffix) { + return path(suffix); + } +} diff --git a/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Devices.java b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Devices.java new file mode 100644 index 000000000..cc6d4eac7 --- /dev/null +++ b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Devices.java @@ -0,0 +1,44 @@ +package com.github.danielpaulus.goios; + +import com.github.danielpaulus.goios.generated.model.DeviceEntry; +import com.github.danielpaulus.goios.generated.model.DeviceList; + +import java.util.ArrayList; +import java.util.List; + +/** Fleet-level device operations. */ +public final class Devices { + + private final RawHttp http; + + Devices(RawHttp http) { + this.http = http; + } + + /** List attached devices ({@code GET /list}). */ + public List list() { + DeviceList envelope = http.getJson("/list", null, DeviceList.class); + return envelope == null || envelope.getDeviceList() == null + ? List.of() : envelope.getDeviceList(); + } + + /** Convenience: the udids ({@code properties.serialNumber}) of attached devices. */ + public List udids() { + List out = new ArrayList<>(); + for (DeviceEntry e : list()) { + String u = udid(e); + if (u != null) { + out.add(u); + } + } + return out; + } + + /** Null-safe accessor for a {@link DeviceEntry}'s udid ({@code properties.serialNumber}). */ + public static String udid(DeviceEntry entry) { + if (entry == null || entry.getProperties() == null) { + return null; + } + return entry.getProperties().getSerialNumber(); + } +} diff --git a/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Discovery.java b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Discovery.java new file mode 100644 index 000000000..ad4cbca45 --- /dev/null +++ b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Discovery.java @@ -0,0 +1,121 @@ +package com.github.danielpaulus.goios; + +import com.fasterxml.jackson.databind.JsonNode; + +import java.io.IOException; +import java.io.UncheckedIOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.function.Function; + +/** + * Locates the local go-ios REST daemon so an {@link IosClient} can be built with + * no explicit {@code baseUrl}. + * + *

The daemon writes a discovery file at {@code /rest-api.json} after it + * binds (see the discovery contract), where {@code } is {@code GO_IOS_HOME} + * if set and non-empty, else {@code ~/.go-ios}. The file's authoritative + * {@code baseUrl} field (scheme + host + port) is what this reads. + * + *

Resolution order used by the {@link IosClient.Builder}: an explicit + * {@code .baseUrl(...)} wins; then the {@code GO_IOS_BASE_URL} env var; then this + * discovery file; otherwise a clear error. + */ +public final class Discovery { + + /** Name of the discovery file the daemon writes inside the go-ios home dir. */ + public static final String DISCOVERY_FILE = "rest-api.json"; + + /** Env var overriding the go-ios home directory. */ + static final String HOME_ENV = "GO_IOS_HOME"; + + /** Env var overriding the base URL (takes precedence over the discovery file). */ + static final String BASE_URL_ENV = "GO_IOS_BASE_URL"; + + private final Function env; + private final Function props; + + private Discovery(Function env, Function props) { + this.env = env; + this.props = props; + } + + /** Discovery backed by the real process environment and system properties. */ + static Discovery system() { + return new Discovery(System::getenv, System::getProperty); + } + + /** Testable variant with injected environment / system-property lookups. */ + static Discovery of(Function env, Function props) { + return new Discovery(env, props); + } + + /** + * The go-ios home directory: {@code GO_IOS_HOME} if set and non-empty, else + * {@code /.go-ios}. + */ + Path home() { + String h = env.apply(HOME_ENV); + if (h != null && !h.isBlank()) { + return Path.of(h); + } + String userHome = props.apply("user.home"); + return Path.of(userHome == null ? "" : userHome, ".go-ios"); + } + + /** Absolute path of the discovery file within {@link #home()}. */ + Path discoveryFile() { + return home().resolve(DISCOVERY_FILE); + } + + /** + * Resolve the daemon base URL, honoring the {@code GO_IOS_BASE_URL} env var + * first, then the on-disk discovery file. + * + * @throws IosDiscoveryException if neither is available. + */ + String resolveBaseUrl() { + String envUrl = env.apply(BASE_URL_ENV); + if (envUrl != null && !envUrl.isBlank()) { + return envUrl; + } + return readDiscoveryFile(); + } + + /** + * Read {@code /rest-api.json} and return its {@code baseUrl}. + * + * @throws IosDiscoveryException if the file is missing, unreadable, malformed, + * or lacks a usable {@code baseUrl}. + */ + String readDiscoveryFile() { + Path file = discoveryFile(); + if (!Files.isRegularFile(file)) { + throw notFound(file, null); + } + byte[] raw; + try { + raw = Files.readAllBytes(file); + } catch (IOException e) { + throw notFound(file, e); + } + JsonNode root; + try { + root = RawHttp.MAPPER.readTree(raw); + } catch (IOException e) { + throw notFound(file, e); + } + JsonNode baseUrl = root == null ? null : root.get("baseUrl"); + if (baseUrl == null || !baseUrl.isTextual() || baseUrl.asText().isBlank()) { + throw notFound(file, null); + } + return baseUrl.asText(); + } + + private static IosDiscoveryException notFound(Path file, Throwable cause) { + String msg = "no local go-ios REST daemon found at " + file + + "; start the go-ios REST API or set baseUrl"; + return cause == null ? new IosDiscoveryException(msg) + : new IosDiscoveryException(msg, cause); + } +} diff --git a/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Files.java b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Files.java new file mode 100644 index 000000000..db27cdee1 --- /dev/null +++ b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Files.java @@ -0,0 +1,57 @@ +package com.github.danielpaulus.goios; + +import com.github.danielpaulus.goios.generated.model.FileListing; +import com.github.danielpaulus.goios.generated.model.FilePushResult; + +import java.util.Map; + +/** + * On-device house-arrest file-service operations for a single device + * ({@code /files*}). The {@code domain} is one of {@code app}, {@code app-group}, + * {@code crash} or {@code temp}; {@code identifier} is the bundle/group id for + * the app domains. + */ +public final class Files { + + private final Device d; + + Files(Device d) { + this.d = d; + } + + /** List files in a house-arrest domain ({@code GET /files}). */ + public FileListing ls(String domain, String identifier, String path) { + Map q = RawHttp.query(); + q.put("domain", domain); + if (identifier != null) { + q.put("identifier", identifier); + } + if (path != null) { + q.put("path", path); + } + return d.http().getJson(d.devicePath("/files"), q, FileListing.class); + } + + /** Pull a file's raw bytes off the device ({@code GET /files/pull}). */ + public byte[] pull(String domain, String identifier, String remote) { + Map q = RawHttp.query(); + q.put("domain", domain); + q.put("remote", remote); + if (identifier != null) { + q.put("identifier", identifier); + } + return d.http().getBytes(d.devicePath("/files/pull"), q); + } + + /** Push raw bytes to a file on the device ({@code POST /files/push}), octet-stream body. */ + public FilePushResult push(String domain, String identifier, String remote, byte[] data) { + Map q = RawHttp.query(); + q.put("domain", domain); + q.put("remote", remote); + if (identifier != null) { + q.put("identifier", identifier); + } + return d.http().requestJson("POST", d.devicePath("/files/push"), q, data, + "application/octet-stream", FilePushResult.class); + } +} diff --git a/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Fsync.java b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Fsync.java new file mode 100644 index 000000000..4c5a7df2f --- /dev/null +++ b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Fsync.java @@ -0,0 +1,72 @@ +package com.github.danielpaulus.goios; + +import com.github.danielpaulus.goios.generated.model.FsyncListing; +import com.github.danielpaulus.goios.generated.model.FsyncMessage; +import com.github.danielpaulus.goios.generated.model.FsyncPushResult; +import com.github.danielpaulus.goios.generated.model.FsyncTreeListing; + +import java.util.Map; + +/** + * AFC file-transfer operations for a single device ({@code /fsync/*}). When a + * {@code bundleId} is supplied the operation is scoped to that app's container; + * otherwise it targets the device media directory. + */ +public final class Fsync { + + private final Device d; + + Fsync(Device d) { + this.d = d; + } + + private Map scoped(String path, String bundleId) { + Map q = RawHttp.query(); + if (bundleId != null) { + q.put("bundleID", bundleId); + } + if (path != null) { + q.put("path", path); + } + return q; + } + + /** List a device directory over AFC ({@code GET /fsync/ls}). */ + public FsyncListing ls(String path, String bundleId) { + return d.http().getJson(d.devicePath("/fsync/ls"), scoped(path, bundleId), FsyncListing.class); + } + + /** Recursively list a device directory over AFC ({@code GET /fsync/tree}). */ + public FsyncTreeListing tree(String path, String bundleId) { + return d.http().getJson(d.devicePath("/fsync/tree"), scoped(path, bundleId), FsyncTreeListing.class); + } + + /** Download a file over AFC ({@code GET /fsync/pull}); returns raw bytes. */ + public byte[] pull(String path, String bundleId) { + return d.http().getBytes(d.devicePath("/fsync/pull"), scoped(path, bundleId)); + } + + /** Upload a file over AFC ({@code POST /fsync/push}), octet-stream body. */ + public FsyncPushResult push(String path, byte[] data, String bundleId) { + return d.http().requestJson("POST", d.devicePath("/fsync/push"), scoped(path, bundleId), + data, "application/octet-stream", FsyncPushResult.class); + } + + /** Remove a file or directory over AFC ({@code DELETE /fsync/rm}). */ + public FsyncMessage rm(String path, String bundleId, boolean recursive) { + Map q = scoped(path, bundleId); + if (recursive) { + q.put("recursive", "true"); + } + return d.http().deleteJson(d.devicePath("/fsync/rm"), q, FsyncMessage.class); + } + + public FsyncMessage rm(String path, String bundleId) { + return rm(path, bundleId, false); + } + + /** Create a directory over AFC ({@code POST /fsync/mkdir}). */ + public FsyncMessage mkdir(String path, String bundleId) { + return d.http().postJson(d.devicePath("/fsync/mkdir"), scoped(path, bundleId), null, FsyncMessage.class); + } +} diff --git a/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/IosApiException.java b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/IosApiException.java new file mode 100644 index 000000000..22d4239c7 --- /dev/null +++ b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/IosApiException.java @@ -0,0 +1,51 @@ +package com.github.danielpaulus.goios; + +import com.github.danielpaulus.goios.generated.model.GenericResponse; + +/** + * Thrown when the go-ios REST API returns a non-2xx status. Carries the HTTP + * status code, the raw response body, and — when the body is a JSON error + * envelope — a decoded {@link GenericResponse} accessible via {@link #errorBody()}. + */ +public class IosApiException extends RuntimeException { + + private final int statusCode; + private final String rawBody; + private final transient GenericResponse errorBody; + + public IosApiException(int statusCode, String rawBody, GenericResponse errorBody) { + super(buildMessage(statusCode, rawBody, errorBody)); + this.statusCode = statusCode; + this.rawBody = rawBody; + this.errorBody = errorBody; + } + + private static String buildMessage(int statusCode, String rawBody, GenericResponse errorBody) { + String detail = null; + if (errorBody != null) { + detail = errorBody.getError() != null ? errorBody.getError() : errorBody.getMessage(); + } + if (detail == null) { + detail = rawBody; + } + return "go-ios API error " + statusCode + (detail == null || detail.isBlank() ? "" : ": " + detail); + } + + /** The HTTP status code. */ + public int statusCode() { + return statusCode; + } + + /** The raw (undecoded) response body, if any. */ + public String rawBody() { + return rawBody; + } + + /** + * The decoded error envelope ({@code {"error": ...}} / {@code {"message": ...}}), + * or {@code null} if the body was not a JSON error object. + */ + public GenericResponse errorBody() { + return errorBody; + } +} diff --git a/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/IosClient.java b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/IosClient.java new file mode 100644 index 000000000..c4d8fbed6 --- /dev/null +++ b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/IosClient.java @@ -0,0 +1,141 @@ +package com.github.danielpaulus.goios; + +import java.net.http.HttpClient; +import java.time.Duration; + +/** + * Ergonomic synchronous client for the go-ios REST API. + * + *

{@code
+ * try (IosClient client = IosClient.builder()
+ *         .baseUrl("http://localhost:60105")
+ *         .apiKey("secret")
+ *         .build()) {
+ *     for (DeviceEntry d : client.devices().list()) { ... }
+ *     Device dev = client.device(udid);
+ *     BatteryInfo b = dev.battery();
+ *     byte[] png = dev.screenshot();
+ *     try (SseReader syslog = dev.syslog()) { for (var ev : syslog) { ... } }
+ * }
+ * }
+ * + *

Mirrors the public shape of the TypeScript/Python/C# SDKs. When an + * {@code apiKey} is set it is sent as {@code Authorization: Bearer }; + * a server started with {@code --disable-auth} needs none. + * + *

{@code baseUrl} is optional. When it is not set explicitly, the builder + * resolves the daemon endpoint in this order: an explicit + * {@link Builder#baseUrl(String)}; the {@code GO_IOS_BASE_URL} env var; then + * discovery of a locally running daemon via {@code /rest-api.json} (see + * {@link Discovery}). If none is available, {@link #build()} throws an + * {@link IosDiscoveryException} pointing at the expected discovery path. + */ +public final class IosClient implements AutoCloseable { + + private final RawHttp http; + private final Devices devices; + private final Tunnels tunnels; + private final Sign sign; + private final Prepare prepare; + + private IosClient(Builder b) { + HttpClient client = b.httpClient != null ? b.httpClient + : HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(10)).build(); + String baseUrl = b.baseUrl != null && !b.baseUrl.isBlank() + ? b.baseUrl + : b.discovery.resolveBaseUrl(); + this.http = new RawHttp(baseUrl, b.apiKey, client, b.timeout); + this.devices = new Devices(http); + this.tunnels = new Tunnels(http); + this.sign = new Sign(http); + this.prepare = new Prepare(http); + } + + public static Builder builder() { + return new Builder(); + } + + /** Fleet-level device operations ({@code GET /list}). */ + public Devices devices() { + return devices; + } + + /** userspace-tunnel (RemoteXPC) management (iOS 17+). */ + public Tunnels tunnels() { + return tunnels; + } + + /** Host-scoped app-signing operations ({@code /sign/*}). */ + public Sign sign() { + return sign; + } + + /** Host-scoped device-preparation helpers ({@code /prepare/*}). */ + public Prepare prepare() { + return prepare; + } + + /** Return a {@link Device} handle scoped to {@code udid}. */ + public Device device(String udid) { + return new Device(http, udid); + } + + @Override + public void close() { + http.close(); + } + + /** Builder for {@link IosClient}. */ + public static final class Builder { + private String baseUrl; + private String apiKey; + private Duration timeout = Duration.ofSeconds(30); + private HttpClient httpClient; + private Discovery discovery = Discovery.system(); + + /** + * Pin the daemon origin (e.g. {@code http://localhost:8080}); {@code /api/v1} + * is appended automatically. Optional: when unset the builder falls back to + * the {@code GO_IOS_BASE_URL} env var and then to {@link Discovery discovery} + * of a local daemon. + */ + public Builder baseUrl(String baseUrl) { + this.baseUrl = baseUrl; + return this; + } + + public Builder apiKey(String apiKey) { + this.apiKey = apiKey; + return this; + } + + /** Per-request timeout for non-streaming calls (streams are exempt). */ + public Builder timeout(Duration timeout) { + this.timeout = timeout; + return this; + } + + /** Bring your own configured {@link HttpClient} (e.g. custom TLS). */ + public Builder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /** Override the discovery seam (test-only). */ + Builder discovery(Discovery discovery) { + this.discovery = discovery; + return this; + } + + /** + * Build the client, resolving {@code baseUrl} if it was not set explicitly. + * + * @throws IosDiscoveryException if no {@code baseUrl} is set, no + * {@code GO_IOS_BASE_URL} env var is present, and + * no local daemon discovery file can be read. + */ + public IosClient build() { + return new IosClient(this); + } + } +} diff --git a/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/IosDiscoveryException.java b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/IosDiscoveryException.java new file mode 100644 index 000000000..c92ea13f9 --- /dev/null +++ b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/IosDiscoveryException.java @@ -0,0 +1,17 @@ +package com.github.danielpaulus.goios; + +/** + * Thrown when an {@link IosClient} is built without an explicit {@code baseUrl} + * and no local go-ios REST daemon can be discovered (no {@code GO_IOS_BASE_URL} + * env var and no readable {@code /rest-api.json} discovery file). + */ +public final class IosDiscoveryException extends RuntimeException { + + IosDiscoveryException(String message) { + super(message); + } + + IosDiscoveryException(String message, Throwable cause) { + super(message, cause); + } +} diff --git a/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Jobs.java b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Jobs.java new file mode 100644 index 000000000..359bf9b59 --- /dev/null +++ b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Jobs.java @@ -0,0 +1,65 @@ +package com.github.danielpaulus.goios; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.github.danielpaulus.goios.generated.model.GenericResponse; +import com.github.danielpaulus.goios.generated.model.Job; +import com.github.danielpaulus.goios.generated.model.RunTestRequest; +import com.github.danielpaulus.goios.stream.EventDecoder; +import com.github.danielpaulus.goios.stream.SseReader; + +import java.util.List; +import java.util.Map; + +/** Asynchronous server-side jobs (test runs, WDA, port forwards) for a device. */ +public final class Jobs { + + private final Device d; + + Jobs(Device d) { + this.d = d; + } + + /** Start an XCUITest run job ({@code POST /jobs/runtest}). */ + public Job runTest(RunTestRequest config) { + return d.http().postJson(d.devicePath("/jobs/runtest"), null, config, Job.class); + } + + /** Start a WebDriverAgent run job ({@code POST /jobs/runwda}). */ + public Job runWda(RunTestRequest config) { + return d.http().postJson(d.devicePath("/jobs/runwda"), null, config, Job.class); + } + + /** Start a TCP port-forward job ({@code POST /jobs/forward}). */ + public Job forward(int hostPort, int targetPort) { + Map body = new java.util.LinkedHashMap<>(); + body.put("hostPort", hostPort); + body.put("targetPort", targetPort); + return d.http().postJson(d.devicePath("/jobs/forward"), null, body, Job.class); + } + + /** List active jobs ({@code GET /jobs}). */ + public List list() { + List jobs = d.http().getJson(d.devicePath("/jobs"), null, new TypeReference>() { }); + return jobs == null ? List.of() : jobs; + } + + /** Get one job's status ({@code GET /jobs/{id}}). */ + public Job get(String jobId) { + return d.http().getJson(d.devicePath("/jobs/" + Device.seg(jobId)), null, Job.class); + } + + /** Stop/delete a job ({@code DELETE /jobs/{id}}). */ + public GenericResponse delete(String jobId) { + return d.http().deleteJson(d.devicePath("/jobs/" + Device.seg(jobId)), null, GenericResponse.class); + } + + /** Stream a job's log lines ({@code GET /jobs/{id}/logs}) as typed events. */ + public SseReader logs(String jobId) { + return logs(jobId, false); + } + + public SseReader logs(String jobId, boolean includeHeartbeats) { + return d.http().sseStream(d.devicePath("/jobs/" + Device.seg(jobId) + "/logs"), + null, EventDecoder.JOB_LOGS, includeHeartbeats); + } +} diff --git a/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Mdm.java b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Mdm.java new file mode 100644 index 000000000..53bd4292e --- /dev/null +++ b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Mdm.java @@ -0,0 +1,50 @@ +package com.github.danielpaulus.goios; + +import com.github.danielpaulus.goios.generated.model.StatusOk; +import com.github.danielpaulus.goios.generated.model.UnlockToken; + +/** + * MDM operations for a single device ({@code /mdm/*}). All take a supervision + * identity ({@code p12}) uploaded via {@code multipart/form-data}. + */ +public final class Mdm { + + private final Device d; + + Mdm(Device d) { + this.d = d; + } + + /** Query MDM security info ({@code POST /mdm/security-info}). */ + public Object securityInfo(byte[] p12, String password) { + return d.http().multipart("POST", d.devicePath("/mdm/security-info"), null, RawHttp.parts( + RawHttp.Part.file("p12", "identity.p12", p12), + password == null ? null : RawHttp.Part.field("password", password)), + Object.class); + } + + /** Fetch the escrow unlock token ({@code POST /mdm/fetch-unlock-token}). */ + public UnlockToken fetchUnlockToken(byte[] p12, String password) { + return d.http().multipart("POST", d.devicePath("/mdm/fetch-unlock-token"), null, RawHttp.parts( + RawHttp.Part.file("p12", "identity.p12", p12), + password == null ? null : RawHttp.Part.field("password", password)), + UnlockToken.class); + } + + /** Clear the device passcode via MDM ({@code POST /mdm/clear-passcode}). */ + public StatusOk clearPasscode(byte[] p12, String password, String token) { + return d.http().multipart("POST", d.devicePath("/mdm/clear-passcode"), null, RawHttp.parts( + RawHttp.Part.file("p12", "identity.p12", p12), + RawHttp.Part.field("token", token), + password == null ? null : RawHttp.Part.field("password", password)), + StatusOk.class); + } + + /** Clear the Screen Time password via MDM ({@code POST /mdm/clear-screen-time-password}). */ + public StatusOk clearScreenTimePassword(byte[] p12, String password) { + return d.http().multipart("POST", d.devicePath("/mdm/clear-screen-time-password"), null, RawHttp.parts( + RawHttp.Part.file("p12", "identity.p12", p12), + password == null ? null : RawHttp.Part.field("password", password)), + StatusOk.class); + } +} diff --git a/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Media.java b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Media.java new file mode 100644 index 000000000..726692289 --- /dev/null +++ b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Media.java @@ -0,0 +1,52 @@ +package com.github.danielpaulus.goios; + +import com.github.danielpaulus.goios.generated.model.GenericResponse; +import com.github.danielpaulus.goios.generated.model.PasteboardContent; + +import java.nio.charset.StandardCharsets; + +/** Wallpaper / icon-layout / pasteboard operations for a single device. */ +public final class Media { + + private final Device d; + + Media(Device d) { + this.d = d; + } + + /** Get the current wallpaper PNG bytes ({@code GET /wallpaper}). */ + public byte[] wallpaper() { + return d.http().getBytes(d.devicePath("/wallpaper"), null); + } + + /** Set the wallpaper (supervised) ({@code PUT /wallpaper}), multipart. */ + public GenericResponse setWallpaper(byte[] image, byte[] p12, String password, String screen) { + return d.http().multipart("PUT", d.devicePath("/wallpaper"), null, RawHttp.parts( + RawHttp.Part.file("image", "wallpaper.png", image), + RawHttp.Part.file("p12", "identity.p12", p12), + password == null ? null : RawHttp.Part.field("password", password), + screen == null ? null : RawHttp.Part.field("screen", screen)), + GenericResponse.class); + } + + /** Get the SpringBoard icon layout ({@code GET /icon-layout}). */ + public Object iconLayout() { + return d.http().getJson(d.devicePath("/icon-layout"), null, Object.class); + } + + /** Set the SpringBoard icon layout ({@code PUT /icon-layout}). */ + public GenericResponse setIconLayout(Object layout) { + return d.http().putJson(d.devicePath("/icon-layout"), null, layout, GenericResponse.class); + } + + /** Read the device pasteboard ({@code GET /pasteboard}). */ + public PasteboardContent pasteboard() { + return d.http().getJson(d.devicePath("/pasteboard"), null, PasteboardContent.class); + } + + /** Write text to the device pasteboard ({@code PUT /pasteboard}), {@code text/plain}. */ + public GenericResponse setPasteboard(String text) { + return d.http().requestJson("PUT", d.devicePath("/pasteboard"), null, + text.getBytes(StandardCharsets.UTF_8), "text/plain", GenericResponse.class); + } +} diff --git a/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Prepare.java b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Prepare.java new file mode 100644 index 000000000..4219c3047 --- /dev/null +++ b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Prepare.java @@ -0,0 +1,30 @@ +package com.github.danielpaulus.goios; + +import com.github.danielpaulus.goios.generated.model.PrepareSkipOptions; +import com.github.danielpaulus.goios.generated.model.SupervisionCert; + +/** Host-scoped device-preparation helpers ({@code /prepare/*}). */ +public final class Prepare { + + private final RawHttp http; + + Prepare(RawHttp http) { + this.http = http; + } + + /** + * Create a self-signed supervision certificate + key + * ({@code POST /prepare/create-cert}). + */ + public SupervisionCert createCert() { + return http.postJson("/prepare/create-cert", null, null, SupervisionCert.class); + } + + /** + * List the setup panes that {@code prepare} can skip + * ({@code GET /prepare/skip-options}). + */ + public PrepareSkipOptions skipOptions() { + return http.getJson("/prepare/skip-options", null, PrepareSkipOptions.class); + } +} diff --git a/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/RawHttp.java b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/RawHttp.java new file mode 100644 index 000000000..1f7baf22d --- /dev/null +++ b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/RawHttp.java @@ -0,0 +1,363 @@ +package com.github.danielpaulus.goios; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.github.danielpaulus.goios.generated.invoker.JSON; +import com.github.danielpaulus.goios.generated.model.GenericResponse; +import com.github.danielpaulus.goios.stream.BinaryStream; +import com.github.danielpaulus.goios.stream.EventDecoder; +import com.github.danielpaulus.goios.stream.SseReader; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.UncheckedIOException; +import java.net.URI; +import java.net.URLEncoder; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Random; + +/** + * Thin transport helper over {@link java.net.http.HttpClient} shared by the + * facade. Handles bearer auth, query building, JSON (de)serialization via the + * generated {@link JSON} mapper, raw-byte and {@code application/octet-stream} + * bodies, {@code multipart/form-data} uploads, SSE line streaming, and raw + * binary streaming. All non-2xx responses raise {@link IosApiException}. + * + *

The facade deliberately drives HTTP directly (rather than through the + * generated {@code DefaultApi}) so that query-parameter spelling, multipart + * boundaries and octet-stream bodies match the wire format the go-ios server + * expects byte-for-byte. + */ +final class RawHttp implements AutoCloseable { + + static final ObjectMapper MAPPER = new JSON().getMapper(); + private static final String API_PREFIX = "/api/v1"; + + private final String baseUrl; + private final String apiKey; + private final HttpClient client; + private final Duration timeout; + + RawHttp(String baseUrl, String apiKey, HttpClient client, Duration timeout) { + this.baseUrl = stripTrailingSlash(baseUrl); + this.apiKey = apiKey; + this.client = client; + this.timeout = timeout; + } + + private static String stripTrailingSlash(String s) { + return s.endsWith("/") ? s.substring(0, s.length() - 1) : s; + } + + // -- URL / query ------------------------------------------------------- + + /** Build an absolute URI from an API-relative suffix (already {@code /api/v1}-prefixed by callers). */ + URI uri(String suffix, Map query) { + StringBuilder sb = new StringBuilder(baseUrl).append(API_PREFIX).append(suffix); + if (query != null && !query.isEmpty()) { + sb.append('?'); + boolean first = true; + for (Map.Entry e : query.entrySet()) { + if (e.getValue() == null) { + continue; + } + if (!first) { + sb.append('&'); + } + first = false; + sb.append(enc(e.getKey())).append('=').append(enc(e.getValue())); + } + } + return URI.create(sb.toString()); + } + + private static String enc(String s) { + return URLEncoder.encode(s, StandardCharsets.UTF_8); + } + + private HttpRequest.Builder base(URI uri) { + HttpRequest.Builder b = HttpRequest.newBuilder(uri).timeout(timeout); + if (apiKey != null && !apiKey.isBlank()) { + b.header("Authorization", "Bearer " + apiKey); + } + return b; + } + + // -- request helpers --------------------------------------------------- + + private HttpResponse send(HttpRequest req) { + try { + HttpResponse resp = client.send(req, HttpResponse.BodyHandlers.ofByteArray()); + if (resp.statusCode() >= 300) { + throw error(resp); + } + return resp; + } catch (IOException e) { + throw new UncheckedIOException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new RuntimeException("request interrupted", e); + } + } + + private IosApiException error(HttpResponse resp) { + String body = resp.body() == null ? "" : new String(resp.body(), StandardCharsets.UTF_8); + GenericResponse envelope = null; + try { + if (!body.isBlank() && body.trim().startsWith("{")) { + envelope = MAPPER.readValue(body, GenericResponse.class); + } + } catch (Exception ignore) { + // Non-JSON error body; keep the raw text only. + } + return new IosApiException(resp.statusCode(), body, envelope); + } + + // -- JSON reads/writes ------------------------------------------------- + + T getJson(String suffix, Map query, Class type) { + return decode(send(base(uri(suffix, query)).GET().build()).body(), type); + } + + T getJson(String suffix, Map query, TypeReference type) { + return decode(send(base(uri(suffix, query)).GET().build()).body(), type); + } + + byte[] getBytes(String suffix, Map query) { + return send(base(uri(suffix, query)).GET().build()).body(); + } + + T requestJson(String method, String suffix, Map query, + byte[] body, String contentType, Class type) { + HttpRequest.Builder b = base(uri(suffix, query)); + HttpRequest.BodyPublisher pub = body == null + ? HttpRequest.BodyPublishers.noBody() + : HttpRequest.BodyPublishers.ofByteArray(body); + if (contentType != null && body != null) { + b.header("Content-Type", contentType); + } + b.method(method, pub); + return decode(send(b.build()).body(), type); + } + + T postJson(String suffix, Map query, Object jsonBody, Class type) { + byte[] body = jsonBody == null ? null : encode(jsonBody); + return requestJson("POST", suffix, query, body, body == null ? null : "application/json", type); + } + + T putJson(String suffix, Map query, Object jsonBody, Class type) { + byte[] body = jsonBody == null ? null : encode(jsonBody); + return requestJson("PUT", suffix, query, body, body == null ? null : "application/json", type); + } + + T deleteJson(String suffix, Map query, Class type) { + return requestJson("DELETE", suffix, query, null, null, type); + } + + // -- multipart --------------------------------------------------------- + + /** A single multipart part: either a file (bytes + filename) or a plain text field. */ + record Part(String name, String filename, byte[] content, String textValue) { + static Part file(String name, String filename, byte[] content) { + return new Part(name, filename, content, null); + } + + static Part field(String name, String value) { + return new Part(name, null, null, value); + } + } + + T multipart(String method, String suffix, Map query, + List parts, Class type) { + String boundary = "----goios" + Long.toHexString(new Random().nextLong()); + byte[] body = buildMultipart(parts, boundary); + HttpRequest.Builder b = base(uri(suffix, query)) + .header("Content-Type", "multipart/form-data; boundary=" + boundary) + .method(method, HttpRequest.BodyPublishers.ofByteArray(body)); + return decode(send(b.build()).body(), type); + } + + /** Multipart returning the raw response bytes (e.g. sign endpoints returning a P12/IPA). */ + byte[] multipartBytes(String method, String suffix, Map query, List parts) { + String boundary = "----goios" + Long.toHexString(new Random().nextLong()); + byte[] body = buildMultipart(parts, boundary); + HttpRequest.Builder b = base(uri(suffix, query)) + .header("Content-Type", "multipart/form-data; boundary=" + boundary) + .method(method, HttpRequest.BodyPublishers.ofByteArray(body)); + return send(b.build()).body(); + } + + private static byte[] buildMultipart(List parts, String boundary) { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + try { + for (Part p : parts) { + if (p == null) { + continue; + } + out.write(("--" + boundary + "\r\n").getBytes(StandardCharsets.UTF_8)); + if (p.filename() != null) { + out.write(("Content-Disposition: form-data; name=\"" + p.name() + + "\"; filename=\"" + p.filename() + "\"\r\n").getBytes(StandardCharsets.UTF_8)); + out.write("Content-Type: application/octet-stream\r\n\r\n".getBytes(StandardCharsets.UTF_8)); + out.write(p.content() == null ? new byte[0] : p.content()); + } else { + out.write(("Content-Disposition: form-data; name=\"" + p.name() + "\"\r\n\r\n") + .getBytes(StandardCharsets.UTF_8)); + out.write((p.textValue() == null ? "" : p.textValue()).getBytes(StandardCharsets.UTF_8)); + } + out.write("\r\n".getBytes(StandardCharsets.UTF_8)); + } + out.write(("--" + boundary + "--\r\n").getBytes(StandardCharsets.UTF_8)); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + return out.toByteArray(); + } + + // -- streaming (SSE) --------------------------------------------------- + + /** Open an SSE stream at {@code suffix}, decoding each frame with {@code decoder}. */ + SseReader sseStream(String suffix, Map query, + EventDecoder decoder, boolean includeHeartbeats) { + HttpRequest req = base(uri(suffix, query)) + .timeout(Duration.ofDays(3650)) // effectively no read timeout for long-lived streams + .GET().build(); + HttpResponse resp; + try { + resp = client.send(req, HttpResponse.BodyHandlers.ofInputStream()); + } catch (IOException e) { + throw new UncheckedIOException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new RuntimeException("request interrupted", e); + } + if (resp.statusCode() >= 300) { + throw drainError(resp); + } + InputStream in = resp.body(); + Iterator lines = new java.io.BufferedReader( + new java.io.InputStreamReader(in, StandardCharsets.UTF_8)).lines().iterator(); + return new SseReader(lines, decoder, includeHeartbeats, () -> { + try { + in.close(); + } catch (IOException ignore) { + // best-effort abort of the underlying connection + } + }); + } + + // -- streaming (binary) ----------------------------------------------- + + /** Open a raw binary stream at {@code suffix} (UI video, MJPEG screenshots, pcap). */ + BinaryStream binaryStream(String suffix, Map query) { + HttpRequest req = base(uri(suffix, query)) + .timeout(Duration.ofDays(3650)) + .GET().build(); + HttpResponse resp; + try { + resp = client.send(req, HttpResponse.BodyHandlers.ofInputStream()); + } catch (IOException e) { + throw new UncheckedIOException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new RuntimeException("request interrupted", e); + } + if (resp.statusCode() >= 300) { + throw drainError(resp); + } + InputStream in = resp.body(); + String ct = resp.headers().firstValue("Content-Type").orElse(null); + return new BinaryStream(in, ct, () -> { }); + } + + private IosApiException drainError(HttpResponse resp) { + String body = ""; + try (InputStream in = resp.body()) { + body = new String(in.readAllBytes(), StandardCharsets.UTF_8); + } catch (IOException ignore) { + // ignore + } + GenericResponse envelope = null; + try { + if (!body.isBlank() && body.trim().startsWith("{")) { + envelope = MAPPER.readValue(body, GenericResponse.class); + } + } catch (Exception ignore) { + // non-JSON + } + return new IosApiException(resp.statusCode(), body, envelope); + } + + // -- (de)serialization ------------------------------------------------- + + static byte[] encode(Object value) { + try { + return MAPPER.writeValueAsBytes(value); + } catch (Exception e) { + throw new IllegalArgumentException("failed to serialize request body", e); + } + } + + static T decode(byte[] body, Class type) { + if (type == Void.class) { + return null; + } + try { + if (body == null || body.length == 0) { + return type == String.class ? type.cast("") : null; + } + if (type == String.class) { + return type.cast(new String(body, StandardCharsets.UTF_8)); + } + if (type == byte[].class) { + return type.cast(body); + } + return MAPPER.readValue(body, type); + } catch (Exception e) { + throw new IllegalStateException("failed to decode response as " + type.getSimpleName() + + ": " + e.getMessage(), e); + } + } + + static T decode(byte[] body, TypeReference type) { + try { + if (body == null || body.length == 0) { + return null; + } + return MAPPER.readValue(body, type); + } catch (Exception e) { + throw new IllegalStateException("failed to decode response: " + e.getMessage(), e); + } + } + + /** Ordered mutable query map that skips null values on build. */ + static Map query() { + return new LinkedHashMap<>(); + } + + /** Immutable list helper for parts, skipping nulls. */ + static List parts(RawHttp.Part... items) { + List list = new ArrayList<>(); + for (RawHttp.Part p : items) { + if (p != null) { + list.add(p); + } + } + return list; + } + + @Override + public void close() { + // java.net.http.HttpClient (JDK 17) has no explicit close; GC/keepalive handles it. + } +} diff --git a/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Settings.java b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Settings.java new file mode 100644 index 000000000..cc6dfa8f3 --- /dev/null +++ b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Settings.java @@ -0,0 +1,59 @@ +package com.github.danielpaulus.goios; + +import com.github.danielpaulus.goios.generated.model.AssistiveTouchState; +import com.github.danielpaulus.goios.generated.model.GenericResponse; +import com.github.danielpaulus.goios.generated.model.TimeFormatState; +import com.github.danielpaulus.goios.generated.model.WifiRequest; + +import java.util.Map; + +/** Device-settings operations (AssistiveTouch, 24h clock, Wi-Fi) for a device. */ +public final class Settings { + + private final Device d; + + Settings(Device d) { + this.d = d; + } + + /** Get AssistiveTouch state ({@code GET /assistivetouch}). */ + public AssistiveTouchState assistiveTouch() { + return d.http().getJson(d.devicePath("/assistivetouch"), null, AssistiveTouchState.class); + } + + /** Enable/disable AssistiveTouch ({@code PUT /assistivetouch}). */ + public AssistiveTouchState setAssistiveTouch(boolean enabled) { + return d.http().putJson(d.devicePath("/assistivetouch"), null, + Map.of("enabled", enabled), AssistiveTouchState.class); + } + + /** Get the 24-hour clock setting ({@code GET /timeformat}). */ + public TimeFormatState timeFormat() { + return d.http().getJson(d.devicePath("/timeformat"), null, TimeFormatState.class); + } + + /** Set the 24-hour clock setting ({@code PUT /timeformat}). */ + public TimeFormatState setTimeFormat(boolean uses24Hour) { + return d.http().putJson(d.devicePath("/timeformat"), null, + Map.of("uses24Hour", uses24Hour), TimeFormatState.class); + } + + /** Configure a Wi-Fi network ({@code PUT /wifi}). */ + public GenericResponse setWifi(String ssid, String password, String encType) { + WifiRequest req = new WifiRequest().ssid(ssid); + if (password != null) { + req.password(password); + } + if (encType != null) { + req.encType(encType); + } + return d.http().putJson(d.devicePath("/wifi"), null, req, GenericResponse.class); + } + + /** Forget a Wi-Fi network ({@code DELETE /wifi}). */ + public GenericResponse removeWifi(String ssid) { + Map q = RawHttp.query(); + q.put("ssid", ssid); + return d.http().deleteJson(d.devicePath("/wifi"), q, GenericResponse.class); + } +} diff --git a/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Sign.java b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Sign.java new file mode 100644 index 000000000..100c49a44 --- /dev/null +++ b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Sign.java @@ -0,0 +1,70 @@ +package com.github.danielpaulus.goios; + +import com.github.danielpaulus.goios.generated.model.ProvisioningResult; + +/** + * Host-scoped (device-free) app-signing operations ({@code /sign/*}). + * + *

{@link #app} and {@link #certificate} return raw binary artifacts (a signed + * IPA and an {@code application/x-pkcs12} P12 respectively); {@link #provision} + * returns a JSON envelope with the base64 artifacts. + */ +public final class Sign { + + private final RawHttp http; + + Sign(RawHttp http) { + this.http = http; + } + + /** + * Resign an app/IPA with a signing identity + provisioning profile + * ({@code POST /sign/app}); returns the signed IPA bytes. + */ + public byte[] app(byte[] ipa, byte[] p12file, byte[] profile, + String p12password, String bundleId) { + return http.multipartBytes("POST", "/sign/app", null, RawHttp.parts( + RawHttp.Part.file("ipa", "app.ipa", ipa), + RawHttp.Part.file("p12file", "identity.p12", p12file), + RawHttp.Part.file("profile", "profile.mobileprovision", profile), + p12password == null ? null : RawHttp.Part.field("p12password", p12password), + bundleId == null ? null : RawHttp.Part.field("bundleid", bundleId))); + } + + /** + * Create one App Store Connect signing certificate + * ({@code POST /sign/certificate}); returns the P12 (cert + private key) bytes. + */ + public byte[] certificate(byte[] ascPrivateKey, String ascKeyId, String ascIssuerId, + boolean revokeExisting, String p12password) { + return http.multipartBytes("POST", "/sign/certificate", null, RawHttp.parts( + RawHttp.Part.file("asc-private-key", "AuthKey.p8", ascPrivateKey), + RawHttp.Part.field("asc-key-id", ascKeyId), + RawHttp.Part.field("asc-issuer-id", ascIssuerId), + revokeExisting ? RawHttp.Part.field("revoke-existing", "true") : null, + p12password == null ? null : RawHttp.Part.field("p12password", p12password))); + } + + /** + * Create a bundle id, development certificate and provisioning profile + * ({@code POST /sign/provision}); returns a JSON envelope with the artifacts. + */ + public ProvisioningResult provision(byte[] ascPrivateKey, String ascKeyId, String ascIssuerId, + String bundleId, String udid, String bundleName, + String profileName, String deviceName, String certificateId, + boolean revokeExisting, String p12password) { + return http.multipart("POST", "/sign/provision", null, RawHttp.parts( + RawHttp.Part.file("asc-private-key", "AuthKey.p8", ascPrivateKey), + RawHttp.Part.field("asc-key-id", ascKeyId), + RawHttp.Part.field("asc-issuer-id", ascIssuerId), + RawHttp.Part.field("bundleid", bundleId), + RawHttp.Part.field("udid", udid), + bundleName == null ? null : RawHttp.Part.field("bundlename", bundleName), + profileName == null ? null : RawHttp.Part.field("profilename", profileName), + deviceName == null ? null : RawHttp.Part.field("devicename", deviceName), + certificateId == null ? null : RawHttp.Part.field("certificate-id", certificateId), + revokeExisting ? RawHttp.Part.field("revoke-existing", "true") : null, + p12password == null ? null : RawHttp.Part.field("p12password", p12password)), + ProvisioningResult.class); + } +} diff --git a/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Tunnels.java b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Tunnels.java new file mode 100644 index 000000000..0da5fa698 --- /dev/null +++ b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Tunnels.java @@ -0,0 +1,39 @@ +package com.github.danielpaulus.goios; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.github.danielpaulus.goios.generated.model.AgentShutdown; +import com.github.danielpaulus.goios.generated.model.Tunnel; +import com.github.danielpaulus.goios.generated.model.TunnelStopped; + +import java.util.List; + +/** userspace-tunnel (RemoteXPC) management (iOS 17+). */ +public final class Tunnels { + + private final RawHttp http; + + Tunnels(RawHttp http) { + this.http = http; + } + + /** List active tunnels ({@code GET /tunnels}). */ + public List list() { + List tunnels = http.getJson("/tunnels", null, new TypeReference>() { }); + return tunnels == null ? List.of() : tunnels; + } + + /** Refresh the tunnel for {@code udid} ({@code POST /tunnels/{udid}/refresh}). */ + public Tunnel refresh(String udid) { + return http.postJson("/tunnels/" + Device.seg(udid) + "/refresh", null, null, Tunnel.class); + } + + /** Stop the tunnel for {@code udid} ({@code DELETE /tunnels/{udid}}). */ + public TunnelStopped delete(String udid) { + return http.deleteJson("/tunnels/" + Device.seg(udid), null, TunnelStopped.class); + } + + /** Shut down the whole tunnel agent ({@code POST /tunnel-agent/shutdown}). */ + public AgentShutdown shutdownAgent() { + return http.postJson("/tunnel-agent/shutdown", null, null, AgentShutdown.class); + } +} diff --git a/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Ui.java b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Ui.java new file mode 100644 index 000000000..61706e4a3 --- /dev/null +++ b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Ui.java @@ -0,0 +1,247 @@ +package com.github.danielpaulus.goios; + +import com.github.danielpaulus.goios.stream.BinaryStream; + +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * UI-automation operations for a single device ({@code /ui/*}), backed by a + * WebDriverAgent (default) or DeviceKit backend. + * + *

Every call accepts optional {@link Options} selecting the backend, a + * forwarded backend URL, and a per-request timeout. Convenience overloads use + * the backend defaults. + */ +public final class Ui { + + private final Device d; + + Ui(Device d) { + this.d = d; + } + + /** Common per-request UI backend options. {@code null} fields fall back to server defaults. */ + public record Options(String backend, String wdaUrl, Integer timeoutSeconds) { + public static Options defaults() { + return new Options(null, null, null); + } + } + + private Map query(Options o) { + Map q = RawHttp.query(); + if (o != null) { + if (o.backend() != null) { + q.put("backend", o.backend()); + } + if (o.wdaUrl() != null) { + q.put("wdaUrl", o.wdaUrl()); + } + if (o.timeoutSeconds() != null) { + q.put("timeout", Integer.toString(o.timeoutSeconds())); + } + } + return q; + } + + private Object post(String suffix, Options o, Object body) { + return d.http().postJson(d.devicePath(suffix), query(o), body, Object.class); + } + + private Object get(String suffix, Options o) { + return d.http().getJson(d.devicePath(suffix), query(o), Object.class); + } + + // -- gestures ---------------------------------------------------------- + + /** Tap at (x, y) ({@code POST /ui/tap}). */ + public Object tap(int x, int y, Options o) { + return post("/ui/tap", o, Map.of("x", x, "y", y)); + } + + public Object tap(int x, int y) { + return tap(x, y, null); + } + + /** Drag from (x1, y1) to (x2, y2) over {@code duration} seconds ({@code POST /ui/swipe}). */ + public Object swipe(int x1, int y1, int x2, int y2, Double duration, Options o) { + Map body = new LinkedHashMap<>(); + body.put("x1", x1); + body.put("y1", y1); + body.put("x2", x2); + body.put("y2", y2); + if (duration != null) { + body.put("duration", duration); + } + return post("/ui/swipe", o, body); + } + + public Object swipe(int x1, int y1, int x2, int y2) { + return swipe(x1, y1, x2, y2, null, null); + } + + /** Long-press at (x, y) ({@code POST /ui/longpress}). */ + public Object longPress(int x, int y, Double duration, Options o) { + Map body = new LinkedHashMap<>(); + body.put("x", x); + body.put("y", y); + if (duration != null) { + body.put("duration", duration); + } + return post("/ui/longpress", o, body); + } + + public Object longPress(int x, int y) { + return longPress(x, y, null, null); + } + + /** Type text ({@code POST /ui/type}). */ + public Object type(String text, Options o) { + return post("/ui/type", o, Map.of("text", text)); + } + + public Object type(String text) { + return type(text, null); + } + + /** Press a hardware/software button by name ({@code POST /ui/button}). */ + public Object button(String name, Options o) { + return post("/ui/button", o, Map.of("name", name)); + } + + public Object button(String name) { + return button(name, null); + } + + // -- introspection ----------------------------------------------------- + + /** Capture a PNG screenshot via the UI backend ({@code GET /ui/screenshot}); returns raw bytes. */ + public byte[] screenshot(Options o) { + return d.http().getBytes(d.devicePath("/ui/screenshot"), query(o)); + } + + public byte[] screenshot() { + return screenshot(null); + } + + /** Get the UI element source tree ({@code GET /ui/source}). */ + public Object source(Options o) { + return get("/ui/source", o); + } + + public Object source() { + return source(null); + } + + /** Get the window size ({@code GET /ui/size}). */ + public Object size(Options o) { + return get("/ui/size", o); + } + + public Object size() { + return size(null); + } + + /** Get the device orientation ({@code GET /ui/orientation}). */ + public Object orientation(Options o) { + return get("/ui/orientation", o); + } + + public Object orientation() { + return orientation(null); + } + + /** Set the device orientation ({@code POST /ui/orientation}). */ + public Object setOrientation(String orientation, Options o) { + return post("/ui/orientation", o, Map.of("orientation", orientation)); + } + + public Object setOrientation(String orientation) { + return setOrientation(orientation, null); + } + + /** Get the UI backend status ({@code GET /ui/status}). */ + public Object status(Options o) { + return get("/ui/status", o); + } + + public Object status() { + return status(null); + } + + // -- app control ------------------------------------------------------- + + /** Launch an app via the UI backend ({@code POST /ui/app/launch}). */ + public Object appLaunch(String bundleId, Options o) { + return post("/ui/app/launch", o, Map.of("bundleId", bundleId)); + } + + public Object appLaunch(String bundleId) { + return appLaunch(bundleId, null); + } + + /** Terminate an app via the UI backend ({@code POST /ui/app/terminate}). */ + public Object appTerminate(String bundleId, Options o) { + return post("/ui/app/terminate", o, Map.of("bundleId", bundleId)); + } + + public Object appTerminate(String bundleId) { + return appTerminate(bundleId, null); + } + + /** Foreground the backgrounded app ({@code POST /ui/app/foreground}); devicekit only. */ + public Object appForeground(Options o) { + return post("/ui/app/foreground", o, null); + } + + public Object appForeground() { + return appForeground(null); + } + + // -- raw passthrough --------------------------------------------------- + + /** Raw backend passthrough ({@code POST /ui/api}); {@code body} is the backend request payload. */ + public Object api(Object body, Options o) { + return post("/ui/api", o, body); + } + + public Object api(Object body) { + return api(body, null); + } + + // -- binary UI video stream -------------------------------------------- + + /** Open a live UI video stream ({@code GET /ui/stream}); returns raw bytes (MJPEG or H.264). */ + public BinaryStream stream(Options o, StreamOptions video) { + Map q = query(o); + if (video != null) { + video.apply(q); + } + return d.http().binaryStream(d.devicePath("/ui/stream"), q); + } + + public BinaryStream stream() { + return stream(null, null); + } + + /** Video-encoding options for {@link #stream}. All fields optional. */ + public record StreamOptions(String codec, String fps, String quality, String scale, String bitrate) { + void apply(Map q) { + if (codec != null) { + q.put("codec", codec); + } + if (fps != null) { + q.put("fps", fps); + } + if (quality != null) { + q.put("quality", quality); + } + if (scale != null) { + q.put("scale", scale); + } + if (bitrate != null) { + q.put("bitrate", bitrate); + } + } + } +} diff --git a/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Wda.java b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Wda.java new file mode 100644 index 000000000..c7fc5fa34 --- /dev/null +++ b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/Wda.java @@ -0,0 +1,29 @@ +package com.github.danielpaulus.goios; + +import com.github.danielpaulus.goios.generated.model.WdaConfig; +import com.github.danielpaulus.goios.generated.model.WdaSession; + +/** WebDriverAgent (XCUITest) session operations for a single device. */ +public final class Wda { + + private final Device d; + + Wda(Device d) { + this.d = d; + } + + /** Create a WDA session ({@code POST /wda/session}). */ + public WdaSession createSession(WdaConfig config) { + return d.http().postJson(d.devicePath("/wda/session"), null, config, WdaSession.class); + } + + /** Read a WDA session ({@code GET /wda/session/{id}}). */ + public WdaSession getSession(String sessionId) { + return d.http().getJson(d.devicePath("/wda/session/" + Device.seg(sessionId)), null, WdaSession.class); + } + + /** Delete a WDA session ({@code DELETE /wda/session/{id}}). */ + public WdaSession deleteSession(String sessionId) { + return d.http().deleteJson(d.devicePath("/wda/session/" + Device.seg(sessionId)), null, WdaSession.class); + } +} diff --git a/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/WebInspector.java b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/WebInspector.java new file mode 100644 index 000000000..16fb545a1 --- /dev/null +++ b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/WebInspector.java @@ -0,0 +1,47 @@ +package com.github.danielpaulus.goios; + +import com.github.danielpaulus.goios.generated.model.WebInspectorEvalResult; +import com.github.danielpaulus.goios.generated.model.WebInspectorLaunchResult; + +import java.util.LinkedHashMap; +import java.util.Map; + +/** Safari Web Inspector operations for a single device ({@code /webinspector/*}). */ +public final class WebInspector { + + private final Device d; + + WebInspector(Device d) { + this.d = d; + } + + /** List inspectable pages ({@code GET /webinspector/pages}). */ + public Object pages() { + return d.http().getJson(d.devicePath("/webinspector/pages"), null, Object.class); + } + + /** Open a URL in a new inspectable page ({@code POST /webinspector/launch}). */ + public WebInspectorLaunchResult launch(String url, String bundleId) { + Map body = new LinkedHashMap<>(); + if (url != null) { + body.put("url", url); + } + if (bundleId != null) { + body.put("bundleId", bundleId); + } + return d.http().postJson(d.devicePath("/webinspector/launch"), null, body, WebInspectorLaunchResult.class); + } + + /** Evaluate JavaScript in an inspectable page ({@code POST /webinspector/eval}). */ + public WebInspectorEvalResult eval(String script, String page, String bundleId) { + Map body = new LinkedHashMap<>(); + body.put("script", script); + if (page != null) { + body.put("page", page); + } + if (bundleId != null) { + body.put("bundleId", bundleId); + } + return d.http().postJson(d.devicePath("/webinspector/eval"), null, body, WebInspectorEvalResult.class); + } +} diff --git a/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/AppStateEvent.java b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/AppStateEvent.java new file mode 100644 index 000000000..b765a5a91 --- /dev/null +++ b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/AppStateEvent.java @@ -0,0 +1,11 @@ +package com.github.danielpaulus.goios.stream; + +import com.github.danielpaulus.goios.generated.model.AppStateNotification; + +/** An {@code appstate} notification event. */ +public record AppStateEvent(AppStateNotification payload) implements SseEvent { + @Override + public String eventName() { + return "appstate"; + } +} diff --git a/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/AttachDetachEvent.java b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/AttachDetachEvent.java new file mode 100644 index 000000000..da2435af8 --- /dev/null +++ b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/AttachDetachEvent.java @@ -0,0 +1,10 @@ +package com.github.danielpaulus.goios.stream; + +/** An {@code attachdetach} device-listen event (attach/detach/pair). */ +public record AttachDetachEvent(com.github.danielpaulus.goios.generated.model.AttachDetachEvent payload) + implements SseEvent { + @Override + public String eventName() { + return "attachdetach"; + } +} diff --git a/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/BinaryStream.java b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/BinaryStream.java new file mode 100644 index 000000000..faf8d9316 --- /dev/null +++ b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/BinaryStream.java @@ -0,0 +1,63 @@ +package com.github.danielpaulus.goios.stream; + +import java.io.IOException; +import java.io.InputStream; + +/** + * A raw byte stream over an {@code x-stream: binary} endpoint (UI video stream, + * MJPEG screenshot stream, live pcap capture). + * + *

Unlike {@link SseReader} these endpoints emit an opaque byte stream (MJPEG + * multipart, an H.264 elementary stream, or a libpcap capture), not typed SSE + * frames. {@code BinaryStream} is a plain {@link InputStream} the caller reads + * and consumes directly; closing it releases (and cancels) the underlying HTTP + * response so a long-lived capture can be stopped at any time. + */ +public final class BinaryStream extends InputStream { + + private final InputStream body; + private final Runnable onClose; + private final String contentType; + private boolean closed; + + public BinaryStream(InputStream body, String contentType, Runnable onClose) { + this.body = body; + this.contentType = contentType; + this.onClose = onClose; + } + + /** The response {@code Content-Type} (e.g. {@code multipart/x-mixed-replace}, {@code application/vnd.tcpdump.pcap}). */ + public String contentType() { + return contentType; + } + + @Override + public int read() throws IOException { + return body.read(); + } + + @Override + public int read(byte[] b, int off, int len) throws IOException { + return body.read(b, off, len); + } + + @Override + public int available() throws IOException { + return body.available(); + } + + @Override + public void close() throws IOException { + if (closed) { + return; + } + closed = true; + try { + body.close(); + } finally { + if (onClose != null) { + onClose.run(); + } + } + } +} diff --git a/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/EventDecoder.java b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/EventDecoder.java new file mode 100644 index 000000000..065db2f4f --- /dev/null +++ b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/EventDecoder.java @@ -0,0 +1,76 @@ +package com.github.danielpaulus.goios.stream; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.github.danielpaulus.goios.generated.invoker.JSON; +import com.github.danielpaulus.goios.generated.model.AppStateNotification; +import com.github.danielpaulus.goios.generated.model.CpuUsageSample; +import com.github.danielpaulus.goios.generated.model.JobLogLine; +import com.github.danielpaulus.goios.generated.model.OsTraceEntry; +import com.github.danielpaulus.goios.generated.model.SyslogMessage; + +/** + * Decodes one SSE frame (its {@code event:} name and JSON {@code data:} payload) + * into a typed {@link SseEvent}. One instance exists per endpoint payload shape; + * a {@code heartbeat} frame is always decoded to {@link HeartbeatEvent} and an + * unrecognized name to {@link UnknownEvent} regardless of the endpoint. + */ +@FunctionalInterface +public interface EventDecoder { + + /** Decode {@code data} for the given {@code eventName} into a typed event. */ + SseEvent apply(String eventName, String data); + + /** Shared Jackson mapper matching the generated models' (de)serialization. */ + ObjectMapper MAPPER = new JSON().getMapper(); + + static T read(String data, Class type) { + try { + return MAPPER.readValue(data == null ? "{}" : data, type); + } catch (Exception e) { + throw new IllegalStateException("failed to decode SSE payload: " + e.getMessage(), e); + } + } + + /** Decoder for the {@code /syslog} stream. */ + EventDecoder SYSLOG = (name, data) -> switch (name) { + case "syslog" -> new SyslogEvent(read(data, SyslogMessage.class)); + case "heartbeat" -> new HeartbeatEvent(); + default -> new UnknownEvent(name, data); + }; + + /** Decoder for the {@code /notifications} stream. */ + EventDecoder NOTIFICATIONS = (name, data) -> switch (name) { + case "appstate" -> new AppStateEvent(read(data, AppStateNotification.class)); + case "heartbeat" -> new HeartbeatEvent(); + default -> new UnknownEvent(name, data); + }; + + /** Decoder for the {@code /ostrace} stream. */ + EventDecoder OSTRACE = (name, data) -> switch (name) { + case "ostrace" -> new OsTraceEvent(read(data, OsTraceEntry.class)); + case "heartbeat" -> new HeartbeatEvent(); + default -> new UnknownEvent(name, data); + }; + + /** Decoder for the {@code /listen} device attach/detach stream. */ + EventDecoder LISTEN = (name, data) -> switch (name) { + case "attachdetach" -> new AttachDetachEvent( + read(data, com.github.danielpaulus.goios.generated.model.AttachDetachEvent.class)); + case "heartbeat" -> new HeartbeatEvent(); + default -> new UnknownEvent(name, data); + }; + + /** Decoder for the {@code /sysmontap} CPU-sample stream. */ + EventDecoder SYSMONTAP = (name, data) -> switch (name) { + case "sample" -> new SysmontapEvent(read(data, CpuUsageSample.class)); + case "heartbeat" -> new HeartbeatEvent(); + default -> new UnknownEvent(name, data); + }; + + /** Decoder for a {@code /jobs/{id}/logs} stream. */ + EventDecoder JOB_LOGS = (name, data) -> switch (name) { + case "log" -> new JobLogEvent(read(data, JobLogLine.class)); + case "heartbeat" -> new HeartbeatEvent(); + default -> new UnknownEvent(name, data); + }; +} diff --git a/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/HeartbeatEvent.java b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/HeartbeatEvent.java new file mode 100644 index 000000000..21aeeb2df --- /dev/null +++ b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/HeartbeatEvent.java @@ -0,0 +1,12 @@ +package com.github.danielpaulus.goios.stream; + +/** + * A keep-alive {@code heartbeat} event. Skipped by default; surfaced only when a + * stream is opened with {@code includeHeartbeats == true}. + */ +public record HeartbeatEvent() implements SseEvent { + @Override + public String eventName() { + return "heartbeat"; + } +} diff --git a/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/JobLogEvent.java b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/JobLogEvent.java new file mode 100644 index 000000000..e0dca12c6 --- /dev/null +++ b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/JobLogEvent.java @@ -0,0 +1,11 @@ +package com.github.danielpaulus.goios.stream; + +import com.github.danielpaulus.goios.generated.model.JobLogLine; + +/** A {@code log} event from a job-logs stream carrying one output line. */ +public record JobLogEvent(JobLogLine payload) implements SseEvent { + @Override + public String eventName() { + return "log"; + } +} diff --git a/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/OsTraceEvent.java b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/OsTraceEvent.java new file mode 100644 index 000000000..5fc3ee492 --- /dev/null +++ b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/OsTraceEvent.java @@ -0,0 +1,11 @@ +package com.github.danielpaulus.goios.stream; + +import com.github.danielpaulus.goios.generated.model.OsTraceEntry; + +/** An {@code ostrace} event carrying a decoded {@link OsTraceEntry}. */ +public record OsTraceEvent(OsTraceEntry payload) implements SseEvent { + @Override + public String eventName() { + return "ostrace"; + } +} diff --git a/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/SseEvent.java b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/SseEvent.java new file mode 100644 index 000000000..1940885fb --- /dev/null +++ b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/SseEvent.java @@ -0,0 +1,18 @@ +package com.github.danielpaulus.goios.stream; + +/** + * Base type for a decoded Server-Sent Event emitted by a go-ios SSE endpoint + * (syslog, notifications, ostrace, listen, sysmontap, job logs). + * + *

Every concrete event carries the wire {@code event:} name via + * {@link #eventName()}. Typed payload events additionally expose a strongly + * typed {@code payload()} accessor; unrecognized events are surfaced as + * {@link UnknownEvent} rather than being dropped. + */ +public sealed interface SseEvent + permits SyslogEvent, AppStateEvent, OsTraceEvent, AttachDetachEvent, + SysmontapEvent, JobLogEvent, HeartbeatEvent, UnknownEvent { + + /** The wire {@code event:} name (e.g. {@code "syslog"}, {@code "heartbeat"}). */ + String eventName(); +} diff --git a/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/SseReader.java b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/SseReader.java new file mode 100644 index 000000000..fee8f84a4 --- /dev/null +++ b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/SseReader.java @@ -0,0 +1,145 @@ +package com.github.danielpaulus.goios.stream; + +import java.util.Iterator; +import java.util.NoSuchElementException; + +/** + * A pull-based Server-Sent Events reader over a line source. + * + *

Parses text/event-stream frames (blank-line delimited groups of + * {@code event:} / {@code data:} lines, {@code :}-comment keep-alives ignored), + * decodes each frame with the supplied {@link EventDecoder}, and yields typed + * {@link SseEvent}s. Heartbeats are skipped unless {@code includeHeartbeats} is + * set. Multi-line {@code data:} fields are joined with {@code \n}. A trailing + * frame not terminated by a blank line is dispatched at end-of-stream. + * + *

Usable as an {@link Iterator} or in a {@code for-each} loop + * ({@link Iterable}), and as an {@link AutoCloseable}: closing runs the + * {@code onClose} hook exactly once (releasing the underlying HTTP response) and + * stops further iteration, so a live stream can be cancelled mid-flight. + */ +public final class SseReader implements Iterator, Iterable, AutoCloseable { + + private final Iterator lines; + private final EventDecoder decoder; + private final boolean includeHeartbeats; + private final Runnable onClose; + + private SseEvent next; + private boolean closed; + private boolean onCloseRan; + private boolean sawAnyLine; // whether we've consumed at least one line (for trailing-frame flush) + + public SseReader(Iterator lines, EventDecoder decoder, + boolean includeHeartbeats, Runnable onClose) { + this.lines = lines; + this.decoder = decoder; + this.includeHeartbeats = includeHeartbeats; + this.onClose = onClose; + } + + @Override + public Iterator iterator() { + return this; + } + + @Override + public boolean hasNext() { + if (next != null) { + return true; + } + if (closed) { + return false; + } + next = advance(); + return next != null; + } + + @Override + public SseEvent next() { + if (!hasNext()) { + throw new NoSuchElementException(); + } + SseEvent ev = next; + next = null; + return ev; + } + + /** Parse and decode the next dispatchable event, or {@code null} at end/close. */ + private SseEvent advance() { + String eventName = null; + StringBuilder data = null; + boolean inFrame = false; + + while (!closed) { + if (!lines.hasNext()) { + // End of stream: flush a trailing frame with data but no blank terminator. + if (inFrame && data != null) { + SseEvent ev = dispatch(eventName, data.toString()); + return ev != null ? ev : null; + } + return null; + } + String line = lines.next(); + sawAnyLine = true; + + if (line.isEmpty()) { + if (inFrame) { + SseEvent ev = dispatch(eventName, data == null ? "" : data.toString()); + if (ev != null) { + return ev; + } + // Skipped (e.g. heartbeat): reset and keep scanning. + eventName = null; + data = null; + inFrame = false; + } + continue; + } + if (line.charAt(0) == ':') { + // Comment / keep-alive line — ignore. + continue; + } + inFrame = true; + if (line.startsWith("event:")) { + eventName = strip(line.substring("event:".length())); + } else if (line.startsWith("data:")) { + String chunk = strip(line.substring("data:".length())); + if (data == null) { + data = new StringBuilder(chunk); + } else { + data.append('\n').append(chunk); + } + } + // Other field names (id:, retry:) are ignored. + } + return null; + } + + /** Decode one frame, honoring heartbeat filtering; returns null if filtered out. */ + private SseEvent dispatch(String eventName, String data) { + String name = eventName == null ? "message" : eventName; + SseEvent ev = decoder.apply(name, data); + if (ev instanceof HeartbeatEvent && !includeHeartbeats) { + return null; + } + return ev; + } + + private static String strip(String s) { + // A single optional leading space after the colon is part of the SSE format. + return s.startsWith(" ") ? s.substring(1) : s; + } + + @Override + public void close() { + closed = true; + next = null; + if (!onCloseRan) { + onCloseRan = true; + if (onClose != null) { + onClose.run(); + } + } + } +} diff --git a/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/SyslogEvent.java b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/SyslogEvent.java new file mode 100644 index 000000000..f4d834c81 --- /dev/null +++ b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/SyslogEvent.java @@ -0,0 +1,11 @@ +package com.github.danielpaulus.goios.stream; + +import com.github.danielpaulus.goios.generated.model.SyslogMessage; + +/** A {@code syslog} event carrying a decoded {@link SyslogMessage}. */ +public record SyslogEvent(SyslogMessage payload) implements SseEvent { + @Override + public String eventName() { + return "syslog"; + } +} diff --git a/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/SysmontapEvent.java b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/SysmontapEvent.java new file mode 100644 index 000000000..28a9d4bae --- /dev/null +++ b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/SysmontapEvent.java @@ -0,0 +1,11 @@ +package com.github.danielpaulus.goios.stream; + +import com.github.danielpaulus.goios.generated.model.CpuUsageSample; + +/** A {@code sample} event from the sysmontap stream carrying a CPU-usage sample. */ +public record SysmontapEvent(CpuUsageSample payload) implements SseEvent { + @Override + public String eventName() { + return "sample"; + } +} diff --git a/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/UnknownEvent.java b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/UnknownEvent.java new file mode 100644 index 000000000..26a9e2e0e --- /dev/null +++ b/sdks/packages/java/src/main/java/com/github/danielpaulus/goios/stream/UnknownEvent.java @@ -0,0 +1,9 @@ +package com.github.danielpaulus.goios.stream; + +/** + * An event whose {@code event:} name is not recognized by the SDK. The raw + * name and JSON data are preserved so callers can handle forward-compatible + * event types the SDK does not yet model. + */ +public record UnknownEvent(String eventName, String rawData) implements SseEvent { +} diff --git a/sdks/packages/java/src/test/java/com/github/danielpaulus/goios/DiscoveryTest.java b/sdks/packages/java/src/test/java/com/github/danielpaulus/goios/DiscoveryTest.java new file mode 100644 index 000000000..2642d3531 --- /dev/null +++ b/sdks/packages/java/src/test/java/com/github/danielpaulus/goios/DiscoveryTest.java @@ -0,0 +1,197 @@ +package com.github.danielpaulus.goios; + +import com.sun.net.httpserver.HttpServer; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import java.io.IOException; +import java.io.OutputStream; +import java.net.InetSocketAddress; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.HashMap; +import java.util.Map; +import java.util.function.Function; + +import static org.junit.jupiter.api.Assertions.*; + +/** + * Tests for ephemeral-daemon discovery: home-dir resolution, the discovery file, + * env precedence, and the {@link IosClient.Builder} resolution order. + * + *

Java can't mutate the process environment at runtime, so instead of setting + * {@code GO_IOS_HOME} as a real env var these tests drive {@link Discovery} + * through its injectable env / system-property lookups (the same seam the builder + * uses) with a {@link TempDir temp} home. + */ +class DiscoveryTest { + + /** Build a Discovery whose GO_IOS_HOME points at {@code home}, plus extra env. */ + private static Discovery discoveryWithHome(Path home, Map extraEnv) { + Map env = new HashMap<>(); + env.put("GO_IOS_HOME", home.toString()); + if (extraEnv != null) { + env.putAll(extraEnv); + } + Function props = k -> "user.home".equals(k) ? "/nonexistent-home" : null; + return Discovery.of(env::get, props); + } + + private static void writeDiscoveryFile(Path home, String baseUrl) throws IOException { + Files.createDirectories(home); + Files.writeString(home.resolve(Discovery.DISCOVERY_FILE), + "{\"baseUrl\":\"" + baseUrl + "\",\"host\":\"127.0.0.1\",\"port\":54321," + + "\"pid\":12345,\"startedAt\":\"2026-08-11T15:00:00Z\",\"tls\":false}"); + } + + // -- home-dir resolution ---------------------------------------------- + + @Test + void homeUsesGoIosHomeEnvWhenSet(@TempDir Path tmp) { + Discovery d = discoveryWithHome(tmp, null); + assertEquals(tmp, d.home()); + assertEquals(tmp.resolve("rest-api.json"), d.discoveryFile()); + } + + @Test + void homeFallsBackToUserHomeDotGoIos() { + Discovery d = Discovery.of(k -> null, k -> "user.home".equals(k) ? "/home/tester" : null); + assertEquals(Path.of("/home/tester", ".go-ios"), d.home()); + } + + @Test + void blankGoIosHomeFallsBackToUserHome() { + Discovery d = Discovery.of( + k -> "GO_IOS_HOME".equals(k) ? " " : null, + k -> "user.home".equals(k) ? "/home/tester" : null); + assertEquals(Path.of("/home/tester", ".go-ios"), d.home()); + } + + // -- discovery file ---------------------------------------------------- + + @Test + void readsBaseUrlFromDiscoveryFile(@TempDir Path tmp) throws IOException { + writeDiscoveryFile(tmp, "http://127.0.0.1:54321"); + Discovery d = discoveryWithHome(tmp, null); + assertEquals("http://127.0.0.1:54321", d.resolveBaseUrl()); + } + + @Test + void missingDiscoveryFileThrowsClearException(@TempDir Path tmp) { + Discovery d = discoveryWithHome(tmp, null); + IosDiscoveryException ex = assertThrows(IosDiscoveryException.class, d::resolveBaseUrl); + assertTrue(ex.getMessage().contains(tmp.resolve("rest-api.json").toString()), + "message must name the expected path: " + ex.getMessage()); + assertTrue(ex.getMessage().contains("no local go-ios REST daemon found"), ex.getMessage()); + } + + @Test + void malformedDiscoveryFileThrowsClearException(@TempDir Path tmp) throws IOException { + Files.createDirectories(tmp); + Files.writeString(tmp.resolve(Discovery.DISCOVERY_FILE), "not json at all"); + Discovery d = discoveryWithHome(tmp, null); + IosDiscoveryException ex = assertThrows(IosDiscoveryException.class, d::resolveBaseUrl); + assertTrue(ex.getMessage().contains("no local go-ios REST daemon found"), ex.getMessage()); + } + + @Test + void discoveryFileWithoutBaseUrlThrows(@TempDir Path tmp) throws IOException { + Files.createDirectories(tmp); + Files.writeString(tmp.resolve(Discovery.DISCOVERY_FILE), "{\"host\":\"127.0.0.1\",\"port\":1}"); + Discovery d = discoveryWithHome(tmp, null); + assertThrows(IosDiscoveryException.class, d::resolveBaseUrl); + } + + // -- env precedence ---------------------------------------------------- + + @Test + void goIosBaseUrlEnvTakesPrecedenceOverDiscoveryFile(@TempDir Path tmp) throws IOException { + writeDiscoveryFile(tmp, "http://127.0.0.1:54321"); + Discovery d = discoveryWithHome(tmp, Map.of("GO_IOS_BASE_URL", "http://10.0.0.5:9000")); + assertEquals("http://10.0.0.5:9000", d.resolveBaseUrl()); + } + + @Test + void goIosBaseUrlEnvUsedWhenNoDiscoveryFile(@TempDir Path tmp) { + Discovery d = discoveryWithHome(tmp, Map.of("GO_IOS_BASE_URL", "http://10.0.0.5:9000")); + assertEquals("http://10.0.0.5:9000", d.resolveBaseUrl()); + } + + // -- builder resolution order (end to end over a real HttpServer) ------ + + @Test + void builderWithoutBaseUrlUsesDiscoveredBaseUrl(@TempDir Path tmp) throws IOException { + try (Stub stub = new Stub()) { + writeDiscoveryFile(tmp, stub.baseUrl()); + try (IosClient c = IosClient.builder() + .discovery(discoveryWithHome(tmp, null)) + .build()) { + assertEquals(1, c.devices().list().size()); + } + } + } + + @Test + void explicitBaseUrlOverridesDiscovery(@TempDir Path tmp) throws IOException { + try (Stub stub = new Stub()) { + // Discovery file points somewhere unreachable; explicit baseUrl must win. + writeDiscoveryFile(tmp, "http://127.0.0.1:1"); + try (IosClient c = IosClient.builder() + .baseUrl(stub.baseUrl()) + .discovery(discoveryWithHome(tmp, null)) + .build()) { + assertEquals(1, c.devices().list().size()); + } + } + } + + @Test + void goIosBaseUrlEnvUsedByBuilder(@TempDir Path tmp) throws IOException { + try (Stub stub = new Stub()) { + // No discovery file; only the env var is set. + try (IosClient c = IosClient.builder() + .discovery(discoveryWithHome(tmp, Map.of("GO_IOS_BASE_URL", stub.baseUrl()))) + .build()) { + assertEquals(1, c.devices().list().size()); + } + } + } + + @Test + void builderWithoutBaseUrlAndNoDaemonThrowsClearException(@TempDir Path tmp) { + IosDiscoveryException ex = assertThrows(IosDiscoveryException.class, () -> + IosClient.builder().discovery(discoveryWithHome(tmp, null)).build()); + assertTrue(ex.getMessage().contains(tmp.resolve("rest-api.json").toString()), ex.getMessage()); + } + + /** Minimal in-process daemon stub serving {@code GET /api/v1/list}. */ + private static final class Stub implements AutoCloseable { + private final HttpServer server; + + Stub() throws IOException { + server = HttpServer.create(new InetSocketAddress("127.0.0.1", 0), 0); + server.createContext("/api/v1/list", ex -> { + byte[] body = ("{\"deviceList\":[{\"deviceID\":1," + + "\"properties\":{\"serialNumber\":\"UDID-A\"}}]}") + .getBytes(StandardCharsets.UTF_8); + ex.getResponseHeaders().set("Content-Type", "application/json"); + ex.sendResponseHeaders(200, body.length); + try (OutputStream os = ex.getResponseBody()) { + os.write(body); + } + }); + server.setExecutor(null); + server.start(); + } + + String baseUrl() { + return "http://127.0.0.1:" + server.getAddress().getPort(); + } + + @Override + public void close() { + server.stop(0); + } + } +} diff --git a/sdks/packages/java/src/test/java/com/github/danielpaulus/goios/FacadeHttpTest.java b/sdks/packages/java/src/test/java/com/github/danielpaulus/goios/FacadeHttpTest.java new file mode 100644 index 000000000..670486d44 --- /dev/null +++ b/sdks/packages/java/src/test/java/com/github/danielpaulus/goios/FacadeHttpTest.java @@ -0,0 +1,200 @@ +package com.github.danielpaulus.goios; + +import com.github.danielpaulus.goios.generated.model.AppInfo; +import com.github.danielpaulus.goios.generated.model.DeviceEntry; +import com.github.danielpaulus.goios.stream.SseReader; +import com.github.danielpaulus.goios.stream.SyslogEvent; +import com.sun.net.httpserver.HttpExchange; +import com.sun.net.httpserver.HttpServer; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.io.OutputStream; +import java.net.InetSocketAddress; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.atomic.AtomicReference; + +import static org.junit.jupiter.api.Assertions.*; + +/** Facade tests against an in-process {@link HttpServer} stub. */ +class FacadeHttpTest { + + private HttpServer server; + private String baseUrl; + private final List seenAuthHeaders = new CopyOnWriteArrayList<>(); + private final ConcurrentHashMap lastQuery = new ConcurrentHashMap<>(); + + @BeforeEach + void start() throws IOException { + server = HttpServer.create(new InetSocketAddress("127.0.0.1", 0), 0); + + server.createContext("/api/v1/list", ex -> { + record(ex); + respondJson(ex, 200, "{\"deviceList\":[" + + "{\"deviceID\":1,\"properties\":{\"serialNumber\":\"UDID-A\"}}," + + "{\"deviceID\":2,\"properties\":{\"serialNumber\":\"UDID-B\"}}]}"); + }); + + server.createContext("/api/v1/device/UDID-A/apps/", ex -> { + record(ex); + respondJson(ex, 200, "[{\"CFBundleIdentifier\":\"com.apple.Preferences\"," + + "\"CFBundleName\":\"Settings\"}]"); + }); + + server.createContext("/api/v1/device/UDID-A/screenshot", ex -> { + record(ex); + byte[] png = new byte[]{(byte) 0x89, 'P', 'N', 'G', 0x0D, 0x0A, 0x1A, 0x0A}; + ex.getResponseHeaders().set("Content-Type", "image/png"); + ex.sendResponseHeaders(200, png.length); + try (OutputStream os = ex.getResponseBody()) { + os.write(png); + } + }); + + server.createContext("/api/v1/device/UDID-A/setlocation", ex -> { + record(ex); + lastQuery.put("setlocation", ex.getRequestURI().getRawQuery()); + respondJson(ex, 200, "{\"message\":\"ok\"}"); + }); + + server.createContext("/api/v1/device/MISSING/info", ex -> { + record(ex); + respondJson(ex, 404, "{\"error\":\"device not found\"}"); + }); + + server.createContext("/api/v1/device/UDID-A/syslog", ex -> { + record(ex); + ex.getResponseHeaders().set("Content-Type", "text/event-stream"); + byte[] body = ("event: syslog\ndata: {\"message\":\"boot\"}\n\n" + + "event: heartbeat\ndata: {}\n\n" + + "event: syslog\ndata: {\"message\":\"ready\"}\n\n").getBytes(StandardCharsets.UTF_8); + ex.sendResponseHeaders(200, body.length); + try (OutputStream os = ex.getResponseBody()) { + os.write(body); + } + }); + + server.setExecutor(null); + server.start(); + baseUrl = "http://127.0.0.1:" + server.getAddress().getPort(); + } + + @AfterEach + void stop() { + server.stop(0); + } + + private void record(HttpExchange ex) { + List auth = ex.getRequestHeaders().get("Authorization"); + seenAuthHeaders.add(auth == null ? "" : String.join(",", auth)); + } + + private static void respondJson(HttpExchange ex, int status, String json) throws IOException { + byte[] body = json.getBytes(StandardCharsets.UTF_8); + ex.getResponseHeaders().set("Content-Type", "application/json"); + ex.sendResponseHeaders(status, body.length); + try (OutputStream os = ex.getResponseBody()) { + os.write(body); + } + } + + private IosClient client() { + return IosClient.builder().baseUrl(baseUrl).apiKey("secret-token").build(); + } + + @Test + void listsDevicesAndSendsBearerAuth() { + try (IosClient c = client()) { + List devices = c.devices().list(); + assertEquals(2, devices.size()); + assertEquals("UDID-A", devices.get(0).getProperties().getSerialNumber()); + } + assertTrue(seenAuthHeaders.contains("Bearer secret-token"), + "Authorization: Bearer header must be sent; saw " + seenAuthHeaders); + } + + @Test + void omitsAuthHeaderWhenNoApiKey() { + try (IosClient c = IosClient.builder().baseUrl(baseUrl).build()) { + c.devices().list(); + } + assertEquals("", seenAuthHeaders.get(seenAuthHeaders.size() - 1)); + } + + @Test + void listsApps() { + try (IosClient c = client()) { + List apps = c.device("UDID-A").apps().list(); + assertEquals(1, apps.size()); + assertEquals("com.apple.Preferences", apps.get(0).getCfBundleIdentifier()); + } + } + + @Test + void screenshotReturnsRawPngBytes() { + try (IosClient c = client()) { + byte[] png = c.device("UDID-A").screenshot(); + assertEquals(8, png.length); + assertEquals((byte) 0x89, png[0]); + assertEquals('P', png[1]); + assertEquals('N', png[2]); + assertEquals('G', png[3]); + } + } + + @Test + void setLocationUsesCorrectlySpelledLongitude() { + try (IosClient c = client()) { + c.device("UDID-A").setLocation(37.3349, -122.009); + } + String q = lastQuery.get("setlocation"); + assertNotNull(q); + assertTrue(q.contains("longitude="), "query must use 'longitude': " + q); + assertFalse(q.contains("longtitude"), "must not use the legacy misspelling: " + q); + assertTrue(q.contains("latitude="), q); + } + + @Test + void notFoundRaisesIosApiExceptionWithEnvelope() { + try (IosClient c = client()) { + IosApiException ex = assertThrows(IosApiException.class, () -> c.device("MISSING").info()); + assertEquals(404, ex.statusCode()); + assertNotNull(ex.errorBody()); + assertEquals("device not found", ex.errorBody().getError()); + } + } + + @Test + void streamsSyslogOverRealHttpSkippingHeartbeats() { + try (IosClient c = client()) { + List messages = new ArrayList<>(); + AtomicReference ref = new AtomicReference<>(); + try (SseReader stream = c.device("UDID-A").syslog()) { + ref.set(stream); + for (var ev : stream) { + if (ev instanceof SyslogEvent s) { + messages.add(s.payload().getMessage()); + } + } + } + assertEquals(List.of("boot", "ready"), messages); + } + } + + @Test + void streamIsCancellableMidflight() { + try (IosClient c = client()) { + SseReader stream = c.device("UDID-A").syslog(); + assertTrue(stream.hasNext()); + stream.next(); // read one event then bail + stream.close(); // should not throw + assertFalse(stream.hasNext()); + } + } +} diff --git a/sdks/packages/java/src/test/java/com/github/danielpaulus/goios/FullSurfaceHttpTest.java b/sdks/packages/java/src/test/java/com/github/danielpaulus/goios/FullSurfaceHttpTest.java new file mode 100644 index 000000000..5efa597c4 --- /dev/null +++ b/sdks/packages/java/src/test/java/com/github/danielpaulus/goios/FullSurfaceHttpTest.java @@ -0,0 +1,416 @@ +package com.github.danielpaulus.goios; + +import com.github.danielpaulus.goios.generated.model.BatteryInfo; +import com.github.danielpaulus.goios.generated.model.CrashListing; +import com.github.danielpaulus.goios.generated.model.GenericResponse; +import com.github.danielpaulus.goios.generated.model.DeviceEntry; +import com.github.danielpaulus.goios.generated.model.FileListing; +import com.github.danielpaulus.goios.generated.model.FilePushResult; +import com.github.danielpaulus.goios.generated.model.Job; +import com.github.danielpaulus.goios.generated.model.MemLimitResult; +import com.github.danielpaulus.goios.generated.model.StatusOk; +import com.github.danielpaulus.goios.generated.model.Tunnel; +import com.github.danielpaulus.goios.generated.model.TunnelStopped; +import com.github.danielpaulus.goios.stream.JobLogEvent; +import com.github.danielpaulus.goios.stream.SseReader; +import com.github.danielpaulus.goios.stream.SysmontapEvent; +import com.sun.net.httpserver.HttpExchange; +import com.sun.net.httpserver.HttpServer; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.io.OutputStream; +import java.net.InetSocketAddress; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; + +import static org.junit.jupiter.api.Assertions.*; + +/** + * Exercises the full-surface facade groups added in the 80-endpoint extension + * against an in-process {@link HttpServer} stub: device management, files, + * settings, media, MDM (multipart), crashes, jobs, tunnels, and the two new SSE + * streams (sysmontap, job logs). + */ +class FullSurfaceHttpTest { + + private HttpServer server; + private String baseUrl; + private final ConcurrentHashMap lastQuery = new ConcurrentHashMap<>(); + private final ConcurrentHashMap lastMethod = new ConcurrentHashMap<>(); + private final ConcurrentHashMap lastBody = new ConcurrentHashMap<>(); + private final ConcurrentHashMap lastContentType = new ConcurrentHashMap<>(); + + @BeforeEach + void start() throws IOException { + server = HttpServer.create(new InetSocketAddress("127.0.0.1", 0), 0); + String U = "/api/v1/device/UDID-A/"; + + // ---- device info / management + ctx(U + "battery", ex -> json(ex, 200, + "{\"CurrentCapacity\":83,\"IsCharging\":true,\"FullyCharged\":false}")); + ctx(U + "reboot", ex -> json(ex, 200, "{\"message\":\"rebooting\"}")); + ctx(U + "erase", ex -> { + put(lastQuery, "erase", ex.getRequestURI().getRawQuery()); + json(ex, 200, "{\"message\":\"erased\"}"); + }); + ctx(U + "memlimitoff", ex -> json(ex, 200, + "{\"process\":\"backboardd\",\"pid\":42,\"disabled\":true}")); + ctx(U + "mobilegestalt", ex -> { + put(lastQuery, "mobilegestalt", ex.getRequestURI().getRawQuery()); + json(ex, 200, "{\"ProductType\":\"iPhone14,2\"}"); + }); + + // ---- files + ctx(U + "files", ex -> { + put(lastQuery, "files", ex.getRequestURI().getRawQuery()); + json(ex, 200, "{\"path\":\"/Documents\",\"count\":1," + + "\"files\":[{\"name\":\"log.txt\",\"isDir\":false,\"size\":12}]}"); + }); + ctx(U + "files/pull", ex -> { + byte[] b = "hello-file".getBytes(StandardCharsets.UTF_8); + ex.getResponseHeaders().set("Content-Type", "application/octet-stream"); + ex.sendResponseHeaders(200, b.length); + try (OutputStream os = ex.getResponseBody()) { os.write(b); } + }); + ctx(U + "files/push", ex -> { + put(lastMethod, "files/push", ex.getRequestMethod()); + put(lastBody, "files/push", ex.getRequestBody().readAllBytes()); + json(ex, 200, "{\"remote\":\"/Documents/out.txt\",\"size\":5}"); + }); + + // ---- settings + ctx(U + "assistivetouch", ex -> json(ex, 200, "{\"AssistiveTouchEnabled\":true}")); + ctx(U + "wifi", ex -> { + put(lastMethod, "wifi", ex.getRequestMethod()); + put(lastQuery, "wifi", ex.getRequestURI().getRawQuery()); + json(ex, 200, "{\"message\":\"ok\"}"); + }); + + // ---- media + ctx(U + "wallpaper", ex -> { + put(lastMethod, "wallpaper", ex.getRequestMethod()); + put(lastContentType, "wallpaper", first(ex, "Content-Type")); + if ("PUT".equals(ex.getRequestMethod())) { + put(lastBody, "wallpaper", ex.getRequestBody().readAllBytes()); + json(ex, 200, "{\"message\":\"set\"}"); + } else { + byte[] png = {(byte) 0x89, 'P', 'N', 'G'}; + ex.getResponseHeaders().set("Content-Type", "image/png"); + ex.sendResponseHeaders(200, png.length); + try (OutputStream os = ex.getResponseBody()) { os.write(png); } + } + }); + ctx(U + "pasteboard", ex -> { + put(lastMethod, "pasteboard", ex.getRequestMethod()); + if ("PUT".equals(ex.getRequestMethod())) { + put(lastBody, "pasteboard", ex.getRequestBody().readAllBytes()); + put(lastContentType, "pasteboard", first(ex, "Content-Type")); + json(ex, 200, "{\"message\":\"ok\"}"); + } else { + json(ex, 200, "{\"present\":true,\"text\":\"clip\"}"); + } + }); + + // ---- mdm (multipart) + ctx(U + "mdm/clear-passcode", ex -> { + put(lastContentType, "mdm", first(ex, "Content-Type")); + put(lastBody, "mdm", ex.getRequestBody().readAllBytes()); + json(ex, 200, "{\"status\":\"ok\"}"); + }); + + // ---- crashes + ctx(U + "crashes", ex -> { + put(lastMethod, "crashes", ex.getRequestMethod()); + put(lastQuery, "crashes", ex.getRequestURI().getRawQuery()); + if ("DELETE".equals(ex.getRequestMethod())) { + json(ex, 200, "{\"message\":\"removed\"}"); + } else { + json(ex, 200, "{\"files\":[\"a.crash\",\"b.crash\"],\"count\":2}"); + } + }); + + // ---- profiles (multipart POST) + ctx(U + "profiles", ex -> { + put(lastMethod, "profiles", ex.getRequestMethod()); + put(lastContentType, "profiles", first(ex, "Content-Type")); + json(ex, 200, "{\"message\":\"installed\"}"); + }); + + // ---- jobs + ctx(U + "jobs/forward", ex -> { + put(lastBody, "jobs/forward", ex.getRequestBody().readAllBytes()); + json(ex, 202, "{\"id\":\"forward-1\",\"kind\":\"forward\",\"udid\":\"UDID-A\"," + + "\"status\":\"running\",\"startedAt\":\"2024-01-01T00:00:00Z\"}"); + }); + ctx(U + "jobs/job-1/logs", ex -> { + ex.getResponseHeaders().set("Content-Type", "text/event-stream"); + byte[] body = ("event: log\ndata: {\"line\":\"starting\"}\n\n" + + "event: heartbeat\ndata: {}\n\n" + + "event: log\ndata: {\"line\":\"done\"}\n\n").getBytes(StandardCharsets.UTF_8); + ex.sendResponseHeaders(200, body.length); + try (OutputStream os = ex.getResponseBody()) { os.write(body); } + }); + + // ---- sysmontap SSE + ctx(U + "sysmontap", ex -> { + ex.getResponseHeaders().set("Content-Type", "text/event-stream"); + byte[] body = ("event: sample\ndata: {\"CPU_TotalLoad\":42.5}\n\n" + + "event: heartbeat\ndata: {}\n\n" + + "event: sample\ndata: {\"CPU_TotalLoad\":7.0}\n\n").getBytes(StandardCharsets.UTF_8); + ex.sendResponseHeaders(200, body.length); + try (OutputStream os = ex.getResponseBody()) { os.write(body); } + }); + + // ---- tunnels (fleet-level) + ctx("/api/v1/tunnels", ex -> json(ex, 200, + "[{\"Udid\":\"UDID-A\",\"Address\":\"fd00::1\",\"RsdPort\":50000}]")); + ctx("/api/v1/tunnels/UDID-A/refresh", ex -> json(ex, 200, + "{\"Udid\":\"UDID-A\",\"Address\":\"fd00::2\",\"RsdPort\":50001}")); + ctx("/api/v1/tunnels/UDID-A", ex -> { + // DELETE handler (the /refresh context wins for that suffix). + if ("DELETE".equals(ex.getRequestMethod())) { + json(ex, 200, "{\"udid\":\"UDID-A\",\"status\":\"stopped\"}"); + } else { + json(ex, 404, "{\"error\":\"nope\"}"); + } + }); + + server.setExecutor(null); + server.start(); + baseUrl = "http://127.0.0.1:" + server.getAddress().getPort(); + } + + @AfterEach + void stop() { + server.stop(0); + } + + private void ctx(String path, com.sun.net.httpserver.HttpHandler h) { + server.createContext(path, h); + } + + /** Null-safe record into a map ({@link ConcurrentHashMap} forbids null values). */ + private static void put(ConcurrentHashMap map, String key, V value) { + if (value != null) { + map.put(key, value); + } + } + + private static String first(HttpExchange ex, String header) { + List v = ex.getRequestHeaders().get(header); + return v == null || v.isEmpty() ? null : v.get(0); + } + + private static void json(HttpExchange ex, int status, String body) throws IOException { + byte[] b = body.getBytes(StandardCharsets.UTF_8); + ex.getResponseHeaders().set("Content-Type", "application/json"); + ex.sendResponseHeaders(status, b.length); + try (OutputStream os = ex.getResponseBody()) { os.write(b); } + } + + private IosClient client() { + return IosClient.builder().baseUrl(baseUrl).apiKey("secret").build(); + } + + // ------------------------------------------------------------------ tests + + @Test + void udidConvenienceAccessor() { + DeviceEntry e = new DeviceEntry(); + assertNull(Devices.udid(e)); // no properties + } + + @Test + void battery() { + try (IosClient c = client()) { + BatteryInfo b = c.device("UDID-A").battery(); + assertEquals(83, b.getCurrentCapacity()); + assertTrue(b.getIsCharging()); + } + } + + @Test + void rebootAndEraseConfirm() { + try (IosClient c = client()) { + assertEquals("rebooting", c.device("UDID-A").reboot().getMessage()); + c.device("UDID-A").erase(true); + } + assertTrue(lastQuery.get("erase").contains("confirm=true"), lastQuery.get("erase")); + } + + @Test + void memlimitoff() { + try (IosClient c = client()) { + MemLimitResult r = c.device("UDID-A").memlimitoff("backboardd"); + assertEquals("backboardd", r.getProcess()); + assertTrue(r.getDisabled()); + } + } + + @Test + void mobileGestaltPassesKeys() { + try (IosClient c = client()) { + Object g = c.device("UDID-A").mobileGestalt(List.of("ProductType", "BuildVersion")); + assertTrue(g.toString().contains("iPhone14,2")); + } + // The spec marks `key` as explode:false, so the generated client sends a + // single comma-joined value (URL-encoded comma: %2C). + String q = lastQuery.get("mobilegestalt"); + assertTrue(q.startsWith("key="), q); + assertTrue(q.contains("ProductType"), q); + assertTrue(q.contains("BuildVersion"), q); + } + + @Test + void filesLsPullPush() { + try (IosClient c = client()) { + FileListing ls = c.device("UDID-A").files().ls("app", "com.x", "/Documents"); + assertEquals(1, ls.getCount()); + assertEquals("log.txt", ls.getFiles().get(0).getName()); + assertTrue(lastQuery.get("files").contains("domain=app"), lastQuery.get("files")); + assertTrue(lastQuery.get("files").contains("identifier=com.x")); + + byte[] pulled = c.device("UDID-A").files().pull("temp", null, "/x"); + assertEquals("hello-file", new String(pulled, StandardCharsets.UTF_8)); + + FilePushResult push = c.device("UDID-A").files() + .push("temp", null, "/Documents/out.txt", "hello".getBytes(StandardCharsets.UTF_8)); + assertEquals(5, push.getSize()); + assertEquals("POST", lastMethod.get("files/push")); + assertArrayEquals("hello".getBytes(StandardCharsets.UTF_8), lastBody.get("files/push")); + } + } + + @Test + void settingsAssistiveTouchAndWifi() { + try (IosClient c = client()) { + assertTrue(c.device("UDID-A").settings().assistiveTouch().getAssistiveTouchEnabled()); + c.device("UDID-A").settings().setWifi("net", "pw", "WPA2"); + c.device("UDID-A").settings().removeWifi("net"); + } + assertTrue(lastQuery.get("wifi").contains("ssid=net"), lastQuery.get("wifi")); + } + + @Test + void mediaWallpaperMultipartAndPasteboardTextPlain() { + try (IosClient c = client()) { + byte[] png = c.device("UDID-A").media().wallpaper(); + assertEquals((byte) 0x89, png[0]); + + c.device("UDID-A").media().setWallpaper( + "img".getBytes(StandardCharsets.UTF_8), + "p12".getBytes(StandardCharsets.UTF_8), "pass", "home"); + assertEquals("PUT", lastMethod.get("wallpaper")); + assertTrue(lastContentType.get("wallpaper").startsWith("multipart/form-data"), + lastContentType.get("wallpaper")); + String mp = new String(lastBody.get("wallpaper"), StandardCharsets.UTF_8); + assertTrue(mp.contains("name=\"image\""), mp); + assertTrue(mp.contains("name=\"p12\""), mp); + assertTrue(mp.contains("name=\"screen\""), mp); + + assertEquals("clip", c.device("UDID-A").media().pasteboard().getText()); + c.device("UDID-A").media().setPasteboard("copied"); + assertEquals("PUT", lastMethod.get("pasteboard")); + assertEquals("copied", new String(lastBody.get("pasteboard"), StandardCharsets.UTF_8)); + } + } + + @Test + void mdmClearPasscodeSendsMultipartWithTokenAndP12() { + try (IosClient c = client()) { + StatusOk ok = c.device("UDID-A").mdm().clearPasscode( + "p12bytes".getBytes(StandardCharsets.UTF_8), "pw", "TOKEN123"); + assertEquals("ok", ok.getStatus()); + } + assertTrue(lastContentType.get("mdm").startsWith("multipart/form-data")); + String mp = new String(lastBody.get("mdm"), StandardCharsets.UTF_8); + assertTrue(mp.contains("name=\"p12\""), mp); + assertTrue(mp.contains("name=\"token\""), mp); + assertTrue(mp.contains("TOKEN123"), mp); + } + + @Test + void crashesListAndProfilesMultipart() { + try (IosClient c = client()) { + CrashListing cr = c.device("UDID-A").crashes().list(); + assertEquals(2, cr.getCount()); + // remove(pattern) — pattern is the primary arg; cwd defaults. + GenericResponse rm = c.device("UDID-A").crashes().remove("*.crash"); + assertEquals("removed", rm.getMessage()); + assertEquals("DELETE", lastMethod.get("crashes")); + String cq = lastQuery.get("crashes"); + assertTrue(cq != null && cq.contains("pattern=*.crash"), cq); + assertTrue(cq.contains("cwd=."), cq); + // remove(pattern, cwd) — explicit working directory. + c.device("UDID-A").crashes().remove("*.ips", "/tmp/crashes"); + cq = lastQuery.get("crashes"); + assertTrue(cq.contains("pattern=*.ips"), cq); + assertTrue(cq.contains("cwd=%2Ftmp%2Fcrashes"), cq); + c.device("UDID-A").addProfile("cfg".getBytes(StandardCharsets.UTF_8), null, null); + } + assertEquals("POST", lastMethod.get("profiles")); + assertTrue(lastContentType.get("profiles").startsWith("multipart/form-data")); + } + + @Test + void jobsForwardReturns202Job() { + try (IosClient c = client()) { + Job job = c.device("UDID-A").jobs().forward(8080, 9090); + assertEquals("forward-1", job.getId()); + assertEquals("forward", job.getKind()); + } + String body = new String(lastBody.get("jobs/forward"), StandardCharsets.UTF_8); + assertTrue(body.contains("8080"), body); + assertTrue(body.contains("9090"), body); + } + + @Test + void tunnelsListRefreshDelete() { + try (IosClient c = client()) { + List tunnels = c.tunnels().list(); + assertEquals(1, tunnels.size()); + assertEquals("UDID-A", tunnels.get(0).getUdid()); + + Tunnel refreshed = c.tunnels().refresh("UDID-A"); + assertEquals(50001, refreshed.getRsdPort()); + + TunnelStopped stopped = c.tunnels().delete("UDID-A"); + assertEquals("stopped", stopped.getStatus()); + } + } + + @Test + void sysmontapStreamSkipsHeartbeats() { + try (IosClient c = client()) { + List samples = new ArrayList<>(); + try (SseReader stream = c.device("UDID-A").sysmontap()) { + for (var ev : stream) { + if (ev instanceof SysmontapEvent s) { + samples.add(s.payload()); + } + } + } + assertEquals(2, samples.size(), "two sample events, heartbeat skipped"); + } + } + + @Test + void jobLogsStreamDecodesLines() { + try (IosClient c = client()) { + List lines = new ArrayList<>(); + try (SseReader stream = c.device("UDID-A").jobs().logs("job-1")) { + for (var ev : stream) { + if (ev instanceof JobLogEvent l) { + lines.add(l.payload().getLine()); + } + } + } + assertEquals(List.of("starting", "done"), lines); + } + } +} diff --git a/sdks/packages/java/src/test/java/com/github/danielpaulus/goios/V3SurfaceHttpTest.java b/sdks/packages/java/src/test/java/com/github/danielpaulus/goios/V3SurfaceHttpTest.java new file mode 100644 index 000000000..4976e317c --- /dev/null +++ b/sdks/packages/java/src/test/java/com/github/danielpaulus/goios/V3SurfaceHttpTest.java @@ -0,0 +1,294 @@ +package com.github.danielpaulus.goios; + +import com.github.danielpaulus.goios.generated.model.DiskSpaceInfo; +import com.github.danielpaulus.goios.generated.model.FsyncListing; +import com.github.danielpaulus.goios.generated.model.FsyncPushResult; +import com.github.danielpaulus.goios.generated.model.NetworkInfo; +import com.github.danielpaulus.goios.generated.model.PrepareSkipOptions; +import com.github.danielpaulus.goios.generated.model.SupervisionCert; +import com.github.danielpaulus.goios.generated.model.VoiceOverState; +import com.github.danielpaulus.goios.generated.model.WebInspectorEvalResult; +import com.github.danielpaulus.goios.stream.BinaryStream; +import com.sun.net.httpserver.HttpExchange; +import com.sun.net.httpserver.HttpServer; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.io.OutputStream; +import java.net.InetSocketAddress; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; + +import static org.junit.jupiter.api.Assertions.*; + +/** + * Exercises the v3 facade groups added on top of the base surface: accessibility, + * network/disk diagnostics, fsync (AFC), web-inspector, host-scoped sign/prepare, + * UI automation, and the binary (non-SSE) streaming endpoints. + */ +class V3SurfaceHttpTest { + + private HttpServer server; + private String baseUrl; + private final ConcurrentHashMap lastQuery = new ConcurrentHashMap<>(); + private final ConcurrentHashMap lastMethod = new ConcurrentHashMap<>(); + private final ConcurrentHashMap lastBody = new ConcurrentHashMap<>(); + private final ConcurrentHashMap lastContentType = new ConcurrentHashMap<>(); + + @BeforeEach + void start() throws IOException { + server = HttpServer.create(new InetSocketAddress("127.0.0.1", 0), 0); + String U = "/api/v1/device/UDID-A/"; + + // ---- diagnostics-net + ctx(U + "diskspace", ex -> json(ex, 200, + "{\"Model\":\"disk0\",\"FSTotalBytes\":128000000000,\"FSFreeBytes\":64000000000,\"FSBlockSize\":4096}")); + ctx(U + "ip", ex -> json(ex, 200, "{\"MacAddress\":\"aa:bb:cc:dd:ee:ff\"}")); + + // ---- accessibility + ctx(U + "voiceover", ex -> { + put(lastMethod, "voiceover", ex.getRequestMethod()); + if ("PUT".equals(ex.getRequestMethod())) { + put(lastBody, "voiceover", ex.getRequestBody().readAllBytes()); + json(ex, 200, "{\"VoiceOverEnabled\":true}"); + } else { + json(ex, 200, "{\"VoiceOverEnabled\":false}"); + } + }); + ctx(U + "setlocation/gpx", ex -> { + put(lastContentType, "gpx", first(ex, "Content-Type")); + put(lastBody, "gpx", ex.getRequestBody().readAllBytes()); + json(ex, 200, "{\"message\":\"replaying\"}"); + }); + + // ---- fsync + ctx(U + "fsync/ls", ex -> { + put(lastQuery, "fsync/ls", ex.getRequestURI().getRawQuery()); + json(ex, 200, "{\"path\":\"/Documents\",\"count\":2,\"files\":[\"a.txt\",\"b.txt\"]}"); + }); + ctx(U + "fsync/pull", ex -> { + byte[] b = "afc-bytes".getBytes(StandardCharsets.UTF_8); + ex.getResponseHeaders().set("Content-Type", "application/octet-stream"); + ex.sendResponseHeaders(200, b.length); + try (OutputStream os = ex.getResponseBody()) { os.write(b); } + }); + ctx(U + "fsync/push", ex -> { + put(lastMethod, "fsync/push", ex.getRequestMethod()); + put(lastContentType, "fsync/push", first(ex, "Content-Type")); + put(lastBody, "fsync/push", ex.getRequestBody().readAllBytes()); + json(ex, 200, "{\"path\":\"/Documents/x.bin\",\"size\":4}"); + }); + + // ---- webinspector + ctx(U + "webinspector/eval", ex -> { + put(lastBody, "webinspector/eval", ex.getRequestBody().readAllBytes()); + json(ex, 200, "{\"page\":\"1\",\"result\":42}"); + }); + + // ---- ui + ctx(U + "ui/tap", ex -> { + put(lastQuery, "ui/tap", ex.getRequestURI().getRawQuery()); + put(lastBody, "ui/tap", ex.getRequestBody().readAllBytes()); + json(ex, 200, "{\"ok\":true}"); + }); + ctx(U + "ui/screenshot", ex -> { + byte[] png = {(byte) 0x89, 'P', 'N', 'G'}; + ex.getResponseHeaders().set("Content-Type", "image/png"); + ex.sendResponseHeaders(200, png.length); + try (OutputStream os = ex.getResponseBody()) { os.write(png); } + }); + // Binary UI video stream: emit chunked raw bytes. + ctx(U + "ui/stream", ex -> { + ex.getResponseHeaders().set("Content-Type", "multipart/x-mixed-replace; boundary=frame"); + ex.sendResponseHeaders(200, 0); // chunked + try (OutputStream os = ex.getResponseBody()) { + for (int i = 0; i < 4; i++) { + os.write(("chunk-" + i + ";").getBytes(StandardCharsets.UTF_8)); + os.flush(); + } + } + }); + + // ---- host-scoped + ctx("/api/v1/prepare/skip-options", ex -> json(ex, 200, + "{\"count\":2,\"options\":[\"Passcode\",\"Siri\"]}")); + ctx("/api/v1/prepare/create-cert", ex -> { + put(lastMethod, "create-cert", ex.getRequestMethod()); + json(ex, 200, "{\"certPem\":\"-----BEGIN CERT-----\",\"privateKeyPem\":\"-----BEGIN KEY-----\"}"); + }); + ctx("/api/v1/sign/certificate", ex -> { + put(lastContentType, "sign/certificate", first(ex, "Content-Type")); + put(lastBody, "sign/certificate", ex.getRequestBody().readAllBytes()); + byte[] p12 = {0x30, (byte) 0x82, 0x01, 0x02}; // pkcs12 magic-ish + ex.getResponseHeaders().set("Content-Type", "application/x-pkcs12"); + ex.sendResponseHeaders(200, p12.length); + try (OutputStream os = ex.getResponseBody()) { os.write(p12); } + }); + + server.setExecutor(null); + server.start(); + baseUrl = "http://127.0.0.1:" + server.getAddress().getPort(); + } + + @AfterEach + void stop() { + server.stop(0); + } + + private void ctx(String path, com.sun.net.httpserver.HttpHandler h) { + server.createContext(path, h); + } + + private static void put(ConcurrentHashMap map, String key, V value) { + if (value != null) { + map.put(key, value); + } + } + + private static String first(HttpExchange ex, String header) { + List v = ex.getRequestHeaders().get(header); + return v == null || v.isEmpty() ? null : v.get(0); + } + + private static void json(HttpExchange ex, int status, String body) throws IOException { + byte[] b = body.getBytes(StandardCharsets.UTF_8); + ex.getResponseHeaders().set("Content-Type", "application/json"); + ex.sendResponseHeaders(status, b.length); + try (OutputStream os = ex.getResponseBody()) { os.write(b); } + } + + private IosClient client() { + return IosClient.builder().baseUrl(baseUrl).apiKey("secret").build(); + } + + // ------------------------------------------------------------------ tests + + @Test + void diskSpaceAndIp() { + try (IosClient c = client()) { + DiskSpaceInfo disk = c.device("UDID-A").diskSpace(); + assertEquals("disk0", disk.getModel()); + assertEquals(64000000000L, disk.getFsFreeBytes()); + NetworkInfo net = c.device("UDID-A").ip(); + assertEquals("aa:bb:cc:dd:ee:ff", net.getMacAddress()); + } + } + + @Test + void voiceOverGetAndSet() { + try (IosClient c = client()) { + assertFalse(c.device("UDID-A").voiceOver().getVoiceOverEnabled()); + VoiceOverState set = c.device("UDID-A").setVoiceOver(true); + assertTrue(set.getVoiceOverEnabled()); + } + assertEquals("PUT", lastMethod.get("voiceover")); + assertTrue(new String(lastBody.get("voiceover"), StandardCharsets.UTF_8).contains("enabled"), + new String(lastBody.get("voiceover"), StandardCharsets.UTF_8)); + } + + @Test + void setLocationGpxIsMultipart() { + try (IosClient c = client()) { + assertEquals("replaying", + c.device("UDID-A").setLocationGpx("".getBytes(StandardCharsets.UTF_8)).getMessage()); + } + assertTrue(lastContentType.get("gpx").startsWith("multipart/form-data"), lastContentType.get("gpx")); + String mp = new String(lastBody.get("gpx"), StandardCharsets.UTF_8); + assertTrue(mp.contains("name=\"gpx\""), mp); + assertTrue(mp.contains(""), mp); + } + + @Test + void fsyncLsPullPush() { + try (IosClient c = client()) { + FsyncListing ls = c.device("UDID-A").fsync().ls("/Documents", "com.x"); + assertEquals(2, ls.getCount()); + assertTrue(lastQuery.get("fsync/ls").contains("bundleID=com.x"), lastQuery.get("fsync/ls")); + assertTrue(lastQuery.get("fsync/ls").contains("path=%2FDocuments"), lastQuery.get("fsync/ls")); + + byte[] pulled = c.device("UDID-A").fsync().pull("/Documents/a.txt", null); + assertEquals("afc-bytes", new String(pulled, StandardCharsets.UTF_8)); + + FsyncPushResult push = c.device("UDID-A").fsync() + .push("/Documents/x.bin", "data".getBytes(StandardCharsets.UTF_8), null); + assertEquals(4L, push.getSize()); + assertEquals("POST", lastMethod.get("fsync/push")); + assertEquals("application/octet-stream", lastContentType.get("fsync/push")); + assertArrayEquals("data".getBytes(StandardCharsets.UTF_8), lastBody.get("fsync/push")); + } + } + + @Test + void webInspectorEvalSendsScript() { + try (IosClient c = client()) { + WebInspectorEvalResult r = c.device("UDID-A").webinspector().eval("1+1", "1", null); + assertEquals("1", r.getPage()); + assertEquals(42, ((Number) r.getResult()).intValue()); + } + String body = new String(lastBody.get("webinspector/eval"), StandardCharsets.UTF_8); + assertTrue(body.contains("\"script\":\"1+1\""), body); + } + + @Test + void uiTapSendsJsonBodyAndBackendQuery() { + try (IosClient c = client()) { + c.device("UDID-A").ui().tap(10, 20, new Ui.Options("devicekit", null, 30)); + } + String q = lastQuery.get("ui/tap"); + assertTrue(q.contains("backend=devicekit"), q); + assertTrue(q.contains("timeout=30"), q); + String body = new String(lastBody.get("ui/tap"), StandardCharsets.UTF_8); + assertTrue(body.contains("\"x\":10"), body); + assertTrue(body.contains("\"y\":20"), body); + } + + @Test + void uiScreenshotReturnsPngBytes() { + try (IosClient c = client()) { + byte[] png = c.device("UDID-A").ui().screenshot(); + assertEquals((byte) 0x89, png[0]); + assertEquals('P', png[1]); + } + } + + @Test + void hostSignPrepareGroups() { + try (IosClient c = client()) { + PrepareSkipOptions opts = c.prepare().skipOptions(); + assertEquals(2, opts.getCount()); + assertEquals(List.of("Passcode", "Siri"), opts.getOptions()); + + SupervisionCert cert = c.prepare().createCert(); + assertTrue(cert.getCertPem().startsWith("-----BEGIN CERT")); + assertEquals("POST", lastMethod.get("create-cert")); + + byte[] p12 = c.sign().certificate( + "p8key".getBytes(StandardCharsets.UTF_8), "KEYID", "ISSUER", false, "pw"); + assertEquals(4, p12.length); + assertEquals(0x30, p12[0]); + assertTrue(lastContentType.get("sign/certificate").startsWith("multipart/form-data")); + String mp = new String(lastBody.get("sign/certificate"), StandardCharsets.UTF_8); + assertTrue(mp.contains("name=\"asc-private-key\""), mp); + assertTrue(mp.contains("name=\"asc-key-id\""), mp); + } + } + + @Test + void uiStreamReadsRawChunkedBytesAndCloses() throws IOException { + // The binary stream (x-stream: binary) is a plain InputStream of raw bytes, + // distinct from the typed SSE reader. + try (IosClient c = client()) { + BinaryStream stream = c.device("UDID-A").ui().stream(); + assertNotNull(stream.contentType()); + assertTrue(stream.contentType().startsWith("multipart/x-mixed-replace")); + byte[] all = stream.readAllBytes(); + String s = new String(all, StandardCharsets.UTF_8); + assertEquals("chunk-0;chunk-1;chunk-2;chunk-3;", s); + stream.close(); // idempotent, releases the connection + stream.close(); + } + } +} diff --git a/sdks/packages/java/src/test/java/com/github/danielpaulus/goios/stream/SseReaderTest.java b/sdks/packages/java/src/test/java/com/github/danielpaulus/goios/stream/SseReaderTest.java new file mode 100644 index 000000000..6ef9af739 --- /dev/null +++ b/sdks/packages/java/src/test/java/com/github/danielpaulus/goios/stream/SseReaderTest.java @@ -0,0 +1,185 @@ +package com.github.danielpaulus.goios.stream; + +import com.github.danielpaulus.goios.generated.model.SyslogMessage; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.NoSuchElementException; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; + +import static org.junit.jupiter.api.Assertions.*; + +/** Unit tests for the SSE frame parser over canned event-stream text. */ +class SseReaderTest { + + /** Split a canned event-stream body into lines the way ofLines() would. */ + private static Iterator lines(String body) { + // Note: no trailing empty element even if body ends with \n (matches BufferedReader/ofLines). + return Arrays.asList(body.split("\n", -1)).iterator(); + } + + private static List drain(SseReader reader) { + List out = new ArrayList<>(); + reader.forEachRemaining(out::add); + return out; + } + + @Test + void parsesMultipleFramesAndSkipsHeartbeatByDefault() { + String body = """ + event: syslog + data: {"message":"line one","timestamp":1723200000000} + + event: heartbeat + data: {} + + event: syslog + data: {"message":"line two"} + + """; + try (SseReader r = new SseReader(lines(body), EventDecoder.SYSLOG, false, null)) { + List events = drain(r); + assertEquals(2, events.size(), "heartbeat should be skipped"); + assertInstanceOf(SyslogEvent.class, events.get(0)); + assertEquals("line one", ((SyslogEvent) events.get(0)).payload().getMessage()); + assertEquals("line two", ((SyslogEvent) events.get(1)).payload().getMessage()); + } + } + + @Test + void includesHeartbeatWhenRequested() { + String body = "event: heartbeat\ndata: {}\n\nevent: syslog\ndata: {\"message\":\"x\"}\n\n"; + try (SseReader r = new SseReader(lines(body), EventDecoder.SYSLOG, true, null)) { + List events = drain(r); + assertEquals(2, events.size()); + assertInstanceOf(HeartbeatEvent.class, events.get(0)); + assertEquals("heartbeat", events.get(0).eventName()); + assertInstanceOf(SyslogEvent.class, events.get(1)); + } + } + + @Test + void multiLineDataFramesAreJoinedWithNewline() { + // Two data: lines in one frame -> joined by \n into valid JSON. + String body = "event: syslog\ndata: {\"message\":\ndata: \"multi\"}\n\n"; + try (SseReader r = new SseReader(lines(body), EventDecoder.SYSLOG, false, null)) { + List events = drain(r); + assertEquals(1, events.size()); + assertEquals("multi", ((SyslogEvent) events.get(0)).payload().getMessage()); + } + } + + @Test + void commentLinesAreIgnored() { + String body = ": this is a keep-alive comment\nevent: syslog\ndata: {\"message\":\"ok\"}\n\n"; + try (SseReader r = new SseReader(lines(body), EventDecoder.SYSLOG, false, null)) { + List events = drain(r); + assertEquals(1, events.size()); + assertEquals("ok", ((SyslogEvent) events.get(0)).payload().getMessage()); + } + } + + @Test + void unknownEventIsSurfacedNotDropped() { + String body = "event: brandnew\ndata: {\"foo\":42}\n\nevent: syslog\ndata: {\"message\":\"y\"}\n\n"; + try (SseReader r = new SseReader(lines(body), EventDecoder.SYSLOG, false, null)) { + List events = drain(r); + assertEquals(2, events.size()); + assertInstanceOf(UnknownEvent.class, events.get(0)); + UnknownEvent u = (UnknownEvent) events.get(0); + assertEquals("brandnew", u.eventName()); + assertEquals("{\"foo\":42}", u.rawData()); + } + } + + @Test + void trailingFrameWithoutBlankLineIsDispatchedAtEndOfStream() { + String body = "event: syslog\ndata: {\"message\":\"last\"}"; // no terminating blank line + try (SseReader r = new SseReader(lines(body), EventDecoder.SYSLOG, false, null)) { + List events = drain(r); + assertEquals(1, events.size()); + assertEquals("last", ((SyslogEvent) events.get(0)).payload().getMessage()); + } + } + + @Test + void closeInvokesHookAndStopsIteration() { + AtomicBoolean closed = new AtomicBoolean(false); + String body = "event: syslog\ndata: {\"message\":\"a\"}\n\nevent: syslog\ndata: {\"message\":\"b\"}\n\n"; + SseReader r = new SseReader(lines(body), EventDecoder.SYSLOG, false, () -> closed.set(true)); + assertTrue(r.hasNext()); + assertEquals("a", ((SyslogEvent) r.next()).payload().getMessage()); + r.close(); + assertTrue(closed.get(), "onClose hook should run"); + assertFalse(r.hasNext(), "closed reader yields no more events"); + assertThrows(NoSuchElementException.class, r::next); + } + + @Test + void closeIsIdempotent() { + int[] count = {0}; + SseReader r = new SseReader(lines(""), EventDecoder.SYSLOG, false, () -> count[0]++); + r.close(); + r.close(); + assertEquals(1, count[0], "onClose runs exactly once"); + } + + @Test + void cancelFromAnotherThreadUnblocksABlockingSource() throws Exception { + // A line source that blocks on hasNext() until the reader is closed, + // simulating a live-but-idle SSE connection being cancelled. + CountDownLatch blocking = new CountDownLatch(1); + AtomicBoolean aborted = new AtomicBoolean(false); + Iterator blockingLines = new Iterator<>() { + @Override + public boolean hasNext() { + blocking.countDown(); + try { + // Block until interrupted by close()'s abort semantics. + Thread.sleep(60_000); + } catch (InterruptedException e) { + aborted.set(true); + Thread.currentThread().interrupt(); + throw new RuntimeException("aborted", e); + } + return false; + } + + @Override + public String next() { + throw new NoSuchElementException(); + } + }; + + SseReader r = new SseReader(blockingLines, EventDecoder.SYSLOG, false, () -> { }); + Thread consumer = new Thread(() -> { + // hasNext() blocks in the source until interrupted. + boolean has = r.hasNext(); + assertFalse(has, "after abort, hasNext returns false"); + }); + consumer.start(); + assertTrue(blocking.await(2, TimeUnit.SECONDS), "consumer reached the blocking source"); + r.close(); + consumer.interrupt(); // mimic transport abort waking the blocked read + consumer.join(5_000); + assertFalse(consumer.isAlive(), "consumer thread should finish after close+interrupt"); + } + + @Test + void decodesEachEndpointPayloadType() { + assertInstanceOf(AppStateEvent.class, + EventDecoder.NOTIFICATIONS.apply("appstate", + "{\"bundleId\":\"com.apple.Preferences\",\"state\":\"foreground\",\"timestamp\":1}")); + assertInstanceOf(OsTraceEvent.class, + EventDecoder.OSTRACE.apply("ostrace", "{\"message\":\"m\",\"pid\":1}")); + assertInstanceOf(AttachDetachEvent.class, + EventDecoder.LISTEN.apply("attachdetach", "{\"event\":\"attached\",\"deviceID\":5}")); + SyslogMessage sm = ((SyslogEvent) EventDecoder.SYSLOG.apply("syslog", "{\"message\":\"hi\"}")).payload(); + assertEquals("hi", sm.getMessage()); + } +} diff --git a/sdks/packages/mcp/README.md b/sdks/packages/mcp/README.md new file mode 100644 index 000000000..8e8a1c734 --- /dev/null +++ b/sdks/packages/mcp/README.md @@ -0,0 +1,288 @@ +# @go-ios/mcp + +A **Model Context Protocol (MCP) server for [go-ios](https://github.com/danielpaulus/go-ios)**. +It lets autonomous agents (Claude Desktop, IDE agents, custom MCP clients) **control iOS +devices** by proxying the go-ios REST daemon behind a small, high-signal set of tools. + +It is **not** a naive 1:1 OpenAPI→tool mapping (which produces too many low-quality tools for +LLMs). Instead it exposes a hand-curated tool set with LLM-oriented descriptions, typed input +schemas (zod), structured output, and explicit error surfacing (device-not-found, auth failures). + +Beyond observing a device, agents can now **drive** it: the `ui_*` tools tap, swipe, type, and +read the view hierarchy through WebDriverAgent (see [UI automation](#ui-automation-drive-the-device)). + +Published on npm as [`@go-ios/mcp`](https://www.npmjs.com/package/@go-ios/mcp) (public). + +## Requirements + +- Node.js 20+ +- A running **go-ios REST daemon** (`ios rest ...`) reachable over HTTP. This server talks to + that daemon; it does not talk to devices directly. + +## Tools + +Every device-scoped tool takes a `udid` — get it from `list_devices` first. The set is +curated (not a 1:1 map of the daemon's ~125 endpoints); see +[Deliberately omitted](#deliberately-omitted-tools) for what is left out and why. + +### Discovery & info + +| Tool | What it does | +| --- | --- | +| `list_devices` | List connected/reachable devices (udid, connection type, address). Start here. | +| `device_info` | Lockdown + hardware/network/instruments info for a udid (open dictionary). | +| `device_health` | Quick reachability check + compact identity summary + battery snapshot; fails fast if offline. | + +### Apps + +| Tool | What it does | +| --- | --- | +| `list_apps` | Installed apps (bundle id, name, version). | +| `launch_app` | Launch an app by `bundleId`. | +| `terminate_app` | Kill a running app by `bundleId`. | +| `install_app` | Install from a local `.ipa`/`.app` path (uploaded as multipart, ≤200 MB). | +| `uninstall_app` | Uninstall an app by `bundleId`. | + +### Screen & logs + +| Tool | What it does | +| --- | --- | +| `screenshot` | Capture the screen; returns a PNG **image content block** (base64). | +| `stream_logs` | **Bounded** capture of syslog / os_log; returns a finite recent buffer (see below). | + +### Diagnostics & health + +| Tool | What it does | +| --- | --- | +| `device_battery` | Battery snapshot: charge level, charging/plugged-in, temperature. | +| `list_processes` | Running processes (pid, name, is-application); `apps_only` to filter. | +| `device_diagnostics` | Low-level IORegistry/diagnostic values (open map). | +| `device_diskspace` | Filesystem usage over AFC: total / free / used bytes, block size. | +| `device_ip` | Resolve the device's MAC / IPv4 / IPv6 by sniffing pcapd (takes a few seconds). | + +### Crash logs + +| Tool | What it does | +| --- | --- | +| `list_crash_reports` | List crash report file names (optional glob `pattern`). | +| `pull_crash_report` | Read one report's text by `name`, **bounded to 256 KiB** (`truncated` flag). | + +### Files (read-only) + +| Tool | What it does | +| --- | --- | +| `list_files` | List a device directory in the `app`/`app-group`/`crash`/`temp` domain. **Listing only.** | +| `list_device_files` | List a directory over AFC (media dir, or an app container via `bundleId`). **Listing only.** | +| `read_file` | Read a device file over AFC as text, **bounded to 512 KiB** (`truncated` flag). | + +### Location + +| Tool | What it does | +| --- | --- | +| `set_location_gpx` | Simulate live location by replaying a local `.gpx` track (uploaded as multipart). | + +### Web debugging (WebInspector) + +| Tool | What it does | +| --- | --- | +| `list_webinspector_pages` | List inspectable pages (Safari tabs / WKWebViews). Requires Web Inspector enabled. | +| `webinspector_eval` | Evaluate JavaScript in an inspectable page and return the result. Powerful for web debugging. | + +### Performance + +| Tool | What it does | +| --- | --- | +| `sample_performance` | **Bounded** CPU-usage sampling (sysmontap); finite buffer (see below). | + +### Jobs (drive & observe long-running operations) + +| Tool | What it does | +| --- | --- | +| `run_wda` | Start the WebDriverAgent runner as a background **job**; returns the job id. | +| `list_jobs` | List a device's jobs (test runs, WDA runners, forwards) with status. | +| `get_job` | Get one job's status/result by `id` (poll for completion). | +| `stop_job` | Stop a running job, or purge a finished one, by `id`. | +| `tail_job_logs` | **Bounded** capture of a job's log output; finite buffer (see below). | + +### Pasteboard + +| Tool | What it does | +| --- | --- | +| `get_pasteboard` | Read the device clipboard text (`{ present, text }`). | +| `set_pasteboard` | Set the device clipboard text (useful for injecting text into an app). | + +### WebDriverAgent session lifecycle + +| Tool | What it does | +| --- | --- | +| `create_wda_session` | Start a WebDriverAgent (XCUITest) session (prereq for UI automation). | +| `read_wda_session` | Fetch a running WDA session by `sessionId`. | +| `delete_wda_session` | Stop a WDA session. | + +### UI automation (drive the device) + +These tools let an agent **act on** the device, not just observe it. They forward to a UI +backend — **WebDriverAgent** (default) or **DeviceKit** — that must already be **running and +port-forwarded**. + +| Tool | What it does | +| --- | --- | +| `ui_tap` | Tap at absolute screen coordinates `(x, y)`. | +| `ui_swipe` | Drag from `(x1, y1)` to `(x2, y2)` (scroll / swipe); optional `duration`. | +| `ui_type` | Type text into the focused field (tap it first). | +| `ui_press_button` | Press a hardware button by name (`home`; devicekit also volume). | +| `ui_source` | Return the view hierarchy (XML for WDA) — find element frames to tap. **Bounded to 512 KiB.** | +| `ui_screenshot` | Single screen frame **via the UI backend** (distinct from `screenshot`); PNG image block. | +| `ui_app_launch` | Launch an app by `bundleId` through the UI backend (attaches for automation). | +| `ui_app_terminate` | Terminate an app by `bundleId` through the UI backend. | + +**Prerequisite — a forwarded WDA backend.** The UI tools need WebDriverAgent up and reachable: + +1. Start the runner: **`run_wda`** (or `create_wda_session`). +2. Forward WDA's device port to a local port (e.g. `8100`) via the go-ios CLI/daemon. +3. Call the `ui_*` tools with **`wdaUrl`** set to that forwarded URL (e.g. `http://localhost:8100`); + optionally set `backend` (`wda` | `devicekit`) and `timeout` (seconds). + +A typical loop: `ui_source` (or `ui_screenshot`) to see the screen → `ui_tap`/`ui_type`/`ui_swipe` +to act → screenshot again to verify. If a UI tool returns **502**, the backend isn't reachable — +recheck `run_wda`, the port forward, and `wdaUrl`. **501** means the chosen backend doesn't support +that action. There is deliberately **no** UI video-stream tool — `ui_screenshot` captures a single +frame instead (large binary streams don't fit a tool response). + +### Device management (disruptive) + +| Tool | What it does | +| --- | --- | +| `reboot_device` | **DISRUPTIVE** — reboot the device (goes offline ~30–60s; kills apps/sessions/jobs). | +| `shutdown_device` | **DISRUPTIVE** — power off the device (needs physical interaction to boot again). | + +### Deliberately omitted tools + +Some daemon endpoints are intentionally **not** exposed as tools: + +- **`erase`** (`POST /device/{udid}/erase`) — factory-wipes the device. Too destructive and + irreversible to hand an autonomous agent; omitted on purpose. +- **`sign/*`** (`sign/app`, `sign/certificate`, `sign/provision`) and **`prepare`** — host-local, + secret-handling (certificates, provisioning) supervision flows. Not agent-appropriate; left to + the `ios` CLI / a human operator. +- **Raw binary streams** — `pcap` (packet capture), `screenshot/stream` and `ui/stream` (video) + produce open-ended binary that doesn't fit a tool response. For screen capture, use the + single-frame `screenshot` / `ui_screenshot`; for logs/CPU, use the **bounded** `stream_logs` / + `sample_performance` / `tail_job_logs` capture pattern. +- **Raw file writes** (`files/push`, `fsync/push`, `fsync/rm`, `fsync/mkdir`, `crashes` delete) — + the read-only `list_files` / `list_device_files` / `read_file` / `pull_crash_report` cover the + safe, bounded read paths an agent needs. Writes/deletes to on-device paths are omitted to avoid + corrupting app state. +- **Supervised/MDM & system-config endpoints** (profiles, wifi, http-proxy, language, time + format, wallpaper, dev-mode, conditions, pairing, tunnels, image mount, MDM + clear-passcode, …) — low agent value and easy to leave a device in a bad state; left to the + `ios` CLI. + +### Bounded captures are not infinite streams + +Several go-ios endpoints are Server-Sent Event streams that run forever (`/syslog`, +`/ostrace`, `/sysmontap`, `/jobs/{id}/logs`). An agent tool call is request/response, so the +tools that consume them — **`stream_logs`**, **`sample_performance`**, and **`tail_job_logs`** — +collect events for a **bounded window** and then return them. They share one bounded-capture +implementation: + +- The SSE stream is read until the **first** limit is hit: a `duration_seconds` cap or a + line/sample count cap. Per-tool caps: + - `stream_logs`: `duration_seconds` (default 5, **max 30**), `max_lines` (default 100, **max 1000**). + - `sample_performance`: `duration_seconds` (default 5, **max 30**), `max_samples` (default 30, **max 300**). + - `tail_job_logs`: `duration_seconds` (default 5, **max 30**), `max_lines` (default 200, **max 2000**). +- The underlying HTTP request is then aborted, so the call always returns promptly even if the + device keeps emitting. +- `heartbeat` frames are dropped from the result but counted (`heartbeats`) so a live-but-idle + stream is distinguishable from a dead one. +- Each result reports `stoppedBy` (`duration` | `maxLines` | `streamEnd`), `returned`, + `totalMatched`, and the captured `lines`/`samples`. + +`stream_logs` additionally supports `source: "ostrace"` with AND-combined filters (`pid`, +`level`, `subsystem`, `match`, `exclude`, plus a client-side `process` filter); `source: +"syslog"` returns raw lines. + +## Configuration (environment) + +| Variable | Default | Meaning | +| --- | --- | --- | +| `GO_IOS_BASE_URL` | `http://localhost:8080` | go-ios daemon base URL. | +| `GO_IOS_API_KEY` | *(none)* | Bearer token; sent as `Authorization: Bearer …` when set. | +| `GO_IOS_MCP_TRANSPORT` | `stdio` | `stdio` or `http`. | +| `GO_IOS_MCP_HTTP_PORT` | `3000` | Port for the HTTP transport. | +| `GO_IOS_MCP_HTTP_HOST` | `127.0.0.1` | Host/interface for the HTTP transport. | + +CLI flags override env: `--stdio` / `--http`, `--port `, `--host `, `--base-url `. + +## Running + +### stdio (default — local agent clients) + +```bash +GO_IOS_BASE_URL=http://localhost:8080 \ +GO_IOS_API_KEY=your-token \ +npx @go-ios/mcp +``` + +### Streamable HTTP (remote clients) + +```bash +GO_IOS_BASE_URL=http://localhost:8080 \ +GO_IOS_API_KEY=your-token \ +npx @go-ios/mcp --http --port 3000 +``` + +The MCP endpoint is served at `POST /mcp` (Streamable HTTP; SSE is the response-streaming mode +within it, per the current MCP spec). + +## MCP client config + +### Claude Desktop (`claude_desktop_config.json`) + +```json +{ + "mcpServers": { + "go-ios": { + "command": "npx", + "args": ["-y", "@go-ios/mcp"], + "env": { + "GO_IOS_BASE_URL": "http://localhost:8080", + "GO_IOS_API_KEY": "your-token" + } + } + } +} +``` + +### Generic MCP client (HTTP) + +Point the client at `http://127.0.0.1:3000/mcp` after starting the server with `--http`. + +## Examples + +See [`examples/`](examples/) for runnable examples that double as docs and as a +pre-release smoke test: + +- **Client configs** ([`examples/client-config/`](examples/client-config/)) — + paste-ready and annotated configs for Claude Desktop and a generic MCP client. +- **`list-tools`** — spawns this server over stdio and lists every tool + (no device/daemon needed). +- **`call-tool`** — calls `list_devices` against a running daemon (SKIPs if none). +- **`npm run examples`** — runs `list-tools` (asserts the full curated tool set) + and, when `GO_IOS_API_KEY` is set + the daemon is reachable, `call-tool`. A + mostly-device-free MCP smoke test. + +## Development + +```bash +npm install +npm run build # tsup -> dist/ (ESM, with shebang + bin entry) +npm test # vitest +npm run typecheck # tsc --noEmit +``` + +## Publishing + +This package is **public and publishable** on npm as `@go-ios/mcp` (`publishConfig.access: +"public"`, provenance-friendly). It ships as part of the go-ios SDK release +(`.github/workflows/release-sdks.yml`) via npm OIDC trusted publishing — no auth token. diff --git a/sdks/packages/mcp/examples/README.md b/sdks/packages/mcp/examples/README.md new file mode 100644 index 000000000..de5a82787 --- /dev/null +++ b/sdks/packages/mcp/examples/README.md @@ -0,0 +1,89 @@ +# @go-ios/mcp examples + +These examples double as **docs** and as a **pre-release smoke test** for the +go-ios MCP server. They live next to the package so `npm run examples` verifies +the built server before it ships. + +The MCP server does **not** talk to devices directly — it proxies a running +**go-ios REST daemon** (started with `ios rest ...`). Listing tools needs +neither a device nor a daemon; calling a tool does. + +## Contents + +| Path | What it is | +| --- | --- | +| [`client-config/`](client-config/) | Ready-to-paste MCP client configs (Claude Desktop + a generic client), heavily commented. | +| [`list-tools.ts`](list-tools.ts) | Spawns the server over **stdio**, initializes an MCP client, calls `tools/list`, and prints every tool. **No device/daemon needed** — pure introspection. | +| [`call-tool.ts`](call-tool.ts) | Spawns the server and calls `list_devices` for real. **Needs a running daemon**; SKIPs cleanly if it can't reach one. | +| [`run-all.ts`](run-all.ts) | The `npm run examples` runner: always runs `list-tools` (asserts the exact curated tool set), runs `call-tool` only when `GO_IOS_API_KEY` is set + daemon reachable. | + +## Running the MCP server + +The examples spawn the server for you, but you can also run it directly. + +### stdio (default — local agent clients) + +```bash +GO_IOS_BASE_URL=http://localhost:8080 \ +GO_IOS_API_KEY=your-token \ +npx -y @go-ios/mcp +``` + +### Streamable HTTP (remote clients) + +```bash +GO_IOS_BASE_URL=http://localhost:8080 \ +GO_IOS_API_KEY=your-token \ +npx -y @go-ios/mcp --http --port 3000 +``` + +The MCP endpoint is then served at `POST http://127.0.0.1:3000/mcp`. + +## Client configs + +See [`client-config/`](client-config/): + +- **`claude-desktop.json`** — paste-ready. Merge the `mcpServers.go-ios` entry + into your real `claude_desktop_config.json` (strict JSON, no comments), set + `GO_IOS_BASE_URL` / `GO_IOS_API_KEY`, then fully restart Claude Desktop. + Config file locations: + - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json` + - Windows: `%APPDATA%\Claude\claude_desktop_config.json` +- **`claude-desktop.jsonc`** — the same config, annotated with comments + explaining every field (docs only; don't paste comments into the real file). +- **`generic-mcp-client.jsonc`** — annotated stdio **and** Streamable-HTTP blocks + for any other MCP client; adapt the field names to your client's schema. + +## The smoke test: `npm run examples` + +From `sdks/packages/mcp/`: + +```bash +npm install +npm run examples # builds, then runs the examples runner +``` + +What it does: + +1. **`list-tools` (always).** Spawns the freshly-built server over stdio, + initializes an MCP client, and lists the tools. It **asserts the exact + curated tool set** (currently 44 tools) is present and that every tool has a + description. If the server won't start or the set is wrong, the runner exits + non-zero — making this a genuine, device-free pre-release check. +2. **`call-tool` (conditional).** Only runs when `GO_IOS_API_KEY` is set **and** + the daemon at `GO_IOS_BASE_URL` (default `http://localhost:8080`) is + reachable. It calls `list_devices` end to end and prints the devices. + Otherwise it **SKIPs** (still exit 0). + +Run individual examples directly (after `npm run build`): + +```bash +npx tsx examples/list-tools.ts +GO_IOS_API_KEY=your-token npx tsx examples/call-tool.ts +``` + +Typecheck the examples: + +```bash +npx tsc --noEmit -p examples/tsconfig.json +``` diff --git a/sdks/packages/mcp/examples/call-tool.ts b/sdks/packages/mcp/examples/call-tool.ts new file mode 100644 index 000000000..cdeb26551 --- /dev/null +++ b/sdks/packages/mcp/examples/call-tool.ts @@ -0,0 +1,99 @@ +/** + * call-tool — spawn the go-ios MCP server over stdio and actually CALL a tool + * (`list_devices`) end to end, printing the result. + * + * Unlike list-tools (pure introspection), this exercises the full path through + * the server to the go-ios REST daemon, so it needs a RUNNING daemon reachable + * at GO_IOS_BASE_URL (default http://localhost:8080), started with + * `ios rest ...`, plus GO_IOS_API_KEY if the daemon requires auth. + * + * If the daemon is not reachable, this exits 0 with a clear SKIP message rather + * than failing — it's an optional, device/daemon-dependent example. + * + * Run it with: npm run build && GO_IOS_API_KEY=... npx tsx examples/call-tool.ts + */ +import { Client } from "@modelcontextprotocol/sdk/client/index.js"; +import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js"; +import { existsSync } from "node:fs"; +import { SERVER_ENTRY } from "./list-tools.js"; + +const BASE_URL = (process.env.GO_IOS_BASE_URL ?? "http://localhost:8080").replace(/\/+$/, ""); +const API_KEY = process.env.GO_IOS_API_KEY; + +/** Quick pre-flight: is the go-ios daemon answering at all? */ +async function daemonReachable(): Promise { + try { + const headers: Record = {}; + if (API_KEY) headers.Authorization = `Bearer ${API_KEY}`; + // /api/v1/list is the device-list endpoint; any HTTP answer means "up". + const res = await fetch(`${BASE_URL}/api/v1/list`, { + headers, + signal: AbortSignal.timeout(2000), + }); + return res.status < 500 || res.status === 401; // reachable even if auth-gated + } catch { + return false; + } +} + +async function main(): Promise { + if (!existsSync(SERVER_ENTRY)) { + console.error(`Server bundle not found at ${SERVER_ENTRY}. Run \`npm run build\` first.`); + return 1; + } + + if (!(await daemonReachable())) { + console.log( + `SKIP call-tool: no go-ios daemon reachable at ${BASE_URL}.\n` + + ` Start one with \`ios rest --address 0.0.0.0 --port 8080 ...\`, set\n` + + ` GO_IOS_BASE_URL / GO_IOS_API_KEY, and re-run to exercise list_devices.`, + ); + return 0; + } + + // Spawn the server, forwarding the daemon connection env so the tool call works. + const transport = new StdioClientTransport({ + command: process.execPath, + args: [SERVER_ENTRY, "--stdio"], + env: { + ...(process.env as Record), + GO_IOS_BASE_URL: BASE_URL, + ...(API_KEY ? { GO_IOS_API_KEY: API_KEY } : {}), + }, + stderr: "ignore", + }); + + const client = new Client({ name: "go-ios-mcp-examples", version: "0.1.0" }); + await client.connect(transport); + try { + console.log(`Calling list_devices against ${BASE_URL} ...\n`); + const res = await client.callTool({ name: "list_devices", arguments: {} }); + + if (res.isError) { + const text = (res.content as Array<{ text?: string }>)[0]?.text ?? "unknown error"; + console.error(`list_devices returned an error: ${text}`); + return 1; + } + + const sc = res.structuredContent as + | { count: number; devices: Array> } + | undefined; + if (sc) { + console.log(`Found ${sc.count} device(s):`); + console.log(JSON.stringify(sc.devices, null, 2)); + } else { + // Fall back to the text content block. + console.log((res.content as Array<{ text?: string }>)[0]?.text ?? "(no content)"); + } + return 0; + } finally { + await client.close(); + } +} + +main() + .then((code) => process.exit(code)) + .catch((err) => { + console.error(`call-tool failed: ${err instanceof Error ? err.message : String(err)}`); + process.exit(1); + }); diff --git a/sdks/packages/mcp/examples/client-config/claude-desktop.json b/sdks/packages/mcp/examples/client-config/claude-desktop.json new file mode 100644 index 000000000..76148f6d1 --- /dev/null +++ b/sdks/packages/mcp/examples/client-config/claude-desktop.json @@ -0,0 +1,12 @@ +{ + "mcpServers": { + "go-ios": { + "command": "npx", + "args": ["-y", "@go-ios/mcp"], + "env": { + "GO_IOS_BASE_URL": "http://localhost:8080", + "GO_IOS_API_KEY": "your-token" + } + } + } +} diff --git a/sdks/packages/mcp/examples/client-config/claude-desktop.jsonc b/sdks/packages/mcp/examples/client-config/claude-desktop.jsonc new file mode 100644 index 000000000..4ba8d48ac --- /dev/null +++ b/sdks/packages/mcp/examples/client-config/claude-desktop.jsonc @@ -0,0 +1,40 @@ +// Annotated Claude Desktop config for the go-ios MCP server. +// +// This .jsonc file is DOCS ONLY — it has comments so every field is explained. +// Claude Desktop's config file (claude_desktop_config.json) is STRICT JSON and +// does NOT allow comments, so copy the sibling `claude-desktop.json` (no +// comments) into your real config instead of this file. +// +// Where the real file lives: +// macOS ~/Library/Application Support/Claude/claude_desktop_config.json +// Windows %APPDATA%\Claude\claude_desktop_config.json +// +// After editing it, fully quit and reopen Claude Desktop so it re-reads config. +{ + // Registry of MCP servers Claude Desktop should launch. Merge the "go-ios" + // entry into any existing "mcpServers" object — don't drop your other servers. + "mcpServers": { + // "go-ios" is the label shown in the client; rename it freely. + "go-ios": { + // The server is published to npm as @go-ios/mcp and exposes a bin, so the + // client just runs it with npx. `-y` skips the npx install prompt; the + // package is fetched/cached on first run. It speaks MCP over stdio, which + // is exactly what Claude Desktop expects for a `command` server. + "command": "npx", + "args": ["-y", "@go-ios/mcp"], + + // Environment for the spawned server process. The MCP server does NOT talk + // to devices directly — it proxies a running go-ios REST daemon, which you + // start separately with `ios rest ...`. + "env": { + // Base URL of your go-ios REST daemon. Default is http://localhost:8080. + "GO_IOS_BASE_URL": "http://localhost:8080", + + // Bearer token for the daemon, sent as `Authorization: Bearer `. + // Match whatever the daemon was started with. If you ran the daemon with + // auth disabled, you can drop this line entirely. + "GO_IOS_API_KEY": "your-token" + } + } + } +} diff --git a/sdks/packages/mcp/examples/client-config/generic-mcp-client.jsonc b/sdks/packages/mcp/examples/client-config/generic-mcp-client.jsonc new file mode 100644 index 000000000..014f73dcd --- /dev/null +++ b/sdks/packages/mcp/examples/client-config/generic-mcp-client.jsonc @@ -0,0 +1,41 @@ +// Generic MCP client config for the go-ios MCP server. +// +// This is DOCS ONLY (.jsonc, with comments). Different MCP clients use slightly +// different config shapes/filenames, but almost all of them support one of the +// two transports this server speaks: stdio (spawn a command) or Streamable HTTP +// (connect to a URL). Copy whichever block your client understands into its own +// config, stripping comments if the client requires strict JSON. +// +// The go-ios MCP server proxies a running go-ios REST daemon (`ios rest ...`) — +// start that daemon first; the two env vars below point the server at it. +{ + "mcpServers": { + // ---- Option A: stdio (local) ----------------------------------------- + // The client launches the server as a subprocess and speaks MCP over its + // stdin/stdout. This is the default transport and needs no open port. + "go-ios-stdio": { + "command": "npx", + "args": ["-y", "@go-ios/mcp"], + "env": { + "GO_IOS_BASE_URL": "http://localhost:8080", + "GO_IOS_API_KEY": "your-token" + } + }, + + // ---- Option B: Streamable HTTP (remote) ------------------------------ + // Run the server yourself as a long-lived HTTP process: + // + // GO_IOS_BASE_URL=http://localhost:8080 \ + // GO_IOS_API_KEY=your-token \ + // npx -y @go-ios/mcp --http --port 3000 + // + // then point an HTTP-capable MCP client at the /mcp endpoint below. Use this + // when the client and the server run on different machines. (Field names for + // an HTTP server vary by client — some use "url", some "type": "http"; adapt + // to your client's schema.) + "go-ios-http": { + "type": "http", + "url": "http://127.0.0.1:3000/mcp" + } + } +} diff --git a/sdks/packages/mcp/examples/list-tools.ts b/sdks/packages/mcp/examples/list-tools.ts new file mode 100644 index 000000000..a00bf364f --- /dev/null +++ b/sdks/packages/mcp/examples/list-tools.ts @@ -0,0 +1,87 @@ +/** + * list-tools — spawn the go-ios MCP server over stdio, initialize an MCP + * client against it, call `tools/list`, and print every tool's name and + * description. + * + * This is the always-runnable pre-release smoke test: it introspects the server + * and needs NO device and NO running go-ios daemon (it never calls a tool, it + * only lists them). If it prints the curated tool set and exits 0, the server + * builds, starts, and exposes its tools correctly. + * + * Run it with: npm run build && npx tsx examples/list-tools.ts + * (or via the runner: npm run examples) + */ +import { Client } from "@modelcontextprotocol/sdk/client/index.js"; +import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js"; +import { fileURLToPath } from "node:url"; +import { dirname, resolve } from "node:path"; +import { existsSync } from "node:fs"; + +const here = dirname(fileURLToPath(import.meta.url)); +/** The built server entry point (produced by `npm run build`). */ +export const SERVER_ENTRY = resolve(here, "..", "dist", "index.js"); + +export interface ListedTool { + name: string; + description: string; +} + +/** + * Spawn the built MCP server over stdio, initialize, and return its tool list. + * The caller owns nothing — the child process is started and torn down here. + */ +export async function listTools(): Promise { + if (!existsSync(SERVER_ENTRY)) { + throw new Error( + `Server bundle not found at ${SERVER_ENTRY}. Run \`npm run build\` first.`, + ); + } + + // Spawn the server exactly as an MCP client would: `node dist/index.js` over + // stdio. No GO_IOS_* env is needed — listing tools never touches the daemon. + const transport = new StdioClientTransport({ + command: process.execPath, // the current node binary + args: [SERVER_ENTRY, "--stdio"], + // Silence the server's startup line on our stderr for clean output. + stderr: "ignore", + }); + + const client = new Client({ name: "go-ios-mcp-examples", version: "0.1.0" }); + await client.connect(transport); // performs the MCP initialize handshake + try { + const { tools } = await client.listTools(); + return tools + .map((t) => ({ name: t.name, description: t.description ?? "" })) + .sort((a, b) => a.name.localeCompare(b.name)); + } finally { + await client.close(); + } +} + +/** Print the tool list as a readable, numbered catalog. */ +function printTools(tools: ListedTool[]): void { + console.log(`go-ios MCP server exposes ${tools.length} tools:\n`); + tools.forEach((t, i) => { + const n = String(i + 1).padStart(2, " "); + // Descriptions are long (LLM-oriented); show the first sentence for scanning. + const firstSentence = t.description.split(/(?<=\.)\s/)[0] ?? t.description; + console.log(`${n}. ${t.name}`); + console.log(` ${firstSentence}`); + }); +} + +// Run directly (not when imported by the runner). +const invokedDirectly = + process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url); + +if (invokedDirectly) { + listTools() + .then((tools) => { + printTools(tools); + process.exit(0); + }) + .catch((err) => { + console.error(`list-tools failed: ${err instanceof Error ? err.message : String(err)}`); + process.exit(1); + }); +} diff --git a/sdks/packages/mcp/examples/run-all.ts b/sdks/packages/mcp/examples/run-all.ts new file mode 100644 index 000000000..c5a5d97c9 --- /dev/null +++ b/sdks/packages/mcp/examples/run-all.ts @@ -0,0 +1,105 @@ +/** + * run-all — the go-ios MCP smoke test (npm run examples). + * + * 1. list-tools (ALWAYS): spawns the built server over stdio, lists its tools, + * and asserts the exact curated set is present. Needs no device/daemon. If + * the set is wrong or the server won't start, this exits non-zero. + * 2. call-tool (CONDITIONAL): only runs when GO_IOS_API_KEY is set AND the + * daemon is reachable; otherwise it SKIPs. Exercises list_devices for real. + * + * The result is a mostly-device-free MCP smoke test suitable for CI / a + * pre-release gate. + */ +import { spawn } from "node:child_process"; +import { fileURLToPath } from "node:url"; +import { dirname, resolve } from "node:path"; +import { listTools } from "./list-tools.js"; +import { CURATED_TOOL_NAMES } from "../src/tools.js"; + +const here = dirname(fileURLToPath(import.meta.url)); + +/** Spawn `tsx