diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..d134c19 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,13 @@ +FROM buildpack-deps:jammy-curl + +ARG TARGETARCH + +# common tools +RUN apt update && export DEBIAN_FRONTEND=noninteractive \ + && apt -y install --no-install-recommends apt-utils vim htop telnet socat expect-dev tini psmisc libgit2-dev + +# build tools +RUN apt update && export DEBIAN_FRONTEND=noninteractive \ + && apt -y install --no-install-recommends openjdk-11-jdk protobuf-compiler libprotobuf-dev + +CMD ["tail", "-f", "/dev/null"] \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..0a59235 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,56 @@ +{ + "name": "Daytona SDK", + "dockerFile": "Dockerfile", + // Configure tool-specific properties. + "customizations": { + // Configure properties specific to VS Code. + "vscode": { + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "dbaeumer.vscode-eslint", + "esbenp.prettier-vscode", + "astro-build.astro-vscode", + "unifiedjs.vscode-mdx", + "timonwong.shellcheck", + "foxundermoon.shell-format", + "cschlosser.doxdocgen" + ], + "settings": { + "editor.tabSize": 2 + } + } + }, + "features": { + "ghcr.io/devcontainers/features/common-utils:2.5.2": { + "installZsh": "true", + "username": "daytona", + "uid": "1000", + "gid": "1000", + "upgradePackages": "false" + }, + "ghcr.io/devcontainers/features/docker-in-docker:2.12.0": { + "version": "24.0.7", + "moby": false, + "dockerDashComposeVersion": "v2" + }, + "ghcr.io/devcontainers/features/go:1.3.1": { + "version": "1.19.3" + }, + "ghcr.io/devcontainers/features/node:1.6.1": { + "version": "20.12.2" + }, + "ghcr.io/devcontainers/features/python:1": { + "version": "3.10" + } + }, + // Add this to automatically source the venv in new terminals + "onCreateCommand": { + "install-deps": "git config --global --add safe.directory ${containerWorkspaceFolder} && yarn", + "copy-env": "cp -n .env .env.local" + }, + // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "daytona", + "remoteEnv": { + "PYTHONPATH": "${containerWorkspaceFolder}/packages/python/src:${containerEnv:PYTHONPATH}" + } +} \ No newline at end of file diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..68d0a9d --- /dev/null +++ b/.editorconfig @@ -0,0 +1,6 @@ +[*] +root = true +end_of_line = lf + +indent_size = 2 +indent_style = space diff --git a/.github/workflows/build-images.yaml b/.github/workflows/build-images.yaml new file mode 100644 index 0000000..0f7a2b7 --- /dev/null +++ b/.github/workflows/build-images.yaml @@ -0,0 +1,46 @@ +name: '[release] Build language images' + +on: + repository_dispatch: + types: [update-version, new-release] + workflow_dispatch: + inputs: + version: + description: 'Enter the version to release' + required: true + +concurrency: + # New commit on branch cancels running workflows of the same branch + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + VERSION: ${{ inputs.version || github.event.client_payload.release_tag }} + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + language: [typescript, python] + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: hack/workspace-images/${{ matrix.language}} + platforms: linux/amd64,linux/arm64 + push: true + tags: daytonaio/sdk-${{ matrix.language }}:${{ env.VERSION }} + build-args: | + "DAYTONA_VERSION=${{ env.VERSION }}" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..efc0f8d --- /dev/null +++ b/.gitignore @@ -0,0 +1,49 @@ +# Dependencies +node_modules +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json +yarn.lock + +# Build outputs +dist +build +.tmp + +# Environment variables +.env +.env.local +.env.* + +# IDE and Editor files +.idea/ +.vscode/ +*.swp +*.swo +.DS_Store + +# Testing +coverage/ + +# Logs +logs +*.log + +# Cache directories +.cache/ +.next/ +.nuxt/ +.gatsby/ + +# Temp directory +.tmp/ + +# Python virtual environment +.venv/ + +# Python package metadata +*.egg-info/ +*.egg +*.pyc +__pycache__/ diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..89a0a2b --- /dev/null +++ b/.prettierrc @@ -0,0 +1,5 @@ +{ + "singleQuote": true, + "trailingComma": "all", + "semi": false +} diff --git a/LICENCE b/LICENCE new file mode 100644 index 0000000..c44b766 --- /dev/null +++ b/LICENCE @@ -0,0 +1,43 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..26d42a7 --- /dev/null +++ b/Makefile @@ -0,0 +1,30 @@ +# Get version from root package.json +VERSION := $(shell node -p "require('./package.json').version") + +.PHONY: sync-version build-all publish-all clean + +# Sync versions across packages +sync-version: + @echo "Syncing version $(VERSION) across packages..." + @node -e "const p=require('./packages/typescript/package.json'); p.version='$(VERSION)'; require('fs').writeFileSync('./packages/typescript/package.json', JSON.stringify(p,null,2))" + @echo "Updated TypeScript package version to $(VERSION)" + @sed -i.bak 's/version = ".*"/version = "$(VERSION)"/' packages/python/pyproject.toml && rm packages/python/pyproject.toml.bak + @echo "Updated Python package version to $(VERSION)" + +# Clean build artifacts +clean: + @echo "Cleaning build artifacts..." + @rm -rf packages/typescript/dist + @rm -rf packages/python/dist packages/python/build packages/python/*.egg-info + +# Build both packages +build-all: clean sync-version + @echo "Building all packages..." + @cd packages/typescript && npm run build + @cd packages/python && python -m build + +# Publish both packages +publish-all: build-all + @echo "Publishing all packages..." + @cd packages/typescript && npm publish + @cd packages/python && python -m twine upload dist/* \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..9983bc8 --- /dev/null +++ b/README.md @@ -0,0 +1,135 @@ +# Daytona SDK + +Official Python and TypeScript SDKs for interacting with Daytona, providing simple interfaces for managing development environments programmatically. This repository contains both SDK libraries, offering native integration options for Python and TypeScript/JavaScript applications. + +## SDK Examples + +### TypeScript/JavaScript + +Install the SDK: + +```bash +npm install @daytona/sdk +# or +yarn add @daytona/sdk +``` + +Basic usage: + +```typescript +import { Daytona } from '@daytona/sdk' + +// Initialize the Daytona client +const daytona = new Daytona() + +// Create the workspace instance +const workspace = await daytona.create({ + language: 'typescript', +}) + +// Run the code securely inside the workspace +const response = await workspace.process.code_run('console.log("Hello World!")') +console.log(response.result) +``` + +### Python + +Install the SDK: + +```bash +pip install daytona-sdk +``` + +Basic usage: + +```python +from daytona_sdk import Daytona + +# Initialize the Daytona client +daytona = Daytona() + +# Create the workspace instance +workspace = daytona.create() + +# Run the code securely inside the workspace +response = workspace.process.code_run('print("Hello World!")') +print(response.result) +``` + +## About Daytona + +Daytona is a radically simple open source development environment manager that allows developers to spin up fully configured development environments with a single command. It eliminates the complexity of setting up development environments, whether they're local, remote, cloud-based, or on physical servers, supporting both x86 and ARM architectures. + +While Daytona offers a straightforward way to manage development environments, these SDKs bring that same power to your Python and TypeScript applications, enabling programmatic control over your development infrastructure. + +## Why Daytona SDK? + +These SDKs extend Daytona's capabilities by allowing you to: + +- Integrate Daytona's functionality into your existing Python and TypeScript applications +- Automate development environment creation and management +- Programmatically handle workspace configurations +- Manage Git operations and repository connections +- Control file system operations within workspaces +- Interface with language server protocols +- Build custom tooling and automation around your development environments +- Create isolated environments for running AI-generated code safely +- Set up data processing pipelines with configurable compute resources +- Deploy and test machine learning models in isolated environments + +## AI and Data Processing Use Cases + +Daytona SDKs excel in scenarios involving AI and data processing, offering flexible deployment options across multiple infrastructure providers and technologies: + +- **AI Code Execution**: Create isolated environments to safely run and test AI-generated code on your choice of infrastructure: + + - Deploy identical environments across AWS, GCP, Azure, or any major cloud provider + - Leverage Kubernetes clusters for scalability + - Quickly create ephemeral environments for parallel code generation trajectories + +- **Data Processing Pipelines**: Configure and manage environments for data processing workflows: + + - Choose optimal infrastructure based on data locality + - Enable distributed processing + - Scale across multiple cloud regions + - Support hybrid cloud deployments + +- **Resource Management**: Dynamically allocate compute resources based on workload requirements: + + - Provision resources across different cloud providers + - Scale container resources on demand + - Manage Kubernetes cluster resources + - Support bare metal resource allocation + +- **Environment Isolation**: Ensure security when running untrusted code or processing sensitive data: + - Configurable isolation level: Sysbox, LVMs, VMs + - Provision dedicated VMs for enhanced isolation + - Deploy in private cloud environments + - Utilize network isolation features + - Implement cloud-specific security controls + +## Contributing + +Contributions are welcome! Please feel free to submit a Pull Request. + +## License + +This project is licensed under the Apache License, Version 2.0 - see below for details: + +``` +Copyright 2024 Daytona + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +``` + +For the full license text, please see the [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0). diff --git a/examples/python/exec-command/main.py b/examples/python/exec-command/main.py new file mode 100644 index 0000000..9c09e73 --- /dev/null +++ b/examples/python/exec-command/main.py @@ -0,0 +1,14 @@ +from daytona_sdk import Daytona, CreateWorkspaceParams + +daytona = Daytona() + +params = CreateWorkspaceParams(language="python") +workspace = daytona.create() + +response = workspace.process.code_run('print("Sum of 3 and 4 is " + str(3 + 4))') +if response.code != 0: + print(f"Error: {response.code} {response.result}") +else: + print(response.result) + +daytona.remove(workspace) diff --git a/examples/python/file-operations/main.py b/examples/python/file-operations/main.py new file mode 100644 index 0000000..ce88595 --- /dev/null +++ b/examples/python/file-operations/main.py @@ -0,0 +1,55 @@ +import os +from daytona_sdk import Daytona + +daytona = Daytona() + +# First, create a workspace +workspace = daytona.create() + +# Get workspace root directory +root_dir = workspace.get_workspace_root_dir() + +# List files in the workspace +files = workspace.fs.list_files(root_dir) +print("Files:", files) + +# Create a new directory in the workspace +new_dir = os.path.join(root_dir, "new-dir") +workspace.fs.create_folder(new_dir, "755") + +file_path = os.path.join(new_dir, "data.txt") + +# Add a new file to the workspace +file_content = b"Hello, World!" +workspace.fs.upload_file(file_path, file_content) + +# Search for the file we just added +matches = workspace.fs.find_files(root_dir, "World!") +print("Matches:", matches) + +# Replace the contents of the file +workspace.fs.replace_in_files([file_path], "Hello, World!", "Goodbye, World!") + +# Read the file +downloaded_file = workspace.fs.download_file(file_path) +print("File content:", downloaded_file.decode("utf-8")) + +# Change the file permissions +workspace.fs.set_file_permissions(file_path, mode="777") + +# Get file info +file_info = workspace.fs.get_file_details(file_path) +print("File info:", file_info) # Should show the new permissions + +# Move the file to the new location +new_file_path = os.path.join(root_dir, "moved-data.txt") +workspace.fs.move_files(file_path, new_file_path) + +# Find the file in the new location +search_results = workspace.fs.search_files(root_dir, "moved-data.txt") +print("Search results:", search_results) + +# Delete the file +workspace.fs.delete_file(new_file_path) + +daytona.remove(workspace) diff --git a/examples/python/git-lsp/README.md b/examples/python/git-lsp/README.md new file mode 100644 index 0000000..0500469 --- /dev/null +++ b/examples/python/git-lsp/README.md @@ -0,0 +1,24 @@ +# Git LSP Example (Python) + +This example demonstrates how to use the Daytona SDK in Python to: +- Create a workspace +- Clone a Git repository +- Use the Language Server Protocol (LSP) to analyze and modify code +- Perform file operations + +## Prerequisites + +- Python 3.7 or higher +- Daytona SDK + +## Installation + +```bash +pip install -r requirements.txt +``` + +## Running the Example + +```bash +python src/main.py +``` \ No newline at end of file diff --git a/examples/python/git-lsp/main.py b/examples/python/git-lsp/main.py new file mode 100644 index 0000000..15af104 --- /dev/null +++ b/examples/python/git-lsp/main.py @@ -0,0 +1,55 @@ +from daytona_sdk import Daytona +import os + + +def main(): + daytona = Daytona() + + workspace = daytona.create() + + try: + root_dir = workspace.get_workspace_root_dir() + project_dir = os.path.join(root_dir, "learn-typescript") + + # Clone the repository + workspace.git.clone( + "https://github.com/panaverse/learn-typescript", project_dir, "master" + ) + + # Search for the file we want to work on + matches = workspace.fs.find_files(project_dir, "var obj1 = new Base();") + print("Matches:", matches) + + # Start the language server + lsp = workspace.create_lsp_server("typescript", project_dir) + lsp.start() + + # Notify the language server of the document we want to work on + lsp.did_open(matches[0].file) + + # Get symbols in the document + symbols = lsp.document_symbols(matches[0].file) + print("Symbols:", symbols) + + # Fix the error in the document + workspace.fs.replace_in_files( + [matches[0].file], "var obj1 = new Base();", "var obj1 = new E();" + ) + + # Notify the language server of the document change + lsp.did_close(matches[0].file) + lsp.did_open(matches[0].file) + + # Get completions at a specific position + completions = lsp.completions(matches[0].file, {"line": 12, "character": 18}) + print("Completions:", completions) + + except Exception as error: + print("Error creating workspace:", error) + finally: + # Cleanup + daytona.remove(workspace) + + +if __name__ == "__main__": + main() diff --git a/examples/python/git-lsp/requirements.txt b/examples/python/git-lsp/requirements.txt new file mode 100644 index 0000000..2f9a441 --- /dev/null +++ b/examples/python/git-lsp/requirements.txt @@ -0,0 +1 @@ +daytona-sdk \ No newline at end of file diff --git a/examples/typescript/exec-command/package.json b/examples/typescript/exec-command/package.json new file mode 100644 index 0000000..d44d9a8 --- /dev/null +++ b/examples/typescript/exec-command/package.json @@ -0,0 +1,9 @@ +{ + "private": true, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "dependencies": { + "@daytona/sdk": "*" + } +} diff --git a/examples/typescript/exec-command/src/index.ts b/examples/typescript/exec-command/src/index.ts new file mode 100644 index 0000000..5240e2b --- /dev/null +++ b/examples/typescript/exec-command/src/index.ts @@ -0,0 +1,29 @@ +import { Daytona } from '@daytona/sdk' + +async function main() { + const daytona = new Daytona() + + // first, create a workspace + const workspace = await daytona.create({ + language: 'python', + }) + + try { + // now, run some code + const result = await workspace.process.codeRun( + 'print("Hello World! " + str(3 + 4))', + ) + if (result.code !== 0) { + console.error('Error running code:', result.code) + } else { + console.log(result.result) + } + } catch (error) { + console.error('Error creating workspace:', error) + } finally { + // cleanup + await daytona.remove(workspace) + } +} + +main() diff --git a/examples/typescript/exec-command/tsconfig.json b/examples/typescript/exec-command/tsconfig.json new file mode 100644 index 0000000..5c4c88f --- /dev/null +++ b/examples/typescript/exec-command/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "target": "ES2020", + "module": "commonjs", + "lib": ["ES2020", "DOM"], + "declaration": true, + "outDir": "dist", + "rootDir": "src", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "moduleResolution": "node", + "resolveJsonModule": true, + "baseUrl": ".", + "paths": { + "@daytona/sdk": ["../../packages/ts/src"] + } + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist"] + } \ No newline at end of file diff --git a/examples/typescript/file-operations/package.json b/examples/typescript/file-operations/package.json new file mode 100644 index 0000000..d44d9a8 --- /dev/null +++ b/examples/typescript/file-operations/package.json @@ -0,0 +1,9 @@ +{ + "private": true, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "dependencies": { + "@daytona/sdk": "*" + } +} diff --git a/examples/typescript/file-operations/src/index.ts b/examples/typescript/file-operations/src/index.ts new file mode 100644 index 0000000..0413ffd --- /dev/null +++ b/examples/typescript/file-operations/src/index.ts @@ -0,0 +1,71 @@ +import * as path from 'path' +import { Daytona } from '@daytona/sdk' + +async function main() { + const daytona = new Daytona() + + // first, create a workspace + const workspace = await daytona.create() + + try { + const rootDir = await workspace.getWorkspaceRootDir() + + // list files in the workspace + const files = await workspace.fs.listFiles(rootDir) + console.log('Files:', files) + + // create a new directory in the workspace + const newDir = path.join(rootDir, 'new-dir') + await workspace.fs.createFolder(newDir, '755') + + const filePath = path.join(newDir, 'data.txt') + + // add a new file to the workspace + const fileContent = new Blob([Buffer.from('Hello, World!')], { + type: 'text/plain', + }) + await workspace.fs.uploadFile(filePath, fileContent) + + // search for the file we just added + const matches = await workspace.fs.findFiles(rootDir, 'World!') + console.log('Matches:', matches) + + // replace the contents of the file + await workspace.fs.replaceInFiles( + [filePath], + 'Hello, World!', + 'Goodbye, World!', + ) + + // read the file + const downloadedFile = await workspace.fs.downloadFile(filePath) + console.log('File content:', await downloadedFile.text()) + + // change the file permissions + await workspace.fs.setFilePermissions(filePath, { mode: '777' }) + + // get file info + const fileInfo = await workspace.fs.getFileDetails(filePath) + console.log('File info:', fileInfo) // should show the new permissions + + // move the file to the new location + await workspace.fs.moveFiles(filePath, path.join(rootDir, 'moved-data.txt')) + + // find the file in the new location + const searchResults = await workspace.fs.searchFiles( + rootDir, + 'moved-data.txt', + ) + console.log('Search results:', searchResults) + + // delete the file + await workspace.fs.deleteFile(path.join(rootDir, 'moved-data.txt')) + } catch (error) { + console.error('Error creating workspace:', error) + } finally { + // cleanup + await daytona.remove(workspace) + } +} + +main() diff --git a/examples/typescript/file-operations/tsconfig.json b/examples/typescript/file-operations/tsconfig.json new file mode 100644 index 0000000..5c4c88f --- /dev/null +++ b/examples/typescript/file-operations/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "target": "ES2020", + "module": "commonjs", + "lib": ["ES2020", "DOM"], + "declaration": true, + "outDir": "dist", + "rootDir": "src", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "moduleResolution": "node", + "resolveJsonModule": true, + "baseUrl": ".", + "paths": { + "@daytona/sdk": ["../../packages/ts/src"] + } + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist"] + } \ No newline at end of file diff --git a/examples/typescript/git-lsp/README.md b/examples/typescript/git-lsp/README.md new file mode 100644 index 0000000..e69de29 diff --git a/examples/typescript/git-lsp/package.json b/examples/typescript/git-lsp/package.json new file mode 100644 index 0000000..d44d9a8 --- /dev/null +++ b/examples/typescript/git-lsp/package.json @@ -0,0 +1,9 @@ +{ + "private": true, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "dependencies": { + "@daytona/sdk": "*" + } +} diff --git a/examples/typescript/git-lsp/src/index.ts b/examples/typescript/git-lsp/src/index.ts new file mode 100644 index 0000000..f7ff7ae --- /dev/null +++ b/examples/typescript/git-lsp/src/index.ts @@ -0,0 +1,64 @@ +import * as path from 'path' +import { Daytona } from '@daytona/sdk' + +async function main() { + const daytona = new Daytona() + + // first, create a workspace + const workspace = await daytona.create() + + try { + const rootDir = await workspace.getWorkspaceRootDir() + const projectDir = path.join(rootDir, 'learn-typescript') + + // clone the repository + await workspace.git.clone( + 'https://github.com/panaverse/learn-typescript', + projectDir, + 'master', + ) + + // search for the file we want to work on + const matches = await workspace.fs.findFiles( + projectDir, + 'var obj1 = new Base();', + ) + console.log('Matches:', matches) + + // start the language server + const lsp = workspace.createLspServer('typescript', projectDir) + await lsp.start() + + // notify the language server of the document we want to work on + await lsp.didOpen(matches[0].file!) + + // get symbols in the document + const symbols = await lsp.documentSymbols(matches[0].file!) + console.log('Symbols:', symbols) + + // fix the error in the document + await workspace.fs.replaceInFiles( + [matches[0].file!], + 'var obj1 = new Base();', + 'var obj1 = new E();', + ) + + // notify the language server of the document change + await lsp.didClose(matches[0].file!) + await lsp.didOpen(matches[0].file!) + + // get completions at a specific position + const completions = await lsp.completions(matches[0].file!, { + line: 12, + character: 18, + }) + console.log('Completions:', completions) + } catch (error) { + console.error('Error creating workspace:', error) + } finally { + // cleanup + await daytona.remove(workspace) + } +} + +main() diff --git a/examples/typescript/git-lsp/tsconfig.json b/examples/typescript/git-lsp/tsconfig.json new file mode 100644 index 0000000..5c4c88f --- /dev/null +++ b/examples/typescript/git-lsp/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "target": "ES2020", + "module": "commonjs", + "lib": ["ES2020", "DOM"], + "declaration": true, + "outDir": "dist", + "rootDir": "src", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "moduleResolution": "node", + "resolveJsonModule": true, + "baseUrl": ".", + "paths": { + "@daytona/sdk": ["../../packages/ts/src"] + } + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist"] + } \ No newline at end of file diff --git a/hack/generate-api-clients.sh b/hack/generate-api-clients.sh new file mode 100755 index 0000000..8baef09 --- /dev/null +++ b/hack/generate-api-clients.sh @@ -0,0 +1,15 @@ +#!/bin/bash +set -e + +VERSION=${DAYTONA_VERSION:-"latest"} + +if [ "$VERSION" = "latest" ]; then + echo "Fetching the latest version..." + echo "You can override this by setting the DAYTONA_VERSION environment variable" + VERSION=$(curl -s https://api.github.com/repos/daytonaio/daytona/releases/latest | grep tag_name | cut -d '"' -f 4) +fi + +URL=https://raw.githubusercontent.com/daytonaio/daytona/refs/tags/$VERSION/pkg/api/docs/swagger.json + +npx openapi-generator-cli generate -i $URL -g python -o /workspaces/sdk_tmp/packages/python/src --additional-properties=packageName=api_client,pythonVersion=3.10,generateSourceCodeOnly=true +npx openapi-generator-cli generate -i $URL -g typescript-fetch -o /workspaces/sdk_tmp/packages/ts/src/client --additional-properties=typescriptThreePlus=true,supportsES6=true,enumNameSuffix= --type-mappings=DateTime=Dat diff --git a/hack/postinstall.sh b/hack/postinstall.sh new file mode 100755 index 0000000..0a227a1 --- /dev/null +++ b/hack/postinstall.sh @@ -0,0 +1,24 @@ +#!/bin/bash +set -e + +# Upgrade basic tools +python3 -m ensurepip --upgrade +python3 -m pip install --upgrade pip setuptools wheel black + +# Install dependencies +echo "Installing Python packages..." +python3 -m pip install "aiohttp>=3.8.5" "pydantic>=2.4.2" "python-dateutil>=2.8.2" "typing-extensions>=4.7.1" "urllib3>=1.25.3" +python3 -m pip install environs + +# Install the local package in editable mode +python3 -m pip install -e "packages/python" + +echo "Post-install completed successfully" + +echo "Building and linking @daytona/sdk..." +cd packages/typescript +yarn build +yarn link + +cd ../../examples/typescript/exec-command +yarn link @daytona/sdk diff --git a/hack/workspace-images/python/Dockerfile b/hack/workspace-images/python/Dockerfile new file mode 100644 index 0000000..e429c5a --- /dev/null +++ b/hack/workspace-images/python/Dockerfile @@ -0,0 +1,15 @@ +FROM mcr.microsoft.com/devcontainers/python +RUN apt-get update && apt-get install -y curl sudo + +# Install the Python Language Server +RUN python3 -m pip install python-language-server + +# Install the Daytona CLI +RUN useradd -m daytona && echo "daytona ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/91-daytona +USER daytona + +ARG DAYTONA_VERSION + +RUN curl -sfL https://download.daytona.io/daytona/install.sh | DAYTONA_VERSION=${DAYTONA_VERSION} sudo -E bash + +ENTRYPOINT [ "sleep", "infinity" ] \ No newline at end of file diff --git a/hack/workspace-images/typescript/Dockerfile b/hack/workspace-images/typescript/Dockerfile new file mode 100644 index 0000000..fad4183 --- /dev/null +++ b/hack/workspace-images/typescript/Dockerfile @@ -0,0 +1,13 @@ +FROM mcr.microsoft.com/devcontainers/typescript-node +RUN apt-get update && apt-get install -y curl sudo +# Install the TypeScript Language Server +RUN npm i -g typescript-language-server +# Install the Daytona CLI +RUN useradd -m daytona && echo "daytona ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/91-daytona +USER daytona + +ARG DAYTONA_VERSION + +RUN curl -sfL https://download.daytona.io/daytona/install.sh | DAYTONA_VERSION=${DAYTONA_VERSION} sudo -E bash + +ENTRYPOINT [ "sleep", "infinity" ] \ No newline at end of file diff --git a/openapitools.json b/openapitools.json new file mode 100644 index 0000000..f8d07ce --- /dev/null +++ b/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "7.10.0" + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..c64e1e3 --- /dev/null +++ b/package.json @@ -0,0 +1,39 @@ +{ + "private": true, + "version": "0.1.3", + "scripts": { + "generate-api-clients": "sh ./hack/generate-api-clients.sh", + "test": "echo \"Error: no test specified\" && exit 1", + "postinstall": "(is-ci || husky) && ./hack/postinstall.sh", + "format:ts": "prettier --write ./**/*.{ts,tsx}", + "format:py": "black .", + "format:all": "npm run format:ts && npm run format:py", + "exec-command-example": "npx dotenvx run -f .env.local -- npx ts-node examples/ts/exec-command/src/" + }, + "workspaces": [ + "packages/*", + "examples/*" + ], + "author": "", + "license": "ISC", + "dependencies": { + "@dotenvx/dotenvx": "^1.25.1" + }, + "devDependencies": { + "@openapitools/openapi-generator-cli": "^2.15.3", + "ts-node": "^10.9.2", + "tsconfig-paths": "^4.2.0", + "husky": "^9.1.6", + "is-ci": "^3.0.1", + "lint-staged": "^15.2.10", + "prettier": "^2.4.1" + }, + "lint-staged": { + "*.{ts,tsx}": [ + "prettier --write" + ], + "*.py": [ + "black" + ] + } +} diff --git a/packages/python/LICENCE b/packages/python/LICENCE new file mode 100644 index 0000000..c44b766 --- /dev/null +++ b/packages/python/LICENCE @@ -0,0 +1,43 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship \ No newline at end of file diff --git a/packages/python/README.md b/packages/python/README.md new file mode 100644 index 0000000..bec936e --- /dev/null +++ b/packages/python/README.md @@ -0,0 +1,167 @@ +# Daytona SDK for Python + +A Python SDK for interacting with Daytona Server API, providing a simple interface for Daytona Workspace management, Git operations, file system operations, and language server protocol support. + +## Prerequisites + +Before using the Daytona SDK, you need to have a running Daytona server instance and proper configuration. + +### Server Installation + +For detailed instructions on installing and setting up the Daytona server, please refer to the official installation guide at: +[https://github.com/daytonaio/daytona](https://github.com/daytonaio/daytona) + +### Configuration + +To use the SDK, you'll need two essential pieces of information: + +1. **Server Address**: + + - Run `daytona server config` to get your server's configuration + - Look for the `API URL` value in the output + - For testing and development, you can use the FRP address provided + - For production environments, it's recommended to use a static address + +2. **API Key**: + - Generate a new API key by running: + ```bash + daytona api-key generate + ``` + - Save this key securely as it will be needed to authenticate with the server + +## Installation + +You can install the package using pip: + +```bash +pip install daytona-sdk +``` + +## Quick Start + +Here's a simple example of using the SDK: + +```python +from daytona_sdk import Daytona + +# Initialize the Daytona client +daytona = Daytona() + +# Create the workspace instance +workspace = daytona.create() + +# Run the code securely inside the workspace +response = workspace.process.code_run('print("Hello World!")') +print(response.result) +``` + +## Features + +- **Workspace Management**: Create, manage and remove workspaces +- **Git Operations**: Clone repositories, manage branches, and more +- **File System Operations**: Upload, download, search and manipulate files +- **Language Server Protocol**: Interact with language servers for code intelligence +- **Process Management**: Execute code and commands in workspaces + +## Configuration + +The SDK can be configured using environment variables or by passing a configuration object: + +```python +from daytona_sdk import Daytona, DaytonaConfig + +config = DaytonaConfig( + api_key='your-api-key', + server_url='https://your-daytona-server', + target='your-target' +) + +daytona = Daytona(config) +``` + +Or using environment variables: + +- `DAYTONA_API_KEY`: Your Daytona API key +- `DAYTONA_SERVER_URL`: The Daytona server URL +- `DAYTONA_TARGET`: Your target environment + +## Examples + +### Execute command + +```python +response = workspace.process.code_run('print("Sum of 3 and 4 is " + str(3 + 4))') +if response.code != 0: + print(f"Error: {response.code} {response.result}") +else: + print(response.result) +``` + +### File Operations + +```python +# Upload a file +workspace.fs.upload_file('/path/to/file.txt', b'Hello, World!') + +# Download a file +content = workspace.fs.download_file('/path/to/file.txt') + +# Search for files +matches = workspace.fs.find_files(root_dir, 'search_pattern') +``` + +### Git Operations + +```python +# Clone a repository +workspace.git.clone('https://github.com/example/repo', '/path/to/clone') + +# List branches +branches = workspace.git.branches('/path/to/repo') + +# Add files +workspace.git.add('/path/to/repo', ['file1.txt', 'file2.txt']) +``` + +### Language Server Protocol + +```python +# Create and start a language server +lsp = workspace.create_lsp_server('typescript', '/path/to/project') +lsp.start() + +# Notify the lsp for the file +lsp.did_open('/path/to/file.ts') + +# Get document symbols +symbols = lsp.document_symbols('/path/to/file.ts') + +# Get completions +completions = lsp.completions('/path/to/file.ts', {"line": 10, "character": 15}) +``` + +## Contributing + +Contributions are welcome! Please feel free to submit a Pull Request. + +## License + +This project is licensed under the Apache License, Version 2.0 - see below for details: + +``` +Copyright 2024 Daytona + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +``` + +For the full license text, please see the [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0). diff --git a/packages/python/pyproject.toml b/packages/python/pyproject.toml new file mode 100644 index 0000000..e8bda5a --- /dev/null +++ b/packages/python/pyproject.toml @@ -0,0 +1,30 @@ +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "daytona_sdk" +version = "0.1.3" +authors = [ + { name = "Vedran Jukic", email = "vedran.jukic@gmail.com" }, +] +description = "Python SDK for Daytona" +readme = "README.md" +requires-python = ">=3.7" +dependencies = [ + "environs>=9.5.0,<10.0.0", + "marshmallow>=3.19.0,<4.0.0", + "pydantic>=2.4.2,<3.0.0", + "python-dateutil>=2.8.2,<3.0.0", + "urllib3>=2.0.7,<3.0.0" +] +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", +] +keywords = ["daytona", "sdk"] +license = {text = "Apache 2.0"} \ No newline at end of file diff --git a/packages/python/requirements.txt b/packages/python/requirements.txt new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/packages/python/requirements.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/python/setup.py b/packages/python/setup.py new file mode 100644 index 0000000..dc7a7b3 --- /dev/null +++ b/packages/python/setup.py @@ -0,0 +1,16 @@ +from setuptools import setup, find_packages + +setup( + name="daytona_sdk", + version="0.1.0", + packages=find_packages(where="src"), + package_dir={"": "src"}, + install_requires=[ + # Add dependencies here + ], + # Include both packages + package_data={ + "daytona_sdk": ["*"], + "apiclient": ["*"], + }, +) diff --git a/packages/python/src/.openapi-generator-ignore b/packages/python/src/.openapi-generator-ignore new file mode 100644 index 0000000..7f55907 --- /dev/null +++ b/packages/python/src/.openapi-generator-ignore @@ -0,0 +1,29 @@ +# 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 +git_push.sh +.travis.yml +go.mod +go.sum +api_client/test/* +api_client_README.md diff --git a/packages/python/src/.openapi-generator/FILES b/packages/python/src/.openapi-generator/FILES new file mode 100644 index 0000000..86b5db6 --- /dev/null +++ b/packages/python/src/.openapi-generator/FILES @@ -0,0 +1,194 @@ +api_client/__init__.py +api_client/api/__init__.py +api_client/api/api_key_api.py +api_client/api/build_api.py +api_client/api/container_registry_api.py +api_client/api/default_api.py +api_client/api/git_provider_api.py +api_client/api/prebuild_api.py +api_client/api/profile_api.py +api_client/api/project_config_api.py +api_client/api/provider_api.py +api_client/api/sample_api.py +api_client/api/server_api.py +api_client/api/target_api.py +api_client/api/workspace_api.py +api_client/api/workspace_toolbox_api.py +api_client/api_client.py +api_client/api_response.py +api_client/configuration.py +api_client/docs/ApiKey.md +api_client/docs/ApiKeyApi.md +api_client/docs/ApikeyApiKeyType.md +api_client/docs/Build.md +api_client/docs/BuildApi.md +api_client/docs/BuildBuildState.md +api_client/docs/BuildConfig.md +api_client/docs/CachedBuild.md +api_client/docs/CloneTarget.md +api_client/docs/CompletionContext.md +api_client/docs/CompletionItem.md +api_client/docs/CompletionList.md +api_client/docs/ContainerConfig.md +api_client/docs/ContainerRegistry.md +api_client/docs/ContainerRegistryApi.md +api_client/docs/CreateBuildDTO.md +api_client/docs/CreatePrebuildDTO.md +api_client/docs/CreateProjectConfigDTO.md +api_client/docs/CreateProjectDTO.md +api_client/docs/CreateProjectSourceDTO.md +api_client/docs/CreateProviderTargetDTO.md +api_client/docs/CreateWorkspaceDTO.md +api_client/docs/DefaultApi.md +api_client/docs/DevcontainerConfig.md +api_client/docs/ExecuteRequest.md +api_client/docs/ExecuteResponse.md +api_client/docs/FRPSConfig.md +api_client/docs/FileInfo.md +api_client/docs/FileStatus.md +api_client/docs/GetRepositoryContext.md +api_client/docs/GitAddRequest.md +api_client/docs/GitBranch.md +api_client/docs/GitBranchRequest.md +api_client/docs/GitCloneRequest.md +api_client/docs/GitCommitInfo.md +api_client/docs/GitCommitRequest.md +api_client/docs/GitCommitResponse.md +api_client/docs/GitNamespace.md +api_client/docs/GitProvider.md +api_client/docs/GitProviderApi.md +api_client/docs/GitPullRequest.md +api_client/docs/GitRepoRequest.md +api_client/docs/GitRepository.md +api_client/docs/GitStatus.md +api_client/docs/GitUser.md +api_client/docs/InstallProviderRequest.md +api_client/docs/ListBranchResponse.md +api_client/docs/LogFileConfig.md +api_client/docs/LspCompletionParams.md +api_client/docs/LspDocumentRequest.md +api_client/docs/LspLocation.md +api_client/docs/LspPosition.md +api_client/docs/LspRange.md +api_client/docs/LspServerRequest.md +api_client/docs/LspSymbol.md +api_client/docs/Match.md +api_client/docs/NetworkKey.md +api_client/docs/Position.md +api_client/docs/PrebuildApi.md +api_client/docs/PrebuildConfig.md +api_client/docs/PrebuildDTO.md +api_client/docs/ProfileApi.md +api_client/docs/ProfileData.md +api_client/docs/Project.md +api_client/docs/ProjectConfig.md +api_client/docs/ProjectConfigApi.md +api_client/docs/ProjectDirResponse.md +api_client/docs/ProjectInfo.md +api_client/docs/ProjectState.md +api_client/docs/Provider.md +api_client/docs/ProviderApi.md +api_client/docs/ProviderProviderInfo.md +api_client/docs/ProviderProviderTargetProperty.md +api_client/docs/ProviderProviderTargetPropertyType.md +api_client/docs/ProviderTarget.md +api_client/docs/ReplaceRequest.md +api_client/docs/ReplaceResult.md +api_client/docs/RepositoryUrl.md +api_client/docs/Sample.md +api_client/docs/SampleApi.md +api_client/docs/SearchFilesResponse.md +api_client/docs/ServerApi.md +api_client/docs/ServerConfig.md +api_client/docs/SetGitProviderConfig.md +api_client/docs/SetProjectState.md +api_client/docs/SigningMethod.md +api_client/docs/Status.md +api_client/docs/TargetApi.md +api_client/docs/Workspace.md +api_client/docs/WorkspaceApi.md +api_client/docs/WorkspaceDTO.md +api_client/docs/WorkspaceInfo.md +api_client/docs/WorkspaceToolboxApi.md +api_client/exceptions.py +api_client/models/__init__.py +api_client/models/api_key.py +api_client/models/apikey_api_key_type.py +api_client/models/build.py +api_client/models/build_build_state.py +api_client/models/build_config.py +api_client/models/cached_build.py +api_client/models/clone_target.py +api_client/models/completion_context.py +api_client/models/completion_item.py +api_client/models/completion_list.py +api_client/models/container_config.py +api_client/models/container_registry.py +api_client/models/create_build_dto.py +api_client/models/create_prebuild_dto.py +api_client/models/create_project_config_dto.py +api_client/models/create_project_dto.py +api_client/models/create_project_source_dto.py +api_client/models/create_provider_target_dto.py +api_client/models/create_workspace_dto.py +api_client/models/devcontainer_config.py +api_client/models/execute_request.py +api_client/models/execute_response.py +api_client/models/file_info.py +api_client/models/file_status.py +api_client/models/frps_config.py +api_client/models/get_repository_context.py +api_client/models/git_add_request.py +api_client/models/git_branch.py +api_client/models/git_branch_request.py +api_client/models/git_clone_request.py +api_client/models/git_commit_info.py +api_client/models/git_commit_request.py +api_client/models/git_commit_response.py +api_client/models/git_namespace.py +api_client/models/git_provider.py +api_client/models/git_pull_request.py +api_client/models/git_repo_request.py +api_client/models/git_repository.py +api_client/models/git_status.py +api_client/models/git_user.py +api_client/models/install_provider_request.py +api_client/models/list_branch_response.py +api_client/models/log_file_config.py +api_client/models/lsp_completion_params.py +api_client/models/lsp_document_request.py +api_client/models/lsp_location.py +api_client/models/lsp_position.py +api_client/models/lsp_range.py +api_client/models/lsp_server_request.py +api_client/models/lsp_symbol.py +api_client/models/match.py +api_client/models/network_key.py +api_client/models/position.py +api_client/models/prebuild_config.py +api_client/models/prebuild_dto.py +api_client/models/profile_data.py +api_client/models/project.py +api_client/models/project_config.py +api_client/models/project_dir_response.py +api_client/models/project_info.py +api_client/models/project_state.py +api_client/models/provider.py +api_client/models/provider_provider_info.py +api_client/models/provider_provider_target_property.py +api_client/models/provider_provider_target_property_type.py +api_client/models/provider_target.py +api_client/models/replace_request.py +api_client/models/replace_result.py +api_client/models/repository_url.py +api_client/models/sample.py +api_client/models/search_files_response.py +api_client/models/server_config.py +api_client/models/set_git_provider_config.py +api_client/models/set_project_state.py +api_client/models/signing_method.py +api_client/models/status.py +api_client/models/workspace.py +api_client/models/workspace_dto.py +api_client/models/workspace_info.py +api_client/rest.py diff --git a/packages/python/src/.openapi-generator/VERSION b/packages/python/src/.openapi-generator/VERSION new file mode 100644 index 0000000..758bb9c --- /dev/null +++ b/packages/python/src/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.10.0 diff --git a/packages/python/src/api_client/__init__.py b/packages/python/src/api_client/__init__.py new file mode 100644 index 0000000..4af480d --- /dev/null +++ b/packages/python/src/api_client/__init__.py @@ -0,0 +1,129 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +__version__ = "1.0.0" + +# import apis into sdk package +from api_client.api.api_key_api import ApiKeyApi +from api_client.api.build_api import BuildApi +from api_client.api.container_registry_api import ContainerRegistryApi +from api_client.api.default_api import DefaultApi +from api_client.api.git_provider_api import GitProviderApi +from api_client.api.prebuild_api import PrebuildApi +from api_client.api.profile_api import ProfileApi +from api_client.api.project_config_api import ProjectConfigApi +from api_client.api.provider_api import ProviderApi +from api_client.api.sample_api import SampleApi +from api_client.api.server_api import ServerApi +from api_client.api.target_api import TargetApi +from api_client.api.workspace_api import WorkspaceApi +from api_client.api.workspace_toolbox_api import WorkspaceToolboxApi + +# import ApiClient +from api_client.api_response import ApiResponse +from api_client.api_client import ApiClient +from api_client.configuration import Configuration +from api_client.exceptions import OpenApiException +from api_client.exceptions import ApiTypeError +from api_client.exceptions import ApiValueError +from api_client.exceptions import ApiKeyError +from api_client.exceptions import ApiAttributeError +from api_client.exceptions import ApiException + +# import models into sdk package +from api_client.models.api_key import ApiKey +from api_client.models.apikey_api_key_type import ApikeyApiKeyType +from api_client.models.build import Build +from api_client.models.build_build_state import BuildBuildState +from api_client.models.build_config import BuildConfig +from api_client.models.cached_build import CachedBuild +from api_client.models.clone_target import CloneTarget +from api_client.models.completion_context import CompletionContext +from api_client.models.completion_item import CompletionItem +from api_client.models.completion_list import CompletionList +from api_client.models.container_config import ContainerConfig +from api_client.models.container_registry import ContainerRegistry +from api_client.models.create_build_dto import CreateBuildDTO +from api_client.models.create_prebuild_dto import CreatePrebuildDTO +from api_client.models.create_project_config_dto import CreateProjectConfigDTO +from api_client.models.create_project_dto import CreateProjectDTO +from api_client.models.create_project_source_dto import CreateProjectSourceDTO +from api_client.models.create_provider_target_dto import CreateProviderTargetDTO +from api_client.models.create_workspace_dto import CreateWorkspaceDTO +from api_client.models.devcontainer_config import DevcontainerConfig +from api_client.models.execute_request import ExecuteRequest +from api_client.models.execute_response import ExecuteResponse +from api_client.models.frps_config import FRPSConfig +from api_client.models.file_info import FileInfo +from api_client.models.file_status import FileStatus +from api_client.models.get_repository_context import GetRepositoryContext +from api_client.models.git_add_request import GitAddRequest +from api_client.models.git_branch import GitBranch +from api_client.models.git_branch_request import GitBranchRequest +from api_client.models.git_clone_request import GitCloneRequest +from api_client.models.git_commit_info import GitCommitInfo +from api_client.models.git_commit_request import GitCommitRequest +from api_client.models.git_commit_response import GitCommitResponse +from api_client.models.git_namespace import GitNamespace +from api_client.models.git_provider import GitProvider +from api_client.models.git_pull_request import GitPullRequest +from api_client.models.git_repo_request import GitRepoRequest +from api_client.models.git_repository import GitRepository +from api_client.models.git_status import GitStatus +from api_client.models.git_user import GitUser +from api_client.models.install_provider_request import InstallProviderRequest +from api_client.models.list_branch_response import ListBranchResponse +from api_client.models.log_file_config import LogFileConfig +from api_client.models.lsp_completion_params import LspCompletionParams +from api_client.models.lsp_document_request import LspDocumentRequest +from api_client.models.lsp_location import LspLocation +from api_client.models.lsp_position import LspPosition +from api_client.models.lsp_range import LspRange +from api_client.models.lsp_server_request import LspServerRequest +from api_client.models.lsp_symbol import LspSymbol +from api_client.models.match import Match +from api_client.models.network_key import NetworkKey +from api_client.models.position import Position +from api_client.models.prebuild_config import PrebuildConfig +from api_client.models.prebuild_dto import PrebuildDTO +from api_client.models.profile_data import ProfileData +from api_client.models.project import Project +from api_client.models.project_config import ProjectConfig +from api_client.models.project_dir_response import ProjectDirResponse +from api_client.models.project_info import ProjectInfo +from api_client.models.project_state import ProjectState +from api_client.models.provider import Provider +from api_client.models.provider_provider_info import ProviderProviderInfo +from api_client.models.provider_provider_target_property import ( + ProviderProviderTargetProperty, +) +from api_client.models.provider_provider_target_property_type import ( + ProviderProviderTargetPropertyType, +) +from api_client.models.provider_target import ProviderTarget +from api_client.models.replace_request import ReplaceRequest +from api_client.models.replace_result import ReplaceResult +from api_client.models.repository_url import RepositoryUrl +from api_client.models.sample import Sample +from api_client.models.search_files_response import SearchFilesResponse +from api_client.models.server_config import ServerConfig +from api_client.models.set_git_provider_config import SetGitProviderConfig +from api_client.models.set_project_state import SetProjectState +from api_client.models.signing_method import SigningMethod +from api_client.models.status import Status +from api_client.models.workspace import Workspace +from api_client.models.workspace_dto import WorkspaceDTO +from api_client.models.workspace_info import WorkspaceInfo diff --git a/packages/python/src/api_client/api/__init__.py b/packages/python/src/api_client/api/__init__.py new file mode 100644 index 0000000..749d34a --- /dev/null +++ b/packages/python/src/api_client/api/__init__.py @@ -0,0 +1,17 @@ +# flake8: noqa + +# import apis into api package +from api_client.api.api_key_api import ApiKeyApi +from api_client.api.build_api import BuildApi +from api_client.api.container_registry_api import ContainerRegistryApi +from api_client.api.default_api import DefaultApi +from api_client.api.git_provider_api import GitProviderApi +from api_client.api.prebuild_api import PrebuildApi +from api_client.api.profile_api import ProfileApi +from api_client.api.project_config_api import ProjectConfigApi +from api_client.api.provider_api import ProviderApi +from api_client.api.sample_api import SampleApi +from api_client.api.server_api import ServerApi +from api_client.api.target_api import TargetApi +from api_client.api.workspace_api import WorkspaceApi +from api_client.api.workspace_toolbox_api import WorkspaceToolboxApi diff --git a/packages/python/src/api_client/api/api_key_api.py b/packages/python/src/api_client/api/api_key_api.py new file mode 100644 index 0000000..12a2363 --- /dev/null +++ b/packages/python/src/api_client/api/api_key_api.py @@ -0,0 +1,744 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import List +from typing_extensions import Annotated +from api_client.models.api_key import ApiKey + +from api_client.api_client import ApiClient, RequestSerialized +from api_client.api_response import ApiResponse +from api_client.rest import RESTResponseType + + +class ApiKeyApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @validate_call + def generate_api_key( + self, + api_key_name: Annotated[StrictStr, Field(description="API key name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> str: + """Generate an API key + + Generate an API key + + :param api_key_name: API key name (required) + :type api_key_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._generate_api_key_serialize( + api_key_name=api_key_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "str", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def generate_api_key_with_http_info( + self, + api_key_name: Annotated[StrictStr, Field(description="API key name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[str]: + """Generate an API key + + Generate an API key + + :param api_key_name: API key name (required) + :type api_key_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._generate_api_key_serialize( + api_key_name=api_key_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "str", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def generate_api_key_without_preload_content( + self, + api_key_name: Annotated[StrictStr, Field(description="API key name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Generate an API key + + Generate an API key + + :param api_key_name: API key name (required) + :type api_key_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._generate_api_key_serialize( + api_key_name=api_key_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "str", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _generate_api_key_serialize( + self, + api_key_name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if api_key_name is not None: + _path_params["apiKeyName"] = api_key_name + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["text/plain"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/apikey/{apiKeyName}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_client_api_keys( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ApiKey]: + """List API keys + + List API keys + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_client_api_keys_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[ApiKey]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_client_api_keys_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ApiKey]]: + """List API keys + + List API keys + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_client_api_keys_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[ApiKey]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_client_api_keys_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List API keys + + List API keys + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_client_api_keys_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[ApiKey]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _list_client_api_keys_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/apikey", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def revoke_api_key( + self, + api_key_name: Annotated[StrictStr, Field(description="API key name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Revoke API key + + Revoke API key + + :param api_key_name: API key name (required) + :type api_key_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._revoke_api_key_serialize( + api_key_name=api_key_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def revoke_api_key_with_http_info( + self, + api_key_name: Annotated[StrictStr, Field(description="API key name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Revoke API key + + Revoke API key + + :param api_key_name: API key name (required) + :type api_key_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._revoke_api_key_serialize( + api_key_name=api_key_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def revoke_api_key_without_preload_content( + self, + api_key_name: Annotated[StrictStr, Field(description="API key name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Revoke API key + + Revoke API key + + :param api_key_name: API key name (required) + :type api_key_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._revoke_api_key_serialize( + api_key_name=api_key_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _revoke_api_key_serialize( + self, + api_key_name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if api_key_name is not None: + _path_params["apiKeyName"] = api_key_name + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/apikey/{apiKeyName}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/packages/python/src/api_client/api/build_api.py b/packages/python/src/api_client/api/build_api.py new file mode 100644 index 0000000..8b66ebe --- /dev/null +++ b/packages/python/src/api_client/api/build_api.py @@ -0,0 +1,1507 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBool, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from api_client.models.build import Build +from api_client.models.create_build_dto import CreateBuildDTO + +from api_client.api_client import ApiClient, RequestSerialized +from api_client.api_response import ApiResponse +from api_client.rest import RESTResponseType + + +class BuildApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @validate_call + def create_build( + self, + create_build_dto: Annotated[ + CreateBuildDTO, Field(description="Create Build DTO") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> str: + """Create a build + + Create a build + + :param create_build_dto: Create Build DTO (required) + :type create_build_dto: CreateBuildDTO + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_build_serialize( + create_build_dto=create_build_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "str", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def create_build_with_http_info( + self, + create_build_dto: Annotated[ + CreateBuildDTO, Field(description="Create Build DTO") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[str]: + """Create a build + + Create a build + + :param create_build_dto: Create Build DTO (required) + :type create_build_dto: CreateBuildDTO + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_build_serialize( + create_build_dto=create_build_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "str", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def create_build_without_preload_content( + self, + create_build_dto: Annotated[ + CreateBuildDTO, Field(description="Create Build DTO") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a build + + Create a build + + :param create_build_dto: Create Build DTO (required) + :type create_build_dto: CreateBuildDTO + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_build_serialize( + create_build_dto=create_build_dto, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "str", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _create_build_serialize( + self, + create_build_dto, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if create_build_dto is not None: + _body_params = create_build_dto + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/build", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def delete_all_builds( + self, + force: Annotated[Optional[StrictBool], Field(description="Force")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete ALL builds + + Delete ALL builds + + :param force: Force + :type force: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_all_builds_serialize( + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def delete_all_builds_with_http_info( + self, + force: Annotated[Optional[StrictBool], Field(description="Force")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete ALL builds + + Delete ALL builds + + :param force: Force + :type force: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_all_builds_serialize( + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def delete_all_builds_without_preload_content( + self, + force: Annotated[Optional[StrictBool], Field(description="Force")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete ALL builds + + Delete ALL builds + + :param force: Force + :type force: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_all_builds_serialize( + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _delete_all_builds_serialize( + self, + force, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if force is not None: + + _query_params.append(("force", force)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/build", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def delete_build( + self, + build_id: Annotated[StrictStr, Field(description="Build ID")], + force: Annotated[Optional[StrictBool], Field(description="Force")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete build + + Delete build + + :param build_id: Build ID (required) + :type build_id: str + :param force: Force + :type force: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_build_serialize( + build_id=build_id, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def delete_build_with_http_info( + self, + build_id: Annotated[StrictStr, Field(description="Build ID")], + force: Annotated[Optional[StrictBool], Field(description="Force")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete build + + Delete build + + :param build_id: Build ID (required) + :type build_id: str + :param force: Force + :type force: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_build_serialize( + build_id=build_id, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def delete_build_without_preload_content( + self, + build_id: Annotated[StrictStr, Field(description="Build ID")], + force: Annotated[Optional[StrictBool], Field(description="Force")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete build + + Delete build + + :param build_id: Build ID (required) + :type build_id: str + :param force: Force + :type force: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_build_serialize( + build_id=build_id, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _delete_build_serialize( + self, + build_id, + force, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if build_id is not None: + _path_params["buildId"] = build_id + # process the query parameters + if force is not None: + + _query_params.append(("force", force)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/build/{buildId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def delete_builds_from_prebuild( + self, + prebuild_id: Annotated[StrictStr, Field(description="Prebuild ID")], + force: Annotated[Optional[StrictBool], Field(description="Force")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete builds + + Delete builds + + :param prebuild_id: Prebuild ID (required) + :type prebuild_id: str + :param force: Force + :type force: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_builds_from_prebuild_serialize( + prebuild_id=prebuild_id, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def delete_builds_from_prebuild_with_http_info( + self, + prebuild_id: Annotated[StrictStr, Field(description="Prebuild ID")], + force: Annotated[Optional[StrictBool], Field(description="Force")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete builds + + Delete builds + + :param prebuild_id: Prebuild ID (required) + :type prebuild_id: str + :param force: Force + :type force: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_builds_from_prebuild_serialize( + prebuild_id=prebuild_id, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def delete_builds_from_prebuild_without_preload_content( + self, + prebuild_id: Annotated[StrictStr, Field(description="Prebuild ID")], + force: Annotated[Optional[StrictBool], Field(description="Force")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete builds + + Delete builds + + :param prebuild_id: Prebuild ID (required) + :type prebuild_id: str + :param force: Force + :type force: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_builds_from_prebuild_serialize( + prebuild_id=prebuild_id, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _delete_builds_from_prebuild_serialize( + self, + prebuild_id, + force, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if prebuild_id is not None: + _path_params["prebuildId"] = prebuild_id + # process the query parameters + if force is not None: + + _query_params.append(("force", force)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/build/prebuild/{prebuildId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_build( + self, + build_id: Annotated[StrictStr, Field(description="Build ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Build: + """Get build data + + Get build data + + :param build_id: Build ID (required) + :type build_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_build_serialize( + build_id=build_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Build", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_build_with_http_info( + self, + build_id: Annotated[StrictStr, Field(description="Build ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Build]: + """Get build data + + Get build data + + :param build_id: Build ID (required) + :type build_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_build_serialize( + build_id=build_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Build", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_build_without_preload_content( + self, + build_id: Annotated[StrictStr, Field(description="Build ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get build data + + Get build data + + :param build_id: Build ID (required) + :type build_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_build_serialize( + build_id=build_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Build", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_build_serialize( + self, + build_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if build_id is not None: + _path_params["buildId"] = build_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/build/{buildId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_builds( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[Build]: + """List builds + + List builds + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_builds_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[Build]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_builds_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[Build]]: + """List builds + + List builds + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_builds_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[Build]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_builds_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List builds + + List builds + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_builds_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[Build]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _list_builds_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/build", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/packages/python/src/api_client/api/container_registry_api.py b/packages/python/src/api_client/api/container_registry_api.py new file mode 100644 index 0000000..f5388cf --- /dev/null +++ b/packages/python/src/api_client/api/container_registry_api.py @@ -0,0 +1,1022 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import List +from typing_extensions import Annotated +from api_client.models.container_registry import ContainerRegistry + +from api_client.api_client import ApiClient, RequestSerialized +from api_client.api_response import ApiResponse +from api_client.rest import RESTResponseType + + +class ContainerRegistryApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @validate_call + def get_container_registry( + self, + server: Annotated[ + StrictStr, Field(description="Container Registry server name") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ContainerRegistry: + """Get container registry credentials + + Get container registry credentials + + :param server: Container Registry server name (required) + :type server: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_container_registry_serialize( + server=server, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ContainerRegistry", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_container_registry_with_http_info( + self, + server: Annotated[ + StrictStr, Field(description="Container Registry server name") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ContainerRegistry]: + """Get container registry credentials + + Get container registry credentials + + :param server: Container Registry server name (required) + :type server: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_container_registry_serialize( + server=server, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ContainerRegistry", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_container_registry_without_preload_content( + self, + server: Annotated[ + StrictStr, Field(description="Container Registry server name") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get container registry credentials + + Get container registry credentials + + :param server: Container Registry server name (required) + :type server: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_container_registry_serialize( + server=server, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ContainerRegistry", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_container_registry_serialize( + self, + server, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if server is not None: + _path_params["server"] = server + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/container-registry/{server}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_container_registries( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ContainerRegistry]: + """List container registries + + List container registries + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_container_registries_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[ContainerRegistry]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_container_registries_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ContainerRegistry]]: + """List container registries + + List container registries + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_container_registries_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[ContainerRegistry]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_container_registries_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List container registries + + List container registries + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_container_registries_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[ContainerRegistry]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _list_container_registries_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/container-registry", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def remove_container_registry( + self, + server: Annotated[ + StrictStr, Field(description="Container Registry server name") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Remove a container registry credentials + + Remove a container registry credentials + + :param server: Container Registry server name (required) + :type server: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_container_registry_serialize( + server=server, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def remove_container_registry_with_http_info( + self, + server: Annotated[ + StrictStr, Field(description="Container Registry server name") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Remove a container registry credentials + + Remove a container registry credentials + + :param server: Container Registry server name (required) + :type server: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_container_registry_serialize( + server=server, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def remove_container_registry_without_preload_content( + self, + server: Annotated[ + StrictStr, Field(description="Container Registry server name") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Remove a container registry credentials + + Remove a container registry credentials + + :param server: Container Registry server name (required) + :type server: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_container_registry_serialize( + server=server, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _remove_container_registry_serialize( + self, + server, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if server is not None: + _path_params["server"] = server + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/container-registry/{server}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def set_container_registry( + self, + server: Annotated[ + StrictStr, Field(description="Container Registry server name") + ], + container_registry: Annotated[ + ContainerRegistry, + Field(description="Container Registry credentials to set"), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Set container registry credentials + + Set container registry credentials + + :param server: Container Registry server name (required) + :type server: str + :param container_registry: Container Registry credentials to set (required) + :type container_registry: ContainerRegistry + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_container_registry_serialize( + server=server, + container_registry=container_registry, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def set_container_registry_with_http_info( + self, + server: Annotated[ + StrictStr, Field(description="Container Registry server name") + ], + container_registry: Annotated[ + ContainerRegistry, + Field(description="Container Registry credentials to set"), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Set container registry credentials + + Set container registry credentials + + :param server: Container Registry server name (required) + :type server: str + :param container_registry: Container Registry credentials to set (required) + :type container_registry: ContainerRegistry + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_container_registry_serialize( + server=server, + container_registry=container_registry, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def set_container_registry_without_preload_content( + self, + server: Annotated[ + StrictStr, Field(description="Container Registry server name") + ], + container_registry: Annotated[ + ContainerRegistry, + Field(description="Container Registry credentials to set"), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Set container registry credentials + + Set container registry credentials + + :param server: Container Registry server name (required) + :type server: str + :param container_registry: Container Registry credentials to set (required) + :type container_registry: ContainerRegistry + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_container_registry_serialize( + server=server, + container_registry=container_registry, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _set_container_registry_serialize( + self, + server, + container_registry, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if server is not None: + _path_params["server"] = server + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if container_registry is not None: + _body_params = container_registry + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="PUT", + resource_path="/container-registry/{server}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/packages/python/src/api_client/api/default_api.py b/packages/python/src/api_client/api/default_api.py new file mode 100644 index 0000000..2081922 --- /dev/null +++ b/packages/python/src/api_client/api/default_api.py @@ -0,0 +1,264 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import StrictStr +from typing import Dict + +from api_client.api_client import ApiClient, RequestSerialized +from api_client.api_response import ApiResponse +from api_client.rest import RESTResponseType + + +class DefaultApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @validate_call + def health_check( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Dict[str, str]: + """Health check + + Health check + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._health_check_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Dict[str, str]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def health_check_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Dict[str, str]]: + """Health check + + Health check + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._health_check_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Dict[str, str]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def health_check_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Health check + + Health check + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._health_check_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Dict[str, str]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _health_check_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/health", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/packages/python/src/api_client/api/git_provider_api.py b/packages/python/src/api_client/api/git_provider_api.py new file mode 100644 index 0000000..66ec5aa --- /dev/null +++ b/packages/python/src/api_client/api/git_provider_api.py @@ -0,0 +1,3413 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from api_client.models.get_repository_context import GetRepositoryContext +from api_client.models.git_branch import GitBranch +from api_client.models.git_namespace import GitNamespace +from api_client.models.git_provider import GitProvider +from api_client.models.git_pull_request import GitPullRequest +from api_client.models.git_repository import GitRepository +from api_client.models.git_user import GitUser +from api_client.models.repository_url import RepositoryUrl +from api_client.models.set_git_provider_config import SetGitProviderConfig + +from api_client.api_client import ApiClient, RequestSerialized +from api_client.api_response import ApiResponse +from api_client.rest import RESTResponseType + + +class GitProviderApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @validate_call + def get_git_context( + self, + repository: Annotated[ + GetRepositoryContext, Field(description="Get repository context") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GitRepository: + """Get Git context + + Get Git context + + :param repository: Get repository context (required) + :type repository: GetRepositoryContext + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_git_context_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GitRepository", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_git_context_with_http_info( + self, + repository: Annotated[ + GetRepositoryContext, Field(description="Get repository context") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GitRepository]: + """Get Git context + + Get Git context + + :param repository: Get repository context (required) + :type repository: GetRepositoryContext + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_git_context_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GitRepository", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_git_context_without_preload_content( + self, + repository: Annotated[ + GetRepositoryContext, Field(description="Get repository context") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Git context + + Get Git context + + :param repository: Get repository context (required) + :type repository: GetRepositoryContext + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_git_context_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GitRepository", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_git_context_serialize( + self, + repository, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if repository is not None: + _body_params = repository + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/gitprovider/context", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_git_provider( + self, + git_provider_id: Annotated[StrictStr, Field(description="ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GitProvider: + """Get Git provider + + Get Git provider + + :param git_provider_id: ID (required) + :type git_provider_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_git_provider_serialize( + git_provider_id=git_provider_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GitProvider", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_git_provider_with_http_info( + self, + git_provider_id: Annotated[StrictStr, Field(description="ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GitProvider]: + """Get Git provider + + Get Git provider + + :param git_provider_id: ID (required) + :type git_provider_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_git_provider_serialize( + git_provider_id=git_provider_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GitProvider", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_git_provider_without_preload_content( + self, + git_provider_id: Annotated[StrictStr, Field(description="ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Git provider + + Get Git provider + + :param git_provider_id: ID (required) + :type git_provider_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_git_provider_serialize( + git_provider_id=git_provider_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GitProvider", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_git_provider_serialize( + self, + git_provider_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if git_provider_id is not None: + _path_params["gitProviderId"] = git_provider_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["text/plain"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/gitprovider/{gitProviderId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_git_provider_id_for_url( + self, + url: Annotated[StrictStr, Field(description="Url")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> str: + """Get Git provider ID + + Get Git provider ID + + :param url: Url (required) + :type url: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_git_provider_id_for_url_serialize( + url=url, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "str", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_git_provider_id_for_url_with_http_info( + self, + url: Annotated[StrictStr, Field(description="Url")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[str]: + """Get Git provider ID + + Get Git provider ID + + :param url: Url (required) + :type url: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_git_provider_id_for_url_serialize( + url=url, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "str", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_git_provider_id_for_url_without_preload_content( + self, + url: Annotated[StrictStr, Field(description="Url")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Git provider ID + + Get Git provider ID + + :param url: Url (required) + :type url: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_git_provider_id_for_url_serialize( + url=url, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "str", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_git_provider_id_for_url_serialize( + self, + url, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if url is not None: + _path_params["url"] = url + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["text/plain"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/gitprovider/id-for-url/{url}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_git_user( + self, + git_provider_id: Annotated[StrictStr, Field(description="Git Provider Id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GitUser: + """Get Git context + + Get Git context + + :param git_provider_id: Git Provider Id (required) + :type git_provider_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_git_user_serialize( + git_provider_id=git_provider_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GitUser", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_git_user_with_http_info( + self, + git_provider_id: Annotated[StrictStr, Field(description="Git Provider Id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GitUser]: + """Get Git context + + Get Git context + + :param git_provider_id: Git Provider Id (required) + :type git_provider_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_git_user_serialize( + git_provider_id=git_provider_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GitUser", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_git_user_without_preload_content( + self, + git_provider_id: Annotated[StrictStr, Field(description="Git Provider Id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Git context + + Get Git context + + :param git_provider_id: Git Provider Id (required) + :type git_provider_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_git_user_serialize( + git_provider_id=git_provider_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GitUser", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_git_user_serialize( + self, + git_provider_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if git_provider_id is not None: + _path_params["gitProviderId"] = git_provider_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/gitprovider/{gitProviderId}/user", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_namespaces( + self, + git_provider_id: Annotated[StrictStr, Field(description="Git provider")], + page: Annotated[Optional[StrictInt], Field(description="Page number")] = None, + per_page: Annotated[ + Optional[StrictInt], Field(description="Number of items per page") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[GitNamespace]: + """Get Git namespaces + + Get Git namespaces + + :param git_provider_id: Git provider (required) + :type git_provider_id: str + :param page: Page number + :type page: int + :param per_page: Number of items per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_namespaces_serialize( + git_provider_id=git_provider_id, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[GitNamespace]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_namespaces_with_http_info( + self, + git_provider_id: Annotated[StrictStr, Field(description="Git provider")], + page: Annotated[Optional[StrictInt], Field(description="Page number")] = None, + per_page: Annotated[ + Optional[StrictInt], Field(description="Number of items per page") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[GitNamespace]]: + """Get Git namespaces + + Get Git namespaces + + :param git_provider_id: Git provider (required) + :type git_provider_id: str + :param page: Page number + :type page: int + :param per_page: Number of items per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_namespaces_serialize( + git_provider_id=git_provider_id, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[GitNamespace]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_namespaces_without_preload_content( + self, + git_provider_id: Annotated[StrictStr, Field(description="Git provider")], + page: Annotated[Optional[StrictInt], Field(description="Page number")] = None, + per_page: Annotated[ + Optional[StrictInt], Field(description="Number of items per page") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Git namespaces + + Get Git namespaces + + :param git_provider_id: Git provider (required) + :type git_provider_id: str + :param page: Page number + :type page: int + :param per_page: Number of items per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_namespaces_serialize( + git_provider_id=git_provider_id, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[GitNamespace]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_namespaces_serialize( + self, + git_provider_id, + page, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if git_provider_id is not None: + _path_params["gitProviderId"] = git_provider_id + # process the query parameters + if page is not None: + + _query_params.append(("page", page)) + + if per_page is not None: + + _query_params.append(("per_page", per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/gitprovider/{gitProviderId}/namespaces", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_repo_branches( + self, + git_provider_id: Annotated[StrictStr, Field(description="Git provider")], + namespace_id: Annotated[StrictStr, Field(description="Namespace")], + repository_id: Annotated[StrictStr, Field(description="Repository")], + page: Annotated[Optional[StrictInt], Field(description="Page number")] = None, + per_page: Annotated[ + Optional[StrictInt], Field(description="Number of items per page") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[GitBranch]: + """Get Git repository branches + + Get Git repository branches + + :param git_provider_id: Git provider (required) + :type git_provider_id: str + :param namespace_id: Namespace (required) + :type namespace_id: str + :param repository_id: Repository (required) + :type repository_id: str + :param page: Page number + :type page: int + :param per_page: Number of items per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_repo_branches_serialize( + git_provider_id=git_provider_id, + namespace_id=namespace_id, + repository_id=repository_id, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[GitBranch]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_repo_branches_with_http_info( + self, + git_provider_id: Annotated[StrictStr, Field(description="Git provider")], + namespace_id: Annotated[StrictStr, Field(description="Namespace")], + repository_id: Annotated[StrictStr, Field(description="Repository")], + page: Annotated[Optional[StrictInt], Field(description="Page number")] = None, + per_page: Annotated[ + Optional[StrictInt], Field(description="Number of items per page") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[GitBranch]]: + """Get Git repository branches + + Get Git repository branches + + :param git_provider_id: Git provider (required) + :type git_provider_id: str + :param namespace_id: Namespace (required) + :type namespace_id: str + :param repository_id: Repository (required) + :type repository_id: str + :param page: Page number + :type page: int + :param per_page: Number of items per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_repo_branches_serialize( + git_provider_id=git_provider_id, + namespace_id=namespace_id, + repository_id=repository_id, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[GitBranch]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_repo_branches_without_preload_content( + self, + git_provider_id: Annotated[StrictStr, Field(description="Git provider")], + namespace_id: Annotated[StrictStr, Field(description="Namespace")], + repository_id: Annotated[StrictStr, Field(description="Repository")], + page: Annotated[Optional[StrictInt], Field(description="Page number")] = None, + per_page: Annotated[ + Optional[StrictInt], Field(description="Number of items per page") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Git repository branches + + Get Git repository branches + + :param git_provider_id: Git provider (required) + :type git_provider_id: str + :param namespace_id: Namespace (required) + :type namespace_id: str + :param repository_id: Repository (required) + :type repository_id: str + :param page: Page number + :type page: int + :param per_page: Number of items per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_repo_branches_serialize( + git_provider_id=git_provider_id, + namespace_id=namespace_id, + repository_id=repository_id, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[GitBranch]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_repo_branches_serialize( + self, + git_provider_id, + namespace_id, + repository_id, + page, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if git_provider_id is not None: + _path_params["gitProviderId"] = git_provider_id + if namespace_id is not None: + _path_params["namespaceId"] = namespace_id + if repository_id is not None: + _path_params["repositoryId"] = repository_id + # process the query parameters + if page is not None: + + _query_params.append(("page", page)) + + if per_page is not None: + + _query_params.append(("per_page", per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/gitprovider/{gitProviderId}/{namespaceId}/{repositoryId}/branches", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_repo_prs( + self, + git_provider_id: Annotated[StrictStr, Field(description="Git provider")], + namespace_id: Annotated[StrictStr, Field(description="Namespace")], + repository_id: Annotated[StrictStr, Field(description="Repository")], + page: Annotated[Optional[StrictInt], Field(description="Page number")] = None, + per_page: Annotated[ + Optional[StrictInt], Field(description="Number of items per page") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[GitPullRequest]: + """Get Git repository PRs + + Get Git repository PRs + + :param git_provider_id: Git provider (required) + :type git_provider_id: str + :param namespace_id: Namespace (required) + :type namespace_id: str + :param repository_id: Repository (required) + :type repository_id: str + :param page: Page number + :type page: int + :param per_page: Number of items per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_repo_prs_serialize( + git_provider_id=git_provider_id, + namespace_id=namespace_id, + repository_id=repository_id, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[GitPullRequest]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_repo_prs_with_http_info( + self, + git_provider_id: Annotated[StrictStr, Field(description="Git provider")], + namespace_id: Annotated[StrictStr, Field(description="Namespace")], + repository_id: Annotated[StrictStr, Field(description="Repository")], + page: Annotated[Optional[StrictInt], Field(description="Page number")] = None, + per_page: Annotated[ + Optional[StrictInt], Field(description="Number of items per page") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[GitPullRequest]]: + """Get Git repository PRs + + Get Git repository PRs + + :param git_provider_id: Git provider (required) + :type git_provider_id: str + :param namespace_id: Namespace (required) + :type namespace_id: str + :param repository_id: Repository (required) + :type repository_id: str + :param page: Page number + :type page: int + :param per_page: Number of items per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_repo_prs_serialize( + git_provider_id=git_provider_id, + namespace_id=namespace_id, + repository_id=repository_id, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[GitPullRequest]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_repo_prs_without_preload_content( + self, + git_provider_id: Annotated[StrictStr, Field(description="Git provider")], + namespace_id: Annotated[StrictStr, Field(description="Namespace")], + repository_id: Annotated[StrictStr, Field(description="Repository")], + page: Annotated[Optional[StrictInt], Field(description="Page number")] = None, + per_page: Annotated[ + Optional[StrictInt], Field(description="Number of items per page") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Git repository PRs + + Get Git repository PRs + + :param git_provider_id: Git provider (required) + :type git_provider_id: str + :param namespace_id: Namespace (required) + :type namespace_id: str + :param repository_id: Repository (required) + :type repository_id: str + :param page: Page number + :type page: int + :param per_page: Number of items per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_repo_prs_serialize( + git_provider_id=git_provider_id, + namespace_id=namespace_id, + repository_id=repository_id, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[GitPullRequest]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_repo_prs_serialize( + self, + git_provider_id, + namespace_id, + repository_id, + page, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if git_provider_id is not None: + _path_params["gitProviderId"] = git_provider_id + if namespace_id is not None: + _path_params["namespaceId"] = namespace_id + if repository_id is not None: + _path_params["repositoryId"] = repository_id + # process the query parameters + if page is not None: + + _query_params.append(("page", page)) + + if per_page is not None: + + _query_params.append(("per_page", per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/gitprovider/{gitProviderId}/{namespaceId}/{repositoryId}/pull-requests", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_repositories( + self, + git_provider_id: Annotated[StrictStr, Field(description="Git provider")], + namespace_id: Annotated[StrictStr, Field(description="Namespace")], + page: Annotated[Optional[StrictInt], Field(description="Page number")] = None, + per_page: Annotated[ + Optional[StrictInt], Field(description="Number of items per page") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[GitRepository]: + """Get Git repositories + + Get Git repositories + + :param git_provider_id: Git provider (required) + :type git_provider_id: str + :param namespace_id: Namespace (required) + :type namespace_id: str + :param page: Page number + :type page: int + :param per_page: Number of items per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_repositories_serialize( + git_provider_id=git_provider_id, + namespace_id=namespace_id, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[GitRepository]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_repositories_with_http_info( + self, + git_provider_id: Annotated[StrictStr, Field(description="Git provider")], + namespace_id: Annotated[StrictStr, Field(description="Namespace")], + page: Annotated[Optional[StrictInt], Field(description="Page number")] = None, + per_page: Annotated[ + Optional[StrictInt], Field(description="Number of items per page") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[GitRepository]]: + """Get Git repositories + + Get Git repositories + + :param git_provider_id: Git provider (required) + :type git_provider_id: str + :param namespace_id: Namespace (required) + :type namespace_id: str + :param page: Page number + :type page: int + :param per_page: Number of items per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_repositories_serialize( + git_provider_id=git_provider_id, + namespace_id=namespace_id, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[GitRepository]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_repositories_without_preload_content( + self, + git_provider_id: Annotated[StrictStr, Field(description="Git provider")], + namespace_id: Annotated[StrictStr, Field(description="Namespace")], + page: Annotated[Optional[StrictInt], Field(description="Page number")] = None, + per_page: Annotated[ + Optional[StrictInt], Field(description="Number of items per page") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Git repositories + + Get Git repositories + + :param git_provider_id: Git provider (required) + :type git_provider_id: str + :param namespace_id: Namespace (required) + :type namespace_id: str + :param page: Page number + :type page: int + :param per_page: Number of items per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_repositories_serialize( + git_provider_id=git_provider_id, + namespace_id=namespace_id, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[GitRepository]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_repositories_serialize( + self, + git_provider_id, + namespace_id, + page, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if git_provider_id is not None: + _path_params["gitProviderId"] = git_provider_id + if namespace_id is not None: + _path_params["namespaceId"] = namespace_id + # process the query parameters + if page is not None: + + _query_params.append(("page", page)) + + if per_page is not None: + + _query_params.append(("per_page", per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/gitprovider/{gitProviderId}/{namespaceId}/repositories", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_url_from_repository( + self, + repository: Annotated[GitRepository, Field(description="Git repository")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RepositoryUrl: + """Get URL from Git repository + + Get URL from Git repository + + :param repository: Git repository (required) + :type repository: GitRepository + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_url_from_repository_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "RepositoryUrl", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_url_from_repository_with_http_info( + self, + repository: Annotated[GitRepository, Field(description="Git repository")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RepositoryUrl]: + """Get URL from Git repository + + Get URL from Git repository + + :param repository: Git repository (required) + :type repository: GitRepository + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_url_from_repository_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "RepositoryUrl", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_url_from_repository_without_preload_content( + self, + repository: Annotated[GitRepository, Field(description="Git repository")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get URL from Git repository + + Get URL from Git repository + + :param repository: Git repository (required) + :type repository: GitRepository + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_url_from_repository_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "RepositoryUrl", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_url_from_repository_serialize( + self, + repository, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if repository is not None: + _body_params = repository + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/gitprovider/context/url", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_git_providers( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[GitProvider]: + """List Git providers + + List Git providers + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_git_providers_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[GitProvider]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_git_providers_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[GitProvider]]: + """List Git providers + + List Git providers + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_git_providers_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[GitProvider]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_git_providers_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Git providers + + List Git providers + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_git_providers_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[GitProvider]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _list_git_providers_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/gitprovider", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_git_providers_for_url( + self, + url: Annotated[StrictStr, Field(description="Url")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[GitProvider]: + """List Git providers for url + + List Git providers for url + + :param url: Url (required) + :type url: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_git_providers_for_url_serialize( + url=url, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[GitProvider]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_git_providers_for_url_with_http_info( + self, + url: Annotated[StrictStr, Field(description="Url")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[GitProvider]]: + """List Git providers for url + + List Git providers for url + + :param url: Url (required) + :type url: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_git_providers_for_url_serialize( + url=url, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[GitProvider]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_git_providers_for_url_without_preload_content( + self, + url: Annotated[StrictStr, Field(description="Url")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Git providers for url + + List Git providers for url + + :param url: Url (required) + :type url: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_git_providers_for_url_serialize( + url=url, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[GitProvider]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _list_git_providers_for_url_serialize( + self, + url, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if url is not None: + _path_params["url"] = url + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/gitprovider/for-url/{url}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def remove_git_provider( + self, + git_provider_id: Annotated[StrictStr, Field(description="Git provider")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Remove Git provider + + Remove Git provider + + :param git_provider_id: Git provider (required) + :type git_provider_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_git_provider_serialize( + git_provider_id=git_provider_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def remove_git_provider_with_http_info( + self, + git_provider_id: Annotated[StrictStr, Field(description="Git provider")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Remove Git provider + + Remove Git provider + + :param git_provider_id: Git provider (required) + :type git_provider_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_git_provider_serialize( + git_provider_id=git_provider_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def remove_git_provider_without_preload_content( + self, + git_provider_id: Annotated[StrictStr, Field(description="Git provider")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Remove Git provider + + Remove Git provider + + :param git_provider_id: Git provider (required) + :type git_provider_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_git_provider_serialize( + git_provider_id=git_provider_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _remove_git_provider_serialize( + self, + git_provider_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if git_provider_id is not None: + _path_params["gitProviderId"] = git_provider_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/gitprovider/{gitProviderId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def set_git_provider( + self, + git_provider_config: Annotated[ + SetGitProviderConfig, Field(description="Git provider") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Set Git provider + + Set Git provider + + :param git_provider_config: Git provider (required) + :type git_provider_config: SetGitProviderConfig + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_git_provider_serialize( + git_provider_config=git_provider_config, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def set_git_provider_with_http_info( + self, + git_provider_config: Annotated[ + SetGitProviderConfig, Field(description="Git provider") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Set Git provider + + Set Git provider + + :param git_provider_config: Git provider (required) + :type git_provider_config: SetGitProviderConfig + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_git_provider_serialize( + git_provider_config=git_provider_config, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def set_git_provider_without_preload_content( + self, + git_provider_config: Annotated[ + SetGitProviderConfig, Field(description="Git provider") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Set Git provider + + Set Git provider + + :param git_provider_config: Git provider (required) + :type git_provider_config: SetGitProviderConfig + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_git_provider_serialize( + git_provider_config=git_provider_config, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _set_git_provider_serialize( + self, + git_provider_config, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if git_provider_config is not None: + _body_params = git_provider_config + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="PUT", + resource_path="/gitprovider", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/packages/python/src/api_client/api/prebuild_api.py b/packages/python/src/api_client/api/prebuild_api.py new file mode 100644 index 0000000..c0d9359 --- /dev/null +++ b/packages/python/src/api_client/api/prebuild_api.py @@ -0,0 +1,1529 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBool, StrictStr +from typing import Any, Dict, List, Optional +from typing_extensions import Annotated +from api_client.models.create_prebuild_dto import CreatePrebuildDTO +from api_client.models.prebuild_dto import PrebuildDTO + +from api_client.api_client import ApiClient, RequestSerialized +from api_client.api_response import ApiResponse +from api_client.rest import RESTResponseType + + +class PrebuildApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @validate_call + def delete_prebuild( + self, + config_name: Annotated[StrictStr, Field(description="Project config name")], + prebuild_id: Annotated[StrictStr, Field(description="Prebuild ID")], + force: Annotated[Optional[StrictBool], Field(description="Force")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete prebuild + + Delete prebuild + + :param config_name: Project config name (required) + :type config_name: str + :param prebuild_id: Prebuild ID (required) + :type prebuild_id: str + :param force: Force + :type force: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_prebuild_serialize( + config_name=config_name, + prebuild_id=prebuild_id, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def delete_prebuild_with_http_info( + self, + config_name: Annotated[StrictStr, Field(description="Project config name")], + prebuild_id: Annotated[StrictStr, Field(description="Prebuild ID")], + force: Annotated[Optional[StrictBool], Field(description="Force")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete prebuild + + Delete prebuild + + :param config_name: Project config name (required) + :type config_name: str + :param prebuild_id: Prebuild ID (required) + :type prebuild_id: str + :param force: Force + :type force: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_prebuild_serialize( + config_name=config_name, + prebuild_id=prebuild_id, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def delete_prebuild_without_preload_content( + self, + config_name: Annotated[StrictStr, Field(description="Project config name")], + prebuild_id: Annotated[StrictStr, Field(description="Prebuild ID")], + force: Annotated[Optional[StrictBool], Field(description="Force")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete prebuild + + Delete prebuild + + :param config_name: Project config name (required) + :type config_name: str + :param prebuild_id: Prebuild ID (required) + :type prebuild_id: str + :param force: Force + :type force: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_prebuild_serialize( + config_name=config_name, + prebuild_id=prebuild_id, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _delete_prebuild_serialize( + self, + config_name, + prebuild_id, + force, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if config_name is not None: + _path_params["configName"] = config_name + if prebuild_id is not None: + _path_params["prebuildId"] = prebuild_id + # process the query parameters + if force is not None: + + _query_params.append(("force", force)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/project-config/{configName}/prebuild/{prebuildId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_prebuild( + self, + config_name: Annotated[StrictStr, Field(description="Project config name")], + prebuild_id: Annotated[StrictStr, Field(description="Prebuild ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PrebuildDTO: + """Get prebuild + + Get prebuild + + :param config_name: Project config name (required) + :type config_name: str + :param prebuild_id: Prebuild ID (required) + :type prebuild_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_prebuild_serialize( + config_name=config_name, + prebuild_id=prebuild_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PrebuildDTO", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_prebuild_with_http_info( + self, + config_name: Annotated[StrictStr, Field(description="Project config name")], + prebuild_id: Annotated[StrictStr, Field(description="Prebuild ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PrebuildDTO]: + """Get prebuild + + Get prebuild + + :param config_name: Project config name (required) + :type config_name: str + :param prebuild_id: Prebuild ID (required) + :type prebuild_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_prebuild_serialize( + config_name=config_name, + prebuild_id=prebuild_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PrebuildDTO", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_prebuild_without_preload_content( + self, + config_name: Annotated[StrictStr, Field(description="Project config name")], + prebuild_id: Annotated[StrictStr, Field(description="Prebuild ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get prebuild + + Get prebuild + + :param config_name: Project config name (required) + :type config_name: str + :param prebuild_id: Prebuild ID (required) + :type prebuild_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_prebuild_serialize( + config_name=config_name, + prebuild_id=prebuild_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PrebuildDTO", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_prebuild_serialize( + self, + config_name, + prebuild_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if config_name is not None: + _path_params["configName"] = config_name + if prebuild_id is not None: + _path_params["prebuildId"] = prebuild_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/project-config/{configName}/prebuild/{prebuildId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_prebuilds( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[PrebuildDTO]: + """List prebuilds + + List prebuilds + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_prebuilds_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[PrebuildDTO]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_prebuilds_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[PrebuildDTO]]: + """List prebuilds + + List prebuilds + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_prebuilds_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[PrebuildDTO]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_prebuilds_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List prebuilds + + List prebuilds + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_prebuilds_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[PrebuildDTO]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _list_prebuilds_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/project-config/prebuild", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_prebuilds_for_project_config( + self, + config_name: Annotated[StrictStr, Field(description="Config name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[PrebuildDTO]: + """List prebuilds for project config + + List prebuilds for project config + + :param config_name: Config name (required) + :type config_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_prebuilds_for_project_config_serialize( + config_name=config_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[PrebuildDTO]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_prebuilds_for_project_config_with_http_info( + self, + config_name: Annotated[StrictStr, Field(description="Config name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[PrebuildDTO]]: + """List prebuilds for project config + + List prebuilds for project config + + :param config_name: Config name (required) + :type config_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_prebuilds_for_project_config_serialize( + config_name=config_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[PrebuildDTO]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_prebuilds_for_project_config_without_preload_content( + self, + config_name: Annotated[StrictStr, Field(description="Config name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List prebuilds for project config + + List prebuilds for project config + + :param config_name: Config name (required) + :type config_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_prebuilds_for_project_config_serialize( + config_name=config_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[PrebuildDTO]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _list_prebuilds_for_project_config_serialize( + self, + config_name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if config_name is not None: + _path_params["configName"] = config_name + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/project-config/{configName}/prebuild", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def process_git_event( + self, + workspace: Annotated[Dict[str, Any], Field(description="Webhook event")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """ProcessGitEvent + + ProcessGitEvent + + :param workspace: Webhook event (required) + :type workspace: object + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._process_git_event_serialize( + workspace=workspace, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def process_git_event_with_http_info( + self, + workspace: Annotated[Dict[str, Any], Field(description="Webhook event")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """ProcessGitEvent + + ProcessGitEvent + + :param workspace: Webhook event (required) + :type workspace: object + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._process_git_event_serialize( + workspace=workspace, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def process_git_event_without_preload_content( + self, + workspace: Annotated[Dict[str, Any], Field(description="Webhook event")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """ProcessGitEvent + + ProcessGitEvent + + :param workspace: Webhook event (required) + :type workspace: object + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._process_git_event_serialize( + workspace=workspace, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _process_git_event_serialize( + self, + workspace, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if workspace is not None: + _body_params = workspace + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/project-config/prebuild/process-git-event", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def set_prebuild( + self, + config_name: Annotated[StrictStr, Field(description="Config name")], + prebuild: Annotated[CreatePrebuildDTO, Field(description="Prebuild")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> str: + """Set prebuild + + Set prebuild + + :param config_name: Config name (required) + :type config_name: str + :param prebuild: Prebuild (required) + :type prebuild: CreatePrebuildDTO + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_prebuild_serialize( + config_name=config_name, + prebuild=prebuild, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "str", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def set_prebuild_with_http_info( + self, + config_name: Annotated[StrictStr, Field(description="Config name")], + prebuild: Annotated[CreatePrebuildDTO, Field(description="Prebuild")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[str]: + """Set prebuild + + Set prebuild + + :param config_name: Config name (required) + :type config_name: str + :param prebuild: Prebuild (required) + :type prebuild: CreatePrebuildDTO + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_prebuild_serialize( + config_name=config_name, + prebuild=prebuild, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "str", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def set_prebuild_without_preload_content( + self, + config_name: Annotated[StrictStr, Field(description="Config name")], + prebuild: Annotated[CreatePrebuildDTO, Field(description="Prebuild")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Set prebuild + + Set prebuild + + :param config_name: Config name (required) + :type config_name: str + :param prebuild: Prebuild (required) + :type prebuild: CreatePrebuildDTO + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_prebuild_serialize( + config_name=config_name, + prebuild=prebuild, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "str", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _set_prebuild_serialize( + self, + config_name, + prebuild, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if config_name is not None: + _path_params["configName"] = config_name + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if prebuild is not None: + _body_params = prebuild + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="PUT", + resource_path="/project-config/{configName}/prebuild", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/packages/python/src/api_client/api/profile_api.py b/packages/python/src/api_client/api/profile_api.py new file mode 100644 index 0000000..b0ea860 --- /dev/null +++ b/packages/python/src/api_client/api/profile_api.py @@ -0,0 +1,730 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field +from typing_extensions import Annotated +from api_client.models.profile_data import ProfileData + +from api_client.api_client import ApiClient, RequestSerialized +from api_client.api_response import ApiResponse +from api_client.rest import RESTResponseType + + +class ProfileApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @validate_call + def delete_profile_data( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete profile data + + Delete profile data + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_profile_data_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def delete_profile_data_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete profile data + + Delete profile data + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_profile_data_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def delete_profile_data_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete profile data + + Delete profile data + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_profile_data_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _delete_profile_data_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/profile", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_profile_data( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ProfileData: + """Get profile data + + Get profile data + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_profile_data_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ProfileData", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_profile_data_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ProfileData]: + """Get profile data + + Get profile data + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_profile_data_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ProfileData", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_profile_data_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get profile data + + Get profile data + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_profile_data_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ProfileData", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_profile_data_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/profile", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def set_profile_data( + self, + profile_data: Annotated[ProfileData, Field(description="Profile data")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Set profile data + + Set profile data + + :param profile_data: Profile data (required) + :type profile_data: ProfileData + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_profile_data_serialize( + profile_data=profile_data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def set_profile_data_with_http_info( + self, + profile_data: Annotated[ProfileData, Field(description="Profile data")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Set profile data + + Set profile data + + :param profile_data: Profile data (required) + :type profile_data: ProfileData + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_profile_data_serialize( + profile_data=profile_data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def set_profile_data_without_preload_content( + self, + profile_data: Annotated[ProfileData, Field(description="Profile data")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Set profile data + + Set profile data + + :param profile_data: Profile data (required) + :type profile_data: ProfileData + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_profile_data_serialize( + profile_data=profile_data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _set_profile_data_serialize( + self, + profile_data, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if profile_data is not None: + _body_params = profile_data + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="PUT", + resource_path="/profile", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/packages/python/src/api_client/api/project_config_api.py b/packages/python/src/api_client/api/project_config_api.py new file mode 100644 index 0000000..bd164cb --- /dev/null +++ b/packages/python/src/api_client/api/project_config_api.py @@ -0,0 +1,1490 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBool, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from api_client.models.create_project_config_dto import CreateProjectConfigDTO +from api_client.models.project_config import ProjectConfig + +from api_client.api_client import ApiClient, RequestSerialized +from api_client.api_response import ApiResponse +from api_client.rest import RESTResponseType + + +class ProjectConfigApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @validate_call + def delete_project_config( + self, + config_name: Annotated[StrictStr, Field(description="Config name")], + force: Annotated[Optional[StrictBool], Field(description="Force")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete project config data + + Delete project config data + + :param config_name: Config name (required) + :type config_name: str + :param force: Force + :type force: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_project_config_serialize( + config_name=config_name, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def delete_project_config_with_http_info( + self, + config_name: Annotated[StrictStr, Field(description="Config name")], + force: Annotated[Optional[StrictBool], Field(description="Force")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete project config data + + Delete project config data + + :param config_name: Config name (required) + :type config_name: str + :param force: Force + :type force: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_project_config_serialize( + config_name=config_name, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def delete_project_config_without_preload_content( + self, + config_name: Annotated[StrictStr, Field(description="Config name")], + force: Annotated[Optional[StrictBool], Field(description="Force")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete project config data + + Delete project config data + + :param config_name: Config name (required) + :type config_name: str + :param force: Force + :type force: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_project_config_serialize( + config_name=config_name, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _delete_project_config_serialize( + self, + config_name, + force, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if config_name is not None: + _path_params["configName"] = config_name + # process the query parameters + if force is not None: + + _query_params.append(("force", force)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/project-config/{configName}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_default_project_config( + self, + git_url: Annotated[StrictStr, Field(description="Git URL")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ProjectConfig: + """Get project configs by git url + + Get project configs by git url + + :param git_url: Git URL (required) + :type git_url: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_default_project_config_serialize( + git_url=git_url, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ProjectConfig", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_default_project_config_with_http_info( + self, + git_url: Annotated[StrictStr, Field(description="Git URL")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ProjectConfig]: + """Get project configs by git url + + Get project configs by git url + + :param git_url: Git URL (required) + :type git_url: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_default_project_config_serialize( + git_url=git_url, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ProjectConfig", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_default_project_config_without_preload_content( + self, + git_url: Annotated[StrictStr, Field(description="Git URL")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get project configs by git url + + Get project configs by git url + + :param git_url: Git URL (required) + :type git_url: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_default_project_config_serialize( + git_url=git_url, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ProjectConfig", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_default_project_config_serialize( + self, + git_url, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if git_url is not None: + _path_params["gitUrl"] = git_url + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/project-config/default/{gitUrl}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_project_config( + self, + config_name: Annotated[StrictStr, Field(description="Config name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ProjectConfig: + """Get project config data + + Get project config data + + :param config_name: Config name (required) + :type config_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_project_config_serialize( + config_name=config_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ProjectConfig", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_project_config_with_http_info( + self, + config_name: Annotated[StrictStr, Field(description="Config name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ProjectConfig]: + """Get project config data + + Get project config data + + :param config_name: Config name (required) + :type config_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_project_config_serialize( + config_name=config_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ProjectConfig", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_project_config_without_preload_content( + self, + config_name: Annotated[StrictStr, Field(description="Config name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get project config data + + Get project config data + + :param config_name: Config name (required) + :type config_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_project_config_serialize( + config_name=config_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ProjectConfig", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_project_config_serialize( + self, + config_name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if config_name is not None: + _path_params["configName"] = config_name + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/project-config/{configName}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_project_configs( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ProjectConfig]: + """List project configs + + List project configs + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_project_configs_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[ProjectConfig]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_project_configs_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ProjectConfig]]: + """List project configs + + List project configs + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_project_configs_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[ProjectConfig]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_project_configs_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List project configs + + List project configs + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_project_configs_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[ProjectConfig]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _list_project_configs_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/project-config", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def set_default_project_config( + self, + config_name: Annotated[StrictStr, Field(description="Config name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Set project config to default + + Set project config to default + + :param config_name: Config name (required) + :type config_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_default_project_config_serialize( + config_name=config_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def set_default_project_config_with_http_info( + self, + config_name: Annotated[StrictStr, Field(description="Config name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Set project config to default + + Set project config to default + + :param config_name: Config name (required) + :type config_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_default_project_config_serialize( + config_name=config_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def set_default_project_config_without_preload_content( + self, + config_name: Annotated[StrictStr, Field(description="Config name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Set project config to default + + Set project config to default + + :param config_name: Config name (required) + :type config_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_default_project_config_serialize( + config_name=config_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _set_default_project_config_serialize( + self, + config_name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if config_name is not None: + _path_params["configName"] = config_name + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="PATCH", + resource_path="/project-config/{configName}/set-default", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def set_project_config( + self, + project_config: Annotated[ + CreateProjectConfigDTO, Field(description="Project config") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Set project config data + + Set project config data + + :param project_config: Project config (required) + :type project_config: CreateProjectConfigDTO + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_project_config_serialize( + project_config=project_config, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def set_project_config_with_http_info( + self, + project_config: Annotated[ + CreateProjectConfigDTO, Field(description="Project config") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Set project config data + + Set project config data + + :param project_config: Project config (required) + :type project_config: CreateProjectConfigDTO + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_project_config_serialize( + project_config=project_config, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def set_project_config_without_preload_content( + self, + project_config: Annotated[ + CreateProjectConfigDTO, Field(description="Project config") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Set project config data + + Set project config data + + :param project_config: Project config (required) + :type project_config: CreateProjectConfigDTO + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_project_config_serialize( + project_config=project_config, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _set_project_config_serialize( + self, + project_config, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if project_config is not None: + _body_params = project_config + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="PUT", + resource_path="/project-config", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/packages/python/src/api_client/api/provider_api.py b/packages/python/src/api_client/api/provider_api.py new file mode 100644 index 0000000..31ba5c8 --- /dev/null +++ b/packages/python/src/api_client/api/provider_api.py @@ -0,0 +1,998 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import Dict, List +from typing_extensions import Annotated +from api_client.models.install_provider_request import InstallProviderRequest +from api_client.models.provider import Provider +from api_client.models.provider_provider_target_property import ( + ProviderProviderTargetProperty, +) + +from api_client.api_client import ApiClient, RequestSerialized +from api_client.api_response import ApiResponse +from api_client.rest import RESTResponseType + + +class ProviderApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @validate_call + def get_target_manifest( + self, + provider: Annotated[StrictStr, Field(description="Provider name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Dict[str, ProviderProviderTargetProperty]: + """Get provider target manifest + + Get provider target manifest + + :param provider: Provider name (required) + :type provider: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_target_manifest_serialize( + provider=provider, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Dict[str, ProviderProviderTargetProperty]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_target_manifest_with_http_info( + self, + provider: Annotated[StrictStr, Field(description="Provider name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Dict[str, ProviderProviderTargetProperty]]: + """Get provider target manifest + + Get provider target manifest + + :param provider: Provider name (required) + :type provider: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_target_manifest_serialize( + provider=provider, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Dict[str, ProviderProviderTargetProperty]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_target_manifest_without_preload_content( + self, + provider: Annotated[StrictStr, Field(description="Provider name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get provider target manifest + + Get provider target manifest + + :param provider: Provider name (required) + :type provider: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_target_manifest_serialize( + provider=provider, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Dict[str, ProviderProviderTargetProperty]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_target_manifest_serialize( + self, + provider, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if provider is not None: + _path_params["provider"] = provider + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["*/*"]) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/provider/{provider}/target-manifest", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def install_provider( + self, + provider: Annotated[ + InstallProviderRequest, Field(description="Provider to install") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Install a provider + + Install a provider + + :param provider: Provider to install (required) + :type provider: InstallProviderRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._install_provider_serialize( + provider=provider, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def install_provider_with_http_info( + self, + provider: Annotated[ + InstallProviderRequest, Field(description="Provider to install") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Install a provider + + Install a provider + + :param provider: Provider to install (required) + :type provider: InstallProviderRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._install_provider_serialize( + provider=provider, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def install_provider_without_preload_content( + self, + provider: Annotated[ + InstallProviderRequest, Field(description="Provider to install") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Install a provider + + Install a provider + + :param provider: Provider to install (required) + :type provider: InstallProviderRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._install_provider_serialize( + provider=provider, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _install_provider_serialize( + self, + provider, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if provider is not None: + _body_params = provider + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/provider/install", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_providers( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[Provider]: + """List providers + + List providers + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_providers_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[Provider]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_providers_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[Provider]]: + """List providers + + List providers + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_providers_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[Provider]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_providers_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List providers + + List providers + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_providers_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[Provider]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _list_providers_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/provider", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def uninstall_provider( + self, + provider: Annotated[StrictStr, Field(description="Provider to uninstall")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Uninstall a provider + + Uninstall a provider + + :param provider: Provider to uninstall (required) + :type provider: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._uninstall_provider_serialize( + provider=provider, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def uninstall_provider_with_http_info( + self, + provider: Annotated[StrictStr, Field(description="Provider to uninstall")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Uninstall a provider + + Uninstall a provider + + :param provider: Provider to uninstall (required) + :type provider: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._uninstall_provider_serialize( + provider=provider, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def uninstall_provider_without_preload_content( + self, + provider: Annotated[StrictStr, Field(description="Provider to uninstall")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Uninstall a provider + + Uninstall a provider + + :param provider: Provider to uninstall (required) + :type provider: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._uninstall_provider_serialize( + provider=provider, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _uninstall_provider_serialize( + self, + provider, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if provider is not None: + _path_params["provider"] = provider + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/provider/{provider}/uninstall", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/packages/python/src/api_client/api/sample_api.py b/packages/python/src/api_client/api/sample_api.py new file mode 100644 index 0000000..f7da3c8 --- /dev/null +++ b/packages/python/src/api_client/api/sample_api.py @@ -0,0 +1,264 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from typing import List +from api_client.models.sample import Sample + +from api_client.api_client import ApiClient, RequestSerialized +from api_client.api_response import ApiResponse +from api_client.rest import RESTResponseType + + +class SampleApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @validate_call + def list_samples( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[Sample]: + """List samples + + List samples + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_samples_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[Sample]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_samples_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[Sample]]: + """List samples + + List samples + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_samples_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[Sample]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_samples_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List samples + + List samples + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_samples_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[Sample]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _list_samples_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/sample", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/packages/python/src/api_client/api/server_api.py b/packages/python/src/api_client/api/server_api.py new file mode 100644 index 0000000..2720a46 --- /dev/null +++ b/packages/python/src/api_client/api/server_api.py @@ -0,0 +1,973 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import List +from typing_extensions import Annotated +from api_client.models.network_key import NetworkKey +from api_client.models.server_config import ServerConfig + +from api_client.api_client import ApiClient, RequestSerialized +from api_client.api_response import ApiResponse +from api_client.rest import RESTResponseType + + +class ServerApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @validate_call + def generate_network_key( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> NetworkKey: + """Generate a new authentication key + + Generate a new authentication key + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._generate_network_key_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "NetworkKey", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def generate_network_key_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NetworkKey]: + """Generate a new authentication key + + Generate a new authentication key + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._generate_network_key_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "NetworkKey", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def generate_network_key_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Generate a new authentication key + + Generate a new authentication key + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._generate_network_key_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "NetworkKey", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _generate_network_key_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/server/network-key", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_config( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ServerConfig: + """Get the server configuration + + Get the server configuration + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_config_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ServerConfig", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_config_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ServerConfig]: + """Get the server configuration + + Get the server configuration + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_config_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ServerConfig", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_config_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get the server configuration + + Get the server configuration + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_config_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ServerConfig", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_config_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/server/config", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_server_log_files( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[str]: + """List server log files + + List server log files + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_server_log_files_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[str]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_server_log_files_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[str]]: + """List server log files + + List server log files + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_server_log_files_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[str]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_server_log_files_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List server log files + + List server log files + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_server_log_files_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[str]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_server_log_files_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/server/logs", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def set_config( + self, + config: Annotated[ServerConfig, Field(description="Server configuration")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ServerConfig: + """Set the server configuration + + Set the server configuration + + :param config: Server configuration (required) + :type config: ServerConfig + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_config_serialize( + config=config, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ServerConfig", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def set_config_with_http_info( + self, + config: Annotated[ServerConfig, Field(description="Server configuration")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ServerConfig]: + """Set the server configuration + + Set the server configuration + + :param config: Server configuration (required) + :type config: ServerConfig + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_config_serialize( + config=config, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ServerConfig", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def set_config_without_preload_content( + self, + config: Annotated[ServerConfig, Field(description="Server configuration")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Set the server configuration + + Set the server configuration + + :param config: Server configuration (required) + :type config: ServerConfig + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_config_serialize( + config=config, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ServerConfig", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _set_config_serialize( + self, + config, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if config is not None: + _body_params = config + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/server/config", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/packages/python/src/api_client/api/target_api.py b/packages/python/src/api_client/api/target_api.py new file mode 100644 index 0000000..3b85681 --- /dev/null +++ b/packages/python/src/api_client/api/target_api.py @@ -0,0 +1,975 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import List +from typing_extensions import Annotated +from api_client.models.create_provider_target_dto import CreateProviderTargetDTO +from api_client.models.provider_target import ProviderTarget + +from api_client.api_client import ApiClient, RequestSerialized +from api_client.api_response import ApiResponse +from api_client.rest import RESTResponseType + + +class TargetApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @validate_call + def list_targets( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ProviderTarget]: + """List targets + + List targets + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_targets_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[ProviderTarget]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_targets_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ProviderTarget]]: + """List targets + + List targets + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_targets_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[ProviderTarget]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_targets_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List targets + + List targets + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_targets_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[ProviderTarget]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _list_targets_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/target", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def remove_target( + self, + target: Annotated[StrictStr, Field(description="Target name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Remove a target + + Remove a target + + :param target: Target name (required) + :type target: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_target_serialize( + target=target, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def remove_target_with_http_info( + self, + target: Annotated[StrictStr, Field(description="Target name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Remove a target + + Remove a target + + :param target: Target name (required) + :type target: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_target_serialize( + target=target, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def remove_target_without_preload_content( + self, + target: Annotated[StrictStr, Field(description="Target name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Remove a target + + Remove a target + + :param target: Target name (required) + :type target: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_target_serialize( + target=target, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _remove_target_serialize( + self, + target, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if target is not None: + _path_params["target"] = target + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/target/{target}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def set_default_target( + self, + target: Annotated[StrictStr, Field(description="Target name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Set target to default + + Set target to default + + :param target: Target name (required) + :type target: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_default_target_serialize( + target=target, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def set_default_target_with_http_info( + self, + target: Annotated[StrictStr, Field(description="Target name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Set target to default + + Set target to default + + :param target: Target name (required) + :type target: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_default_target_serialize( + target=target, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def set_default_target_without_preload_content( + self, + target: Annotated[StrictStr, Field(description="Target name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Set target to default + + Set target to default + + :param target: Target name (required) + :type target: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_default_target_serialize( + target=target, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _set_default_target_serialize( + self, + target, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if target is not None: + _path_params["target"] = target + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="PATCH", + resource_path="/target/{target}/set-default", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def set_target( + self, + target: Annotated[CreateProviderTargetDTO, Field(description="Target to set")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Set a target + + Set a target + + :param target: Target to set (required) + :type target: CreateProviderTargetDTO + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_target_serialize( + target=target, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def set_target_with_http_info( + self, + target: Annotated[CreateProviderTargetDTO, Field(description="Target to set")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Set a target + + Set a target + + :param target: Target to set (required) + :type target: CreateProviderTargetDTO + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_target_serialize( + target=target, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def set_target_without_preload_content( + self, + target: Annotated[CreateProviderTargetDTO, Field(description="Target to set")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Set a target + + Set a target + + :param target: Target to set (required) + :type target: CreateProviderTargetDTO + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_target_serialize( + target=target, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _set_target_serialize( + self, + target, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if target is not None: + _body_params = target + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="PUT", + resource_path="/target", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/packages/python/src/api_client/api/workspace_api.py b/packages/python/src/api_client/api/workspace_api.py new file mode 100644 index 0000000..e5bf971 --- /dev/null +++ b/packages/python/src/api_client/api/workspace_api.py @@ -0,0 +1,2280 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBool, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from api_client.models.create_workspace_dto import CreateWorkspaceDTO +from api_client.models.set_project_state import SetProjectState +from api_client.models.workspace import Workspace +from api_client.models.workspace_dto import WorkspaceDTO + +from api_client.api_client import ApiClient, RequestSerialized +from api_client.api_response import ApiResponse +from api_client.rest import RESTResponseType + + +class WorkspaceApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @validate_call + def create_workspace( + self, + workspace: Annotated[CreateWorkspaceDTO, Field(description="Create workspace")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Workspace: + """Create a workspace + + Create a workspace + + :param workspace: Create workspace (required) + :type workspace: CreateWorkspaceDTO + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_workspace_serialize( + workspace=workspace, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Workspace", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def create_workspace_with_http_info( + self, + workspace: Annotated[CreateWorkspaceDTO, Field(description="Create workspace")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Workspace]: + """Create a workspace + + Create a workspace + + :param workspace: Create workspace (required) + :type workspace: CreateWorkspaceDTO + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_workspace_serialize( + workspace=workspace, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Workspace", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def create_workspace_without_preload_content( + self, + workspace: Annotated[CreateWorkspaceDTO, Field(description="Create workspace")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a workspace + + Create a workspace + + :param workspace: Create workspace (required) + :type workspace: CreateWorkspaceDTO + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_workspace_serialize( + workspace=workspace, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Workspace", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _create_workspace_serialize( + self, + workspace, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if workspace is not None: + _body_params = workspace + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/workspace", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_workspace( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + verbose: Annotated[Optional[StrictBool], Field(description="Verbose")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WorkspaceDTO: + """Get workspace info + + Get workspace info + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param verbose: Verbose + :type verbose: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_workspace_serialize( + workspace_id=workspace_id, + verbose=verbose, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "WorkspaceDTO", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_workspace_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + verbose: Annotated[Optional[StrictBool], Field(description="Verbose")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WorkspaceDTO]: + """Get workspace info + + Get workspace info + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param verbose: Verbose + :type verbose: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_workspace_serialize( + workspace_id=workspace_id, + verbose=verbose, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "WorkspaceDTO", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_workspace_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + verbose: Annotated[Optional[StrictBool], Field(description="Verbose")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get workspace info + + Get workspace info + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param verbose: Verbose + :type verbose: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_workspace_serialize( + workspace_id=workspace_id, + verbose=verbose, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "WorkspaceDTO", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_workspace_serialize( + self, + workspace_id, + verbose, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + # process the query parameters + if verbose is not None: + + _query_params.append(("verbose", verbose)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/workspace/{workspaceId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_workspaces( + self, + verbose: Annotated[Optional[StrictBool], Field(description="Verbose")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[WorkspaceDTO]: + """List workspaces + + List workspaces + + :param verbose: Verbose + :type verbose: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_workspaces_serialize( + verbose=verbose, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[WorkspaceDTO]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_workspaces_with_http_info( + self, + verbose: Annotated[Optional[StrictBool], Field(description="Verbose")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[WorkspaceDTO]]: + """List workspaces + + List workspaces + + :param verbose: Verbose + :type verbose: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_workspaces_serialize( + verbose=verbose, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[WorkspaceDTO]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_workspaces_without_preload_content( + self, + verbose: Annotated[Optional[StrictBool], Field(description="Verbose")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List workspaces + + List workspaces + + :param verbose: Verbose + :type verbose: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_workspaces_serialize( + verbose=verbose, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[WorkspaceDTO]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _list_workspaces_serialize( + self, + verbose, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if verbose is not None: + + _query_params.append(("verbose", verbose)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/workspace", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def remove_workspace( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID")], + force: Annotated[Optional[StrictBool], Field(description="Force")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Remove workspace + + Remove workspace + + :param workspace_id: Workspace ID (required) + :type workspace_id: str + :param force: Force + :type force: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_workspace_serialize( + workspace_id=workspace_id, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def remove_workspace_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID")], + force: Annotated[Optional[StrictBool], Field(description="Force")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Remove workspace + + Remove workspace + + :param workspace_id: Workspace ID (required) + :type workspace_id: str + :param force: Force + :type force: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_workspace_serialize( + workspace_id=workspace_id, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def remove_workspace_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID")], + force: Annotated[Optional[StrictBool], Field(description="Force")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Remove workspace + + Remove workspace + + :param workspace_id: Workspace ID (required) + :type workspace_id: str + :param force: Force + :type force: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_workspace_serialize( + workspace_id=workspace_id, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _remove_workspace_serialize( + self, + workspace_id, + force, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + # process the query parameters + if force is not None: + + _query_params.append(("force", force)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/workspace/{workspaceId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def set_project_state( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + set_state: Annotated[SetProjectState, Field(description="Set State")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Set project state + + Set project state + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param set_state: Set State (required) + :type set_state: SetProjectState + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_project_state_serialize( + workspace_id=workspace_id, + project_id=project_id, + set_state=set_state, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def set_project_state_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + set_state: Annotated[SetProjectState, Field(description="Set State")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Set project state + + Set project state + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param set_state: Set State (required) + :type set_state: SetProjectState + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_project_state_serialize( + workspace_id=workspace_id, + project_id=project_id, + set_state=set_state, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def set_project_state_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + set_state: Annotated[SetProjectState, Field(description="Set State")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Set project state + + Set project state + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param set_state: Set State (required) + :type set_state: SetProjectState + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_project_state_serialize( + workspace_id=workspace_id, + project_id=project_id, + set_state=set_state, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _set_project_state_serialize( + self, + workspace_id, + project_id, + set_state, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if set_state is not None: + _body_params = set_state + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/workspace/{workspaceId}/{projectId}/state", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def start_project( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Start project + + Start project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._start_project_serialize( + workspace_id=workspace_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def start_project_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Start project + + Start project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._start_project_serialize( + workspace_id=workspace_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def start_project_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Start project + + Start project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._start_project_serialize( + workspace_id=workspace_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _start_project_serialize( + self, + workspace_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/workspace/{workspaceId}/{projectId}/start", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def start_workspace( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Start workspace + + Start workspace + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._start_workspace_serialize( + workspace_id=workspace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def start_workspace_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Start workspace + + Start workspace + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._start_workspace_serialize( + workspace_id=workspace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def start_workspace_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Start workspace + + Start workspace + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._start_workspace_serialize( + workspace_id=workspace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _start_workspace_serialize( + self, + workspace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/workspace/{workspaceId}/start", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def stop_project( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Stop project + + Stop project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stop_project_serialize( + workspace_id=workspace_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def stop_project_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Stop project + + Stop project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stop_project_serialize( + workspace_id=workspace_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def stop_project_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Stop project + + Stop project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stop_project_serialize( + workspace_id=workspace_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _stop_project_serialize( + self, + workspace_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/workspace/{workspaceId}/{projectId}/stop", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def stop_workspace( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Stop workspace + + Stop workspace + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stop_workspace_serialize( + workspace_id=workspace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def stop_workspace_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Stop workspace + + Stop workspace + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stop_workspace_serialize( + workspace_id=workspace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def stop_workspace_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Stop workspace + + Stop workspace + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stop_workspace_serialize( + workspace_id=workspace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _stop_workspace_serialize( + self, + workspace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/workspace/{workspaceId}/stop", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/packages/python/src/api_client/api/workspace_toolbox_api.py b/packages/python/src/api_client/api/workspace_toolbox_api.py new file mode 100644 index 0000000..77b272f --- /dev/null +++ b/packages/python/src/api_client/api/workspace_toolbox_api.py @@ -0,0 +1,8106 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBytes, StrictStr +from typing import List, Optional, Tuple, Union +from typing_extensions import Annotated +from api_client.models.completion_list import CompletionList +from api_client.models.execute_request import ExecuteRequest +from api_client.models.execute_response import ExecuteResponse +from api_client.models.file_info import FileInfo +from api_client.models.git_add_request import GitAddRequest +from api_client.models.git_branch_request import GitBranchRequest +from api_client.models.git_clone_request import GitCloneRequest +from api_client.models.git_commit_info import GitCommitInfo +from api_client.models.git_commit_request import GitCommitRequest +from api_client.models.git_commit_response import GitCommitResponse +from api_client.models.git_repo_request import GitRepoRequest +from api_client.models.git_status import GitStatus +from api_client.models.list_branch_response import ListBranchResponse +from api_client.models.lsp_completion_params import LspCompletionParams +from api_client.models.lsp_document_request import LspDocumentRequest +from api_client.models.lsp_server_request import LspServerRequest +from api_client.models.lsp_symbol import LspSymbol +from api_client.models.match import Match +from api_client.models.project_dir_response import ProjectDirResponse +from api_client.models.replace_request import ReplaceRequest +from api_client.models.replace_result import ReplaceResult +from api_client.models.search_files_response import SearchFilesResponse + +from api_client.api_client import ApiClient, RequestSerialized +from api_client.api_response import ApiResponse +from api_client.rest import RESTResponseType + + +class WorkspaceToolboxApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @validate_call + def fs_create_folder( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[StrictStr, Field(description="Path")], + mode: Annotated[StrictStr, Field(description="Mode")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Create folder + + Create folder inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path (required) + :type path: str + :param mode: Mode (required) + :type mode: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fs_create_folder_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + mode=mode, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def fs_create_folder_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[StrictStr, Field(description="Path")], + mode: Annotated[StrictStr, Field(description="Mode")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Create folder + + Create folder inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path (required) + :type path: str + :param mode: Mode (required) + :type mode: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fs_create_folder_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + mode=mode, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def fs_create_folder_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[StrictStr, Field(description="Path")], + mode: Annotated[StrictStr, Field(description="Mode")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create folder + + Create folder inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path (required) + :type path: str + :param mode: Mode (required) + :type mode: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fs_create_folder_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + mode=mode, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _fs_create_folder_serialize( + self, + workspace_id, + project_id, + path, + mode, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + if path is not None: + + _query_params.append(("path", path)) + + if mode is not None: + + _query_params.append(("mode", mode)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/workspace/{workspaceId}/{projectId}/toolbox/files/folder", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def fs_delete_file( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[StrictStr, Field(description="Path")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete file + + Delete file inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path (required) + :type path: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fs_delete_file_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def fs_delete_file_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[StrictStr, Field(description="Path")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete file + + Delete file inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path (required) + :type path: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fs_delete_file_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def fs_delete_file_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[StrictStr, Field(description="Path")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete file + + Delete file inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path (required) + :type path: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fs_delete_file_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _fs_delete_file_serialize( + self, + workspace_id, + project_id, + path, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + if path is not None: + + _query_params.append(("path", path)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/workspace/{workspaceId}/{projectId}/toolbox/files", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def fs_download_file( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[StrictStr, Field(description="Path")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bytearray: + """Download file + + Download file from workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path (required) + :type path: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fs_download_file_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "bytearray", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def fs_download_file_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[StrictStr, Field(description="Path")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bytearray]: + """Download file + + Download file from workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path (required) + :type path: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fs_download_file_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "bytearray", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def fs_download_file_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[StrictStr, Field(description="Path")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Download file + + Download file from workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path (required) + :type path: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fs_download_file_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "bytearray", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _fs_download_file_serialize( + self, + workspace_id, + project_id, + path, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + if path is not None: + + _query_params.append(("path", path)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/workspace/{workspaceId}/{projectId}/toolbox/files/download", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def fs_find_in_files( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[StrictStr, Field(description="Path")], + pattern: Annotated[StrictStr, Field(description="Pattern")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[Match]: + """Search for text/pattern in files + + Search for text/pattern inside workspace project files + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path (required) + :type path: str + :param pattern: Pattern (required) + :type pattern: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fs_find_in_files_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + pattern=pattern, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[Match]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def fs_find_in_files_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[StrictStr, Field(description="Path")], + pattern: Annotated[StrictStr, Field(description="Pattern")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[Match]]: + """Search for text/pattern in files + + Search for text/pattern inside workspace project files + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path (required) + :type path: str + :param pattern: Pattern (required) + :type pattern: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fs_find_in_files_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + pattern=pattern, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[Match]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def fs_find_in_files_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[StrictStr, Field(description="Path")], + pattern: Annotated[StrictStr, Field(description="Pattern")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Search for text/pattern in files + + Search for text/pattern inside workspace project files + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path (required) + :type path: str + :param pattern: Pattern (required) + :type pattern: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fs_find_in_files_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + pattern=pattern, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[Match]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _fs_find_in_files_serialize( + self, + workspace_id, + project_id, + path, + pattern, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + if path is not None: + + _query_params.append(("path", path)) + + if pattern is not None: + + _query_params.append(("pattern", pattern)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/workspace/{workspaceId}/{projectId}/toolbox/files/find", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def fs_get_file_details( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[StrictStr, Field(description="Path")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> FileInfo: + """Get file info + + Get file info inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path (required) + :type path: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fs_get_file_details_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "FileInfo", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def fs_get_file_details_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[StrictStr, Field(description="Path")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FileInfo]: + """Get file info + + Get file info inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path (required) + :type path: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fs_get_file_details_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "FileInfo", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def fs_get_file_details_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[StrictStr, Field(description="Path")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get file info + + Get file info inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path (required) + :type path: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fs_get_file_details_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "FileInfo", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _fs_get_file_details_serialize( + self, + workspace_id, + project_id, + path, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + if path is not None: + + _query_params.append(("path", path)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/workspace/{workspaceId}/{projectId}/toolbox/files/info", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def fs_list_files( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[Optional[StrictStr], Field(description="Path")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[FileInfo]: + """List files + + List files inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path + :type path: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fs_list_files_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[FileInfo]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def fs_list_files_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[Optional[StrictStr], Field(description="Path")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[FileInfo]]: + """List files + + List files inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path + :type path: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fs_list_files_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[FileInfo]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def fs_list_files_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[Optional[StrictStr], Field(description="Path")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List files + + List files inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path + :type path: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fs_list_files_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[FileInfo]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _fs_list_files_serialize( + self, + workspace_id, + project_id, + path, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + if path is not None: + + _query_params.append(("path", path)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/workspace/{workspaceId}/{projectId}/toolbox/files", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def fs_move_file( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + source: Annotated[StrictStr, Field(description="Source path")], + destination: Annotated[StrictStr, Field(description="Destination path")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Create folder + + Create folder inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param source: Source path (required) + :type source: str + :param destination: Destination path (required) + :type destination: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fs_move_file_serialize( + workspace_id=workspace_id, + project_id=project_id, + source=source, + destination=destination, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def fs_move_file_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + source: Annotated[StrictStr, Field(description="Source path")], + destination: Annotated[StrictStr, Field(description="Destination path")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Create folder + + Create folder inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param source: Source path (required) + :type source: str + :param destination: Destination path (required) + :type destination: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fs_move_file_serialize( + workspace_id=workspace_id, + project_id=project_id, + source=source, + destination=destination, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def fs_move_file_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + source: Annotated[StrictStr, Field(description="Source path")], + destination: Annotated[StrictStr, Field(description="Destination path")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create folder + + Create folder inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param source: Source path (required) + :type source: str + :param destination: Destination path (required) + :type destination: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fs_move_file_serialize( + workspace_id=workspace_id, + project_id=project_id, + source=source, + destination=destination, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _fs_move_file_serialize( + self, + workspace_id, + project_id, + source, + destination, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + if source is not None: + + _query_params.append(("source", source)) + + if destination is not None: + + _query_params.append(("destination", destination)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/workspace/{workspaceId}/{projectId}/toolbox/files/move", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def fs_replace_in_files( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + replace: Annotated[ReplaceRequest, Field(description="ReplaceParams")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ReplaceResult]: + """Repleace text/pattern in files + + Repleace text/pattern in mutilple files inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param replace: ReplaceParams (required) + :type replace: ReplaceRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fs_replace_in_files_serialize( + workspace_id=workspace_id, + project_id=project_id, + replace=replace, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[ReplaceResult]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def fs_replace_in_files_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + replace: Annotated[ReplaceRequest, Field(description="ReplaceParams")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ReplaceResult]]: + """Repleace text/pattern in files + + Repleace text/pattern in mutilple files inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param replace: ReplaceParams (required) + :type replace: ReplaceRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fs_replace_in_files_serialize( + workspace_id=workspace_id, + project_id=project_id, + replace=replace, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[ReplaceResult]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def fs_replace_in_files_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + replace: Annotated[ReplaceRequest, Field(description="ReplaceParams")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Repleace text/pattern in files + + Repleace text/pattern in mutilple files inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param replace: ReplaceParams (required) + :type replace: ReplaceRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fs_replace_in_files_serialize( + workspace_id=workspace_id, + project_id=project_id, + replace=replace, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[ReplaceResult]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _fs_replace_in_files_serialize( + self, + workspace_id, + project_id, + replace, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if replace is not None: + _body_params = replace + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/workspace/{workspaceId}/{projectId}/toolbox/files/replace", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def fs_search_files( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[StrictStr, Field(description="Path")], + pattern: Annotated[StrictStr, Field(description="Pattern")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SearchFilesResponse: + """Search for files + + Search for files inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path (required) + :type path: str + :param pattern: Pattern (required) + :type pattern: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fs_search_files_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + pattern=pattern, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SearchFilesResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def fs_search_files_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[StrictStr, Field(description="Path")], + pattern: Annotated[StrictStr, Field(description="Pattern")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SearchFilesResponse]: + """Search for files + + Search for files inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path (required) + :type path: str + :param pattern: Pattern (required) + :type pattern: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fs_search_files_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + pattern=pattern, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SearchFilesResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def fs_search_files_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[StrictStr, Field(description="Path")], + pattern: Annotated[StrictStr, Field(description="Pattern")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Search for files + + Search for files inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path (required) + :type path: str + :param pattern: Pattern (required) + :type pattern: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fs_search_files_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + pattern=pattern, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SearchFilesResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _fs_search_files_serialize( + self, + workspace_id, + project_id, + path, + pattern, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + if path is not None: + + _query_params.append(("path", path)) + + if pattern is not None: + + _query_params.append(("pattern", pattern)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/workspace/{workspaceId}/{projectId}/toolbox/files/search", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def fs_set_file_permissions( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[StrictStr, Field(description="Path")], + owner: Annotated[Optional[StrictStr], Field(description="Owner")] = None, + group: Annotated[Optional[StrictStr], Field(description="Group")] = None, + mode: Annotated[Optional[StrictStr], Field(description="Mode")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Set file owner/group/permissions + + Set file owner/group/permissions inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path (required) + :type path: str + :param owner: Owner + :type owner: str + :param group: Group + :type group: str + :param mode: Mode + :type mode: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fs_set_file_permissions_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + owner=owner, + group=group, + mode=mode, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def fs_set_file_permissions_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[StrictStr, Field(description="Path")], + owner: Annotated[Optional[StrictStr], Field(description="Owner")] = None, + group: Annotated[Optional[StrictStr], Field(description="Group")] = None, + mode: Annotated[Optional[StrictStr], Field(description="Mode")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Set file owner/group/permissions + + Set file owner/group/permissions inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path (required) + :type path: str + :param owner: Owner + :type owner: str + :param group: Group + :type group: str + :param mode: Mode + :type mode: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fs_set_file_permissions_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + owner=owner, + group=group, + mode=mode, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def fs_set_file_permissions_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[StrictStr, Field(description="Path")], + owner: Annotated[Optional[StrictStr], Field(description="Owner")] = None, + group: Annotated[Optional[StrictStr], Field(description="Group")] = None, + mode: Annotated[Optional[StrictStr], Field(description="Mode")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Set file owner/group/permissions + + Set file owner/group/permissions inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path (required) + :type path: str + :param owner: Owner + :type owner: str + :param group: Group + :type group: str + :param mode: Mode + :type mode: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fs_set_file_permissions_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + owner=owner, + group=group, + mode=mode, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _fs_set_file_permissions_serialize( + self, + workspace_id, + project_id, + path, + owner, + group, + mode, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + if path is not None: + + _query_params.append(("path", path)) + + if owner is not None: + + _query_params.append(("owner", owner)) + + if group is not None: + + _query_params.append(("group", group)) + + if mode is not None: + + _query_params.append(("mode", mode)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/workspace/{workspaceId}/{projectId}/toolbox/files/permissions", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def fs_upload_file( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[StrictStr, Field(description="Path")], + file: Annotated[ + Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], + Field(description="File"), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Upload file + + Upload file inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path (required) + :type path: str + :param file: File (required) + :type file: bytearray + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fs_upload_file_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + file=file, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def fs_upload_file_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[StrictStr, Field(description="Path")], + file: Annotated[ + Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], + Field(description="File"), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Upload file + + Upload file inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path (required) + :type path: str + :param file: File (required) + :type file: bytearray + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fs_upload_file_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + file=file, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def fs_upload_file_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[StrictStr, Field(description="Path")], + file: Annotated[ + Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], + Field(description="File"), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Upload file + + Upload file inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path (required) + :type path: str + :param file: File (required) + :type file: bytearray + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fs_upload_file_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + file=file, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _fs_upload_file_serialize( + self, + workspace_id, + project_id, + path, + file, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + if path is not None: + + _query_params.append(("path", path)) + + # process the header parameters + # process the form parameters + if file is not None: + _files["file"] = file + # process the body parameter + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["multipart/form-data"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/workspace/{workspaceId}/{projectId}/toolbox/files/upload", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_project_dir( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ProjectDirResponse: + """Get project dir + + Get project directory + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_project_dir_serialize( + workspace_id=workspace_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ProjectDirResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_project_dir_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ProjectDirResponse]: + """Get project dir + + Get project directory + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_project_dir_serialize( + workspace_id=workspace_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ProjectDirResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_project_dir_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get project dir + + Get project directory + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_project_dir_serialize( + workspace_id=workspace_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ProjectDirResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_project_dir_serialize( + self, + workspace_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/workspace/{workspaceId}/{projectId}/toolbox/project-dir", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def git_add_files( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[GitAddRequest, Field(description="GitAddRequest")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Add files + + Add files to git commit + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: GitAddRequest (required) + :type params: GitAddRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._git_add_files_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def git_add_files_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[GitAddRequest, Field(description="GitAddRequest")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Add files + + Add files to git commit + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: GitAddRequest (required) + :type params: GitAddRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._git_add_files_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def git_add_files_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[GitAddRequest, Field(description="GitAddRequest")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Add files + + Add files to git commit + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: GitAddRequest (required) + :type params: GitAddRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._git_add_files_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _git_add_files_serialize( + self, + workspace_id, + project_id, + params, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if params is not None: + _body_params = params + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/workspace/{workspaceId}/{projectId}/toolbox/git/add", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def git_branch_list( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[StrictStr, Field(description="Path to git repository")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListBranchResponse: + """Get branch list + + Get branch list from git repository inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path to git repository (required) + :type path: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._git_branch_list_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListBranchResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def git_branch_list_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[StrictStr, Field(description="Path to git repository")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListBranchResponse]: + """Get branch list + + Get branch list from git repository inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path to git repository (required) + :type path: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._git_branch_list_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListBranchResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def git_branch_list_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[StrictStr, Field(description="Path to git repository")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get branch list + + Get branch list from git repository inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path to git repository (required) + :type path: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._git_branch_list_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListBranchResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _git_branch_list_serialize( + self, + workspace_id, + project_id, + path, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + if path is not None: + + _query_params.append(("path", path)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/workspace/{workspaceId}/{projectId}/toolbox/git/branches", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def git_clone_repository( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[GitCloneRequest, Field(description="GitCloneRequest")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Clone git repository + + Clone git repository inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: GitCloneRequest (required) + :type params: GitCloneRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._git_clone_repository_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def git_clone_repository_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[GitCloneRequest, Field(description="GitCloneRequest")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Clone git repository + + Clone git repository inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: GitCloneRequest (required) + :type params: GitCloneRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._git_clone_repository_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def git_clone_repository_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[GitCloneRequest, Field(description="GitCloneRequest")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Clone git repository + + Clone git repository inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: GitCloneRequest (required) + :type params: GitCloneRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._git_clone_repository_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _git_clone_repository_serialize( + self, + workspace_id, + project_id, + params, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if params is not None: + _body_params = params + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/workspace/{workspaceId}/{projectId}/toolbox/git/clone", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def git_commit_changes( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[GitCommitRequest, Field(description="GitCommitRequest")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GitCommitResponse: + """Commit changes + + Commit changes to git repository inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: GitCommitRequest (required) + :type params: GitCommitRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._git_commit_changes_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GitCommitResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def git_commit_changes_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[GitCommitRequest, Field(description="GitCommitRequest")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GitCommitResponse]: + """Commit changes + + Commit changes to git repository inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: GitCommitRequest (required) + :type params: GitCommitRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._git_commit_changes_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GitCommitResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def git_commit_changes_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[GitCommitRequest, Field(description="GitCommitRequest")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Commit changes + + Commit changes to git repository inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: GitCommitRequest (required) + :type params: GitCommitRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._git_commit_changes_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GitCommitResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _git_commit_changes_serialize( + self, + workspace_id, + project_id, + params, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if params is not None: + _body_params = params + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/workspace/{workspaceId}/{projectId}/toolbox/git/commit", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def git_commit_history( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[StrictStr, Field(description="Path to git repository")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[GitCommitInfo]: + """Get commit history + + Get commit history from git repository inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path to git repository (required) + :type path: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._git_commit_history_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[GitCommitInfo]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def git_commit_history_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[StrictStr, Field(description="Path to git repository")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[GitCommitInfo]]: + """Get commit history + + Get commit history from git repository inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path to git repository (required) + :type path: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._git_commit_history_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[GitCommitInfo]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def git_commit_history_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[StrictStr, Field(description="Path to git repository")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get commit history + + Get commit history from git repository inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path to git repository (required) + :type path: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._git_commit_history_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[GitCommitInfo]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _git_commit_history_serialize( + self, + workspace_id, + project_id, + path, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + if path is not None: + + _query_params.append(("path", path)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/workspace/{workspaceId}/{projectId}/toolbox/git/history", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def git_create_branch( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[GitBranchRequest, Field(description="GitBranchRequest")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Create branch + + Create branch on git repository inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: GitBranchRequest (required) + :type params: GitBranchRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._git_create_branch_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def git_create_branch_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[GitBranchRequest, Field(description="GitBranchRequest")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Create branch + + Create branch on git repository inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: GitBranchRequest (required) + :type params: GitBranchRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._git_create_branch_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def git_create_branch_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[GitBranchRequest, Field(description="GitBranchRequest")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create branch + + Create branch on git repository inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: GitBranchRequest (required) + :type params: GitBranchRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._git_create_branch_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _git_create_branch_serialize( + self, + workspace_id, + project_id, + params, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if params is not None: + _body_params = params + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/workspace/{workspaceId}/{projectId}/toolbox/git/branches", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def git_git_status( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[StrictStr, Field(description="Path to git repository")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GitStatus: + """Get git status + + Get status from git repository inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path to git repository (required) + :type path: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._git_git_status_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GitStatus", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def git_git_status_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[StrictStr, Field(description="Path to git repository")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GitStatus]: + """Get git status + + Get status from git repository inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path to git repository (required) + :type path: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._git_git_status_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GitStatus", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def git_git_status_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + path: Annotated[StrictStr, Field(description="Path to git repository")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get git status + + Get status from git repository inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param path: Path to git repository (required) + :type path: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._git_git_status_serialize( + workspace_id=workspace_id, + project_id=project_id, + path=path, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GitStatus", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _git_git_status_serialize( + self, + workspace_id, + project_id, + path, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + if path is not None: + + _query_params.append(("path", path)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/workspace/{workspaceId}/{projectId}/toolbox/git/status", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def git_pull_changes( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[GitRepoRequest, Field(description="Git pull request")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Pull changes + + Pull changes from remote to git repository inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: Git pull request (required) + :type params: GitRepoRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._git_pull_changes_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def git_pull_changes_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[GitRepoRequest, Field(description="Git pull request")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Pull changes + + Pull changes from remote to git repository inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: Git pull request (required) + :type params: GitRepoRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._git_pull_changes_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def git_pull_changes_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[GitRepoRequest, Field(description="Git pull request")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Pull changes + + Pull changes from remote to git repository inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: Git pull request (required) + :type params: GitRepoRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._git_pull_changes_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _git_pull_changes_serialize( + self, + workspace_id, + project_id, + params, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if params is not None: + _body_params = params + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/workspace/{workspaceId}/{projectId}/toolbox/git/pull", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def git_push_changes( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[GitRepoRequest, Field(description="Git push request")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Push changes + + Push changes to remote from git repository inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: Git push request (required) + :type params: GitRepoRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._git_push_changes_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def git_push_changes_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[GitRepoRequest, Field(description="Git push request")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Push changes + + Push changes to remote from git repository inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: Git push request (required) + :type params: GitRepoRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._git_push_changes_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def git_push_changes_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[GitRepoRequest, Field(description="Git push request")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Push changes + + Push changes to remote from git repository inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: Git push request (required) + :type params: GitRepoRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._git_push_changes_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _git_push_changes_serialize( + self, + workspace_id, + project_id, + params, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if params is not None: + _body_params = params + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/workspace/{workspaceId}/{projectId}/toolbox/git/push", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def lsp_completions( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[ + LspCompletionParams, Field(description="LspCompletionParams") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CompletionList: + """Get Lsp Completions + + The Completion request is sent from the client to the server to compute completion items at a given cursor position. + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: LspCompletionParams (required) + :type params: LspCompletionParams + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._lsp_completions_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "CompletionList", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def lsp_completions_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[ + LspCompletionParams, Field(description="LspCompletionParams") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CompletionList]: + """Get Lsp Completions + + The Completion request is sent from the client to the server to compute completion items at a given cursor position. + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: LspCompletionParams (required) + :type params: LspCompletionParams + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._lsp_completions_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "CompletionList", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def lsp_completions_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[ + LspCompletionParams, Field(description="LspCompletionParams") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Lsp Completions + + The Completion request is sent from the client to the server to compute completion items at a given cursor position. + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: LspCompletionParams (required) + :type params: LspCompletionParams + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._lsp_completions_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "CompletionList", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _lsp_completions_serialize( + self, + workspace_id, + project_id, + params, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if params is not None: + _body_params = params + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/workspace/{workspaceId}/{projectId}/toolbox/lsp/completions", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def lsp_did_close( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[LspDocumentRequest, Field(description="LspDocumentRequest")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Call Lsp DidClose + + The document close notification is sent from the client to the server when the document got closed in the client. + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: LspDocumentRequest (required) + :type params: LspDocumentRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._lsp_did_close_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def lsp_did_close_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[LspDocumentRequest, Field(description="LspDocumentRequest")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Call Lsp DidClose + + The document close notification is sent from the client to the server when the document got closed in the client. + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: LspDocumentRequest (required) + :type params: LspDocumentRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._lsp_did_close_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def lsp_did_close_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[LspDocumentRequest, Field(description="LspDocumentRequest")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Call Lsp DidClose + + The document close notification is sent from the client to the server when the document got closed in the client. + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: LspDocumentRequest (required) + :type params: LspDocumentRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._lsp_did_close_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _lsp_did_close_serialize( + self, + workspace_id, + project_id, + params, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if params is not None: + _body_params = params + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/workspace/{workspaceId}/{projectId}/toolbox/lsp/did-close", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def lsp_did_open( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[LspDocumentRequest, Field(description="LspDocumentRequest")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Call Lsp DidOpen + + The document open notification is sent from the client to the server to signal newly opened text documents. + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: LspDocumentRequest (required) + :type params: LspDocumentRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._lsp_did_open_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def lsp_did_open_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[LspDocumentRequest, Field(description="LspDocumentRequest")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Call Lsp DidOpen + + The document open notification is sent from the client to the server to signal newly opened text documents. + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: LspDocumentRequest (required) + :type params: LspDocumentRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._lsp_did_open_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def lsp_did_open_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[LspDocumentRequest, Field(description="LspDocumentRequest")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Call Lsp DidOpen + + The document open notification is sent from the client to the server to signal newly opened text documents. + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: LspDocumentRequest (required) + :type params: LspDocumentRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._lsp_did_open_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _lsp_did_open_serialize( + self, + workspace_id, + project_id, + params, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if params is not None: + _body_params = params + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/workspace/{workspaceId}/{projectId}/toolbox/lsp/did-open", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def lsp_document_symbols( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + language_id: Annotated[StrictStr, Field(description="Language ID")], + path_to_project: Annotated[StrictStr, Field(description="Path to project")], + uri: Annotated[StrictStr, Field(description="Document Uri")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[LspSymbol]: + """Call Lsp DocumentSymbols + + The document symbol request is sent from the client to the server. + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param language_id: Language ID (required) + :type language_id: str + :param path_to_project: Path to project (required) + :type path_to_project: str + :param uri: Document Uri (required) + :type uri: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._lsp_document_symbols_serialize( + workspace_id=workspace_id, + project_id=project_id, + language_id=language_id, + path_to_project=path_to_project, + uri=uri, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[LspSymbol]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def lsp_document_symbols_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + language_id: Annotated[StrictStr, Field(description="Language ID")], + path_to_project: Annotated[StrictStr, Field(description="Path to project")], + uri: Annotated[StrictStr, Field(description="Document Uri")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[LspSymbol]]: + """Call Lsp DocumentSymbols + + The document symbol request is sent from the client to the server. + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param language_id: Language ID (required) + :type language_id: str + :param path_to_project: Path to project (required) + :type path_to_project: str + :param uri: Document Uri (required) + :type uri: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._lsp_document_symbols_serialize( + workspace_id=workspace_id, + project_id=project_id, + language_id=language_id, + path_to_project=path_to_project, + uri=uri, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[LspSymbol]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def lsp_document_symbols_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + language_id: Annotated[StrictStr, Field(description="Language ID")], + path_to_project: Annotated[StrictStr, Field(description="Path to project")], + uri: Annotated[StrictStr, Field(description="Document Uri")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Call Lsp DocumentSymbols + + The document symbol request is sent from the client to the server. + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param language_id: Language ID (required) + :type language_id: str + :param path_to_project: Path to project (required) + :type path_to_project: str + :param uri: Document Uri (required) + :type uri: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._lsp_document_symbols_serialize( + workspace_id=workspace_id, + project_id=project_id, + language_id=language_id, + path_to_project=path_to_project, + uri=uri, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[LspSymbol]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _lsp_document_symbols_serialize( + self, + workspace_id, + project_id, + language_id, + path_to_project, + uri, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + if language_id is not None: + + _query_params.append(("languageId", language_id)) + + if path_to_project is not None: + + _query_params.append(("pathToProject", path_to_project)) + + if uri is not None: + + _query_params.append(("uri", uri)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/workspace/{workspaceId}/{projectId}/toolbox/lsp/document-symbols", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def lsp_start( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[LspServerRequest, Field(description="LspServerRequest")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Start Lsp server + + Start Lsp server process inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: LspServerRequest (required) + :type params: LspServerRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._lsp_start_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def lsp_start_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[LspServerRequest, Field(description="LspServerRequest")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Start Lsp server + + Start Lsp server process inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: LspServerRequest (required) + :type params: LspServerRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._lsp_start_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def lsp_start_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[LspServerRequest, Field(description="LspServerRequest")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Start Lsp server + + Start Lsp server process inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: LspServerRequest (required) + :type params: LspServerRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._lsp_start_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _lsp_start_serialize( + self, + workspace_id, + project_id, + params, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if params is not None: + _body_params = params + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/workspace/{workspaceId}/{projectId}/toolbox/lsp/start", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def lsp_stop( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[LspServerRequest, Field(description="LspServerRequest")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Stop Lsp server + + Stop Lsp server process inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: LspServerRequest (required) + :type params: LspServerRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._lsp_stop_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def lsp_stop_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[LspServerRequest, Field(description="LspServerRequest")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Stop Lsp server + + Stop Lsp server process inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: LspServerRequest (required) + :type params: LspServerRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._lsp_stop_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def lsp_stop_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[LspServerRequest, Field(description="LspServerRequest")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Stop Lsp server + + Stop Lsp server process inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: LspServerRequest (required) + :type params: LspServerRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._lsp_stop_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _lsp_stop_serialize( + self, + workspace_id, + project_id, + params, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if params is not None: + _body_params = params + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/workspace/{workspaceId}/{projectId}/toolbox/lsp/stop", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def lsp_workspace_symbols( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + language_id: Annotated[StrictStr, Field(description="Language ID")], + path_to_project: Annotated[StrictStr, Field(description="Path to project")], + query: Annotated[StrictStr, Field(description="Symbol Query")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[LspSymbol]: + """Call Lsp WorkspaceSymbols + + The workspace symbol request is sent from the client to the server to list project-wide symbols matching the query string. + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param language_id: Language ID (required) + :type language_id: str + :param path_to_project: Path to project (required) + :type path_to_project: str + :param query: Symbol Query (required) + :type query: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._lsp_workspace_symbols_serialize( + workspace_id=workspace_id, + project_id=project_id, + language_id=language_id, + path_to_project=path_to_project, + query=query, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[LspSymbol]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def lsp_workspace_symbols_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + language_id: Annotated[StrictStr, Field(description="Language ID")], + path_to_project: Annotated[StrictStr, Field(description="Path to project")], + query: Annotated[StrictStr, Field(description="Symbol Query")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[LspSymbol]]: + """Call Lsp WorkspaceSymbols + + The workspace symbol request is sent from the client to the server to list project-wide symbols matching the query string. + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param language_id: Language ID (required) + :type language_id: str + :param path_to_project: Path to project (required) + :type path_to_project: str + :param query: Symbol Query (required) + :type query: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._lsp_workspace_symbols_serialize( + workspace_id=workspace_id, + project_id=project_id, + language_id=language_id, + path_to_project=path_to_project, + query=query, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[LspSymbol]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def lsp_workspace_symbols_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + language_id: Annotated[StrictStr, Field(description="Language ID")], + path_to_project: Annotated[StrictStr, Field(description="Path to project")], + query: Annotated[StrictStr, Field(description="Symbol Query")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Call Lsp WorkspaceSymbols + + The workspace symbol request is sent from the client to the server to list project-wide symbols matching the query string. + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param language_id: Language ID (required) + :type language_id: str + :param path_to_project: Path to project (required) + :type path_to_project: str + :param query: Symbol Query (required) + :type query: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._lsp_workspace_symbols_serialize( + workspace_id=workspace_id, + project_id=project_id, + language_id=language_id, + path_to_project=path_to_project, + query=query, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "List[LspSymbol]", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _lsp_workspace_symbols_serialize( + self, + workspace_id, + project_id, + language_id, + path_to_project, + query, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + if language_id is not None: + + _query_params.append(("languageId", language_id)) + + if path_to_project is not None: + + _query_params.append(("pathToProject", path_to_project)) + + if query is not None: + + _query_params.append(("query", query)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/workspace/{workspaceId}/{projectId}/toolbox/lsp/workspace-symbols", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def process_execute_command( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[ExecuteRequest, Field(description="Execute command request")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ExecuteResponse: + """Execute command + + Execute command synchronously inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: Execute command request (required) + :type params: ExecuteRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._process_execute_command_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ExecuteResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def process_execute_command_with_http_info( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[ExecuteRequest, Field(description="Execute command request")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ExecuteResponse]: + """Execute command + + Execute command synchronously inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: Execute command request (required) + :type params: ExecuteRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._process_execute_command_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ExecuteResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def process_execute_command_without_preload_content( + self, + workspace_id: Annotated[StrictStr, Field(description="Workspace ID or Name")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + params: Annotated[ExecuteRequest, Field(description="Execute command request")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Execute command + + Execute command synchronously inside workspace project + + :param workspace_id: Workspace ID or Name (required) + :type workspace_id: str + :param project_id: Project ID (required) + :type project_id: str + :param params: Execute command request (required) + :type params: ExecuteRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._process_execute_command_serialize( + workspace_id=workspace_id, + project_id=project_id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ExecuteResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _process_execute_command_serialize( + self, + workspace_id, + project_id, + params, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params["workspaceId"] = workspace_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if params is not None: + _body_params = params + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/workspace/{workspaceId}/{projectId}/toolbox/process/execute", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/packages/python/src/api_client/api_client.py b/packages/python/src/api_client/api_client.py new file mode 100644 index 0000000..c1f09f2 --- /dev/null +++ b/packages/python/src/api_client/api_client.py @@ -0,0 +1,755 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import datetime +from dateutil.parser import parse +from enum import Enum +import decimal +import json +import mimetypes +import os +import re +import tempfile + +from urllib.parse import quote +from typing import Tuple, Optional, List, Dict, Union +from pydantic import SecretStr + +from api_client.configuration import Configuration +from api_client.api_response import ApiResponse, T as ApiResponseT +import api_client.models +from api_client import rest +from api_client.exceptions import ( + ApiValueError, + ApiException, + BadRequestException, + UnauthorizedException, + ForbiddenException, + NotFoundException, + ServiceException, +) + +RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] + + +class ApiClient: + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + """ + + PRIMITIVE_TYPES = (float, bool, bytes, str, int) + NATIVE_TYPES_MAPPING = { + "int": int, + "long": int, # TODO remove as only py3 is supported? + "float": float, + "str": str, + "bool": bool, + "date": datetime.date, + "datetime": datetime.datetime, + "decimal": decimal.Decimal, + "object": object, + } + _pool = None + + def __init__( + self, configuration=None, header_name=None, header_value=None, cookie=None + ) -> None: + # use default configuration if none is provided + if configuration is None: + configuration = Configuration.get_default() + self.configuration = configuration + + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = "OpenAPI-Generator/1.0.0/python" + self.client_side_validation = configuration.client_side_validation + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + pass + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers["User-Agent"] + + @user_agent.setter + def user_agent(self, value): + self.default_headers["User-Agent"] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + _default = None + + @classmethod + def get_default(cls): + """Return new instance of ApiClient. + + This method returns newly created, based on default constructor, + object of ApiClient class or returns a copy of default + ApiClient. + + :return: The ApiClient object. + """ + if cls._default is None: + cls._default = ApiClient() + return cls._default + + @classmethod + def set_default(cls, default): + """Set default instance of ApiClient. + + It stores default ApiClient. + + :param default: object of ApiClient. + """ + cls._default = default + + def param_serialize( + self, + method, + resource_path, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, + auth_settings=None, + collection_formats=None, + _host=None, + _request_auth=None, + ) -> RequestSerialized: + """Builds the HTTP request params needed by the request. + :param method: Method to call. + :param resource_path: Path to method endpoint. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :return: tuple of form (path, http_method, query_params, header_params, + body, post_params, files) + """ + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params["Cookie"] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict( + self.parameters_to_tuples(header_params, collection_formats) + ) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples(path_params, collection_formats) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + "{%s}" % k, quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # post parameters + if post_params or files: + post_params = post_params if post_params else [] + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples(post_params, collection_formats) + if files: + post_params.extend(self.files_parameters(files)) + + # auth setting + self.update_params_for_auth( + header_params, + query_params, + auth_settings, + resource_path, + method, + body, + request_auth=_request_auth, + ) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + if _host is None or self.configuration.ignore_operation_servers: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + url_query = self.parameters_to_url_query(query_params, collection_formats) + url += "?" + url_query + + return method, url, header_params, body, post_params + + def call_api( + self, + method, + url, + header_params=None, + body=None, + post_params=None, + _request_timeout=None, + ) -> rest.RESTResponse: + """Makes the HTTP request (synchronous) + :param method: Method to call. + :param url: Path to method endpoint. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param _request_timeout: timeout setting for this request. + :return: RESTResponse + """ + + try: + # perform request and return response + response_data = self.rest_client.request( + method, + url, + headers=header_params, + body=body, + post_params=post_params, + _request_timeout=_request_timeout, + ) + + except ApiException as e: + raise e + + return response_data + + def response_deserialize( + self, + response_data: rest.RESTResponse, + response_types_map: Optional[Dict[str, ApiResponseT]] = None, + ) -> ApiResponse[ApiResponseT]: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse + """ + + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg + + response_type = response_types_map.get(str(response_data.status), None) + if ( + not response_type + and isinstance(response_data.status, int) + and 100 <= response_data.status <= 599 + ): + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get( + str(response_data.status)[0] + "XX", None + ) + + # deserialize response data + response_text = None + return_data = None + try: + if response_type == "bytearray": + return_data = response_data.data + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + elif response_type is not None: + match = None + content_type = response_data.getheader("content-type") + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_text = response_data.data.decode(encoding) + return_data = self.deserialize( + response_text, response_type, content_type + ) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) + + return ApiResponse( + status_code=response_data.status, + data=return_data, + headers=response_data.getheaders(), + raw_data=response_data.data, + ) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is SecretStr, return obj.get_secret_value() + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is OpenAPI model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, Enum): + return obj.value + elif isinstance(obj, SecretStr): + return obj.get_secret_value() + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [self.sanitize_for_serialization(sub_obj) for sub_obj in obj] + elif isinstance(obj, tuple): + return tuple(self.sanitize_for_serialization(sub_obj) for sub_obj in obj) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + elif isinstance(obj, decimal.Decimal): + return str(obj) + + elif isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + if hasattr(obj, "to_dict") and callable(getattr(obj, "to_dict")): + obj_dict = obj.to_dict() + else: + obj_dict = obj.__dict__ + + return { + key: self.sanitize_for_serialization(val) for key, val in obj_dict.items() + } + + def deserialize( + self, response_text: str, response_type: str, content_type: Optional[str] + ): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + :param content_type: content type of response. + + :return: deserialized object. + """ + + # fetch data from response object + if content_type is None: + try: + data = json.loads(response_text) + except ValueError: + data = response_text + elif re.match( + r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", + content_type, + re.IGNORECASE, + ): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): + data = response_text + else: + raise ApiException( + status=0, reason="Unsupported content type: {0}".format(content_type) + ) + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if isinstance(klass, str): + if klass.startswith("List["): + m = re.match(r"List\[(.*)]", klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) + return [self.__deserialize(sub_data, sub_kls) for sub_data in data] + + if klass.startswith("Dict["): + m = re.match(r"Dict\[([^,]*), (.*)]", klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) + return {k: self.__deserialize(v, sub_kls) for k, v in data.items()} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(api_client.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datetime(data) + elif klass == decimal.Decimal: + return decimal.Decimal(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) + else: + return self.__deserialize_model(data, klass) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == "multi": + new_params.extend((k, value) for value in v) + else: + if collection_format == "ssv": + delimiter = " " + elif collection_format == "tsv": + delimiter = "\t" + elif collection_format == "pipes": + delimiter = "|" + else: # csv is the default + delimiter = "," + new_params.append((k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def parameters_to_url_query(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: URL query string (e.g. a=Hello%20World&b=123) + """ + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if isinstance(v, bool): + v = str(v).lower() + if isinstance(v, (int, float)): + v = str(v) + if isinstance(v, dict): + v = json.dumps(v) + + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == "multi": + new_params.extend((k, str(value)) for value in v) + else: + if collection_format == "ssv": + delimiter = " " + elif collection_format == "tsv": + delimiter = "\t" + elif collection_format == "pipes": + delimiter = "|" + else: # csv is the default + delimiter = "," + new_params.append( + (k, delimiter.join(quote(str(value)) for value in v)) + ) + else: + new_params.append((k, quote(str(v)))) + + return "&".join(["=".join(map(str, item)) for item in new_params]) + + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): + """Builds form parameters. + + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + for k, v in files.items(): + if isinstance(v, str): + with open(v, "rb") as f: + filename = os.path.basename(f.name) + filedata = f.read() + elif isinstance(v, bytes): + filename = k + filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue + else: + raise ValueError("Unsupported file value") + mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" + params.append(tuple([k, tuple([filename, filedata, mimetype])])) + return params + + def select_header_accept(self, accepts: List[str]) -> Optional[str]: + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return None + + for accept in accepts: + if re.search("json", accept, re.IGNORECASE): + return accept + + return accepts[0] + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return None + + for content_type in content_types: + if re.search("json", content_type, re.IGNORECASE): + return content_type + + return content_types[0] + + def update_params_for_auth( + self, + headers, + queries, + auth_settings, + resource_path, + method, + body, + request_auth=None, + ) -> None: + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param request_auth: if set, the provided settings will + override the token in the configuration. + """ + if not auth_settings: + return + + if request_auth: + self._apply_auth_params( + headers, queries, resource_path, method, body, request_auth + ) + else: + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params( + headers, queries, resource_path, method, body, auth_setting + ) + + def _apply_auth_params( + self, headers, queries, resource_path, method, body, auth_setting + ) -> None: + """Updates the request parameters based on a single auth_setting + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param auth_setting: auth settings for the endpoint + """ + if auth_setting["in"] == "cookie": + headers["Cookie"] = auth_setting["value"] + elif auth_setting["in"] == "header": + if auth_setting["type"] != "http-signature": + headers[auth_setting["key"]] = auth_setting["value"] + elif auth_setting["in"] == "query": + queries.append((auth_setting["key"], auth_setting["value"])) + else: + raise ApiValueError("Authentication token must be in `query` or `header`") + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + handle file downloading + save response body into a tmp file and return the instance + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + m = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition) + assert m is not None, "Unexpected 'content-disposition' header value" + filename = m.group(1) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return str(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return an original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datetime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=("Failed to parse `{0}` as datetime object".format(string)), + ) + + def __deserialize_enum(self, data, klass): + """Deserializes primitive type to enum. + + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.ApiException( + status=0, reason=("Failed to parse `{0}` as `{1}`".format(data, klass)) + ) + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + return klass.from_dict(data) diff --git a/packages/python/src/api_client/api_response.py b/packages/python/src/api_client/api_response.py new file mode 100644 index 0000000..1ce1372 --- /dev/null +++ b/packages/python/src/api_client/api_response.py @@ -0,0 +1,20 @@ +"""API response object.""" + +from __future__ import annotations +from typing import Optional, Generic, Mapping, TypeVar +from pydantic import Field, StrictInt, StrictBytes, BaseModel + +T = TypeVar("T") + + +class ApiResponse(BaseModel, Generic[T]): + """ + API response object + """ + + status_code: StrictInt = Field(description="HTTP status code") + headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") + data: T = Field(description="Deserialized data given the data type") + raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") + + model_config = {"arbitrary_types_allowed": True} diff --git a/packages/python/src/api_client/configuration.py b/packages/python/src/api_client/configuration.py new file mode 100644 index 0000000..0737dda --- /dev/null +++ b/packages/python/src/api_client/configuration.py @@ -0,0 +1,608 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import copy +import http.client as httplib +import logging +from logging import FileHandler +import multiprocessing +import sys +from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict +from typing_extensions import NotRequired, Self + +import urllib3 + + +JSON_SCHEMA_VALIDATION_KEYWORDS = { + "multipleOf", + "maximum", + "exclusiveMaximum", + "minimum", + "exclusiveMinimum", + "maxLength", + "minLength", + "pattern", + "maxItems", + "minItems", +} + +ServerVariablesT = Dict[str, str] + +GenericAuthSetting = TypedDict( + "GenericAuthSetting", + { + "type": str, + "in": str, + "key": str, + "value": str, + }, +) + + +OAuth2AuthSetting = TypedDict( + "OAuth2AuthSetting", + { + "type": Literal["oauth2"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +APIKeyAuthSetting = TypedDict( + "APIKeyAuthSetting", + { + "type": Literal["api_key"], + "in": str, + "key": str, + "value": Optional[str], + }, +) + + +BasicAuthSetting = TypedDict( + "BasicAuthSetting", + { + "type": Literal["basic"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": Optional[str], + }, +) + + +BearerFormatAuthSetting = TypedDict( + "BearerFormatAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "format": Literal["JWT"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +BearerAuthSetting = TypedDict( + "BearerAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +HTTPSignatureAuthSetting = TypedDict( + "HTTPSignatureAuthSetting", + { + "type": Literal["http-signature"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": None, + }, +) + + +AuthSettings = TypedDict( + "AuthSettings", + { + "Bearer": APIKeyAuthSetting, + }, + total=False, +) + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] + + +class Configuration: + """This class contains various settings of the API client. + + :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer). + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication. + :param password: Password for HTTP basic authentication. + :param access_token: Access token. + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum + values before. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format. + :param retries: Number of retries for API requests. + + :Example: + + API Key Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + cookieAuth: # name for the security scheme + type: apiKey + in: cookie + name: JSESSIONID # cookie name + + You can programmatically set the cookie: + + conf = api_client.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} + ) + + The following cookie will be added to the HTTP request: + Cookie: JSESSIONID abc123 + """ + + _default: ClassVar[Optional[Self]] = None + + def __init__( + self, + host: Optional[str] = None, + api_key: Optional[Dict[str, str]] = None, + api_key_prefix: Optional[Dict[str, str]] = None, + username: Optional[str] = None, + password: Optional[str] = None, + access_token: Optional[str] = None, + server_index: Optional[int] = None, + server_variables: Optional[ServerVariablesT] = None, + server_operation_index: Optional[Dict[int, int]] = None, + server_operation_variables: Optional[Dict[int, ServerVariablesT]] = None, + ignore_operation_servers: bool = False, + ssl_ca_cert: Optional[str] = None, + retries: Optional[int] = None, + *, + debug: Optional[bool] = None, + ) -> None: + """Constructor""" + self._base_path = "http://localhost:3986" if host is None else host + """Default Base url + """ + self.server_index = 0 if server_index is None and host is None else server_index + self.server_operation_index = server_operation_index or {} + """Default server index + """ + self.server_variables = server_variables or {} + self.server_operation_variables = server_operation_variables or {} + """Default server variables + """ + self.ignore_operation_servers = ignore_operation_servers + """Ignore operation servers + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.api_key = {} + if api_key: + self.api_key = api_key + """dict to store API key(s) + """ + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix + """dict to store API prefix (e.g. Bearer) + """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + self.access_token = access_token + """Access token + """ + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("api_client") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = "%(asctime)s %(levelname)s %(message)s" + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler: Optional[FileHandler] = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + if debug is not None: + self.debug = debug + else: + self.__debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = ssl_ca_cert + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + self.tls_server_name = None + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ + + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ + + self.proxy: Optional[str] = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = "" + """Safe chars for path_param + """ + self.retries = retries + """Adding retries to override urllib3 default value 3 + """ + # Enable client side validation + self.client_side_validation = True + + self.socket_options = None + """Options to pass down to the underlying urllib3 socket + """ + + self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + """datetime format + """ + + self.date_format = "%Y-%m-%d" + """date format + """ + + def __deepcopy__(self, memo: Dict[int, Any]) -> Self: + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ("logger", "logger_file_handler"): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + def __setattr__(self, name: str, value: Any) -> None: + object.__setattr__(self, name, value) + + @classmethod + def set_default(cls, default: Optional[Self]) -> None: + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ + cls._default = default + + @classmethod + def get_default_copy(cls) -> Self: + """Deprecated. Please use `get_default` instead. + + Deprecated. Please use `get_default` instead. + + :return: The configuration object. + """ + return cls.get_default() + + @classmethod + def get_default(cls) -> Self: + """Return the default configuration. + + This method returns newly created, based on default constructor, + object of Configuration class or returns a copy of default + configuration. + + :return: The configuration object. + """ + if cls._default is None: + cls._default = cls() + return cls._default + + @property + def logger_file(self) -> Optional[str]: + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value: Optional[str]) -> None: + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in self.logger.items(): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self) -> bool: + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value: bool) -> None: + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in self.logger.items(): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in self.logger.items(): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self) -> str: + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value: str) -> None: + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix( + self, identifier: str, alias: Optional[str] = None + ) -> Optional[str]: + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :param alias: The alternative identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get( + identifier, self.api_key.get(alias) if alias is not None else None + ) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + return None + + def get_basic_auth_token(self) -> Optional[str]: + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + username = "" + if self.username is not None: + username = self.username + password = "" + if self.password is not None: + password = self.password + return urllib3.util.make_headers(basic_auth=username + ":" + password).get( + "authorization" + ) + + def auth_settings(self) -> AuthSettings: + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + auth: AuthSettings = {} + if "Bearer" in self.api_key: + auth["Bearer"] = { + "type": "api_key", + "in": "header", + "key": "Authorization", + "value": self.get_api_key_with_prefix( + "Bearer", + ), + } + return auth + + def to_debug_report(self) -> str: + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return ( + "Python SDK Debug Report:\n" + "OS: {env}\n" + "Python Version: {pyversion}\n" + "Version of the API: v0.0.0-dev\n" + "SDK Package Version: 1.0.0".format(env=sys.platform, pyversion=sys.version) + ) + + def get_host_settings(self) -> List[HostSetting]: + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + { + "url": "http://localhost:3986", + "description": "No description provided", + } + ] + + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :param servers: an array of host settings or None + :return: URL based on host settings + """ + if index is None: + return self._base_path + + variables = {} if variables is None else variables + servers = self.get_host_settings() if servers is None else servers + + try: + server = servers[index] + except IndexError: + raise ValueError( + "Invalid index {0} when selecting the host settings. " + "Must be less than {1}".format(index, len(servers)) + ) + + url = server["url"] + + # go through variables and replace placeholders + for variable_name, variable in server.get("variables", {}).items(): + used_value = variables.get(variable_name, variable["default_value"]) + + if "enum_values" in variable and used_value not in variable["enum_values"]: + raise ValueError( + "The variable `{0}` in the host URL has invalid value " + "{1}. Must be {2}.".format( + variable_name, variables[variable_name], variable["enum_values"] + ) + ) + + url = url.replace("{" + variable_name + "}", used_value) + + return url + + @property + def host(self) -> str: + """Return generated host.""" + return self.get_host_from_settings( + self.server_index, variables=self.server_variables + ) + + @host.setter + def host(self, value: str) -> None: + """Fix base path.""" + self._base_path = value + self.server_index = None diff --git a/packages/python/src/api_client/docs/ApiKey.md b/packages/python/src/api_client/docs/ApiKey.md new file mode 100644 index 0000000..c21ef59 --- /dev/null +++ b/packages/python/src/api_client/docs/ApiKey.md @@ -0,0 +1,31 @@ +# ApiKey + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key_hash** | **str** | | +**name** | **str** | Project or client name | +**type** | [**ApikeyApiKeyType**](ApikeyApiKeyType.md) | | + +## Example + +```python +from api_client.models.api_key import ApiKey + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiKey from a JSON string +api_key_instance = ApiKey.from_json(json) +# print the JSON string representation of the object +print(ApiKey.to_json()) + +# convert the object into a dict +api_key_dict = api_key_instance.to_dict() +# create an instance of ApiKey from a dict +api_key_from_dict = ApiKey.from_dict(api_key_dict) +``` +[[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/packages/python/src/api_client/docs/ApiKeyApi.md b/packages/python/src/api_client/docs/ApiKeyApi.md new file mode 100644 index 0000000..695b381 --- /dev/null +++ b/packages/python/src/api_client/docs/ApiKeyApi.md @@ -0,0 +1,240 @@ +# api_client.ApiKeyApi + +All URIs are relative to *http://localhost:3986* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**generate_api_key**](ApiKeyApi.md#generate_api_key) | **POST** /apikey/{apiKeyName} | Generate an API key +[**list_client_api_keys**](ApiKeyApi.md#list_client_api_keys) | **GET** /apikey | List API keys +[**revoke_api_key**](ApiKeyApi.md#revoke_api_key) | **DELETE** /apikey/{apiKeyName} | Revoke API key + + +# **generate_api_key** +> str generate_api_key(api_key_name) + +Generate an API key + +Generate an API key + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.ApiKeyApi(api_client) + api_key_name = 'api_key_name_example' # str | API key name + + try: + # Generate an API key + api_response = api_instance.generate_api_key(api_key_name) + print("The response of ApiKeyApi->generate_api_key:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ApiKeyApi->generate_api_key: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **api_key_name** | **str**| API key name | + +### Return type + +**str** + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **list_client_api_keys** +> List[ApiKey] list_client_api_keys() + +List API keys + +List API keys + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.api_key import ApiKey +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.ApiKeyApi(api_client) + + try: + # List API keys + api_response = api_instance.list_client_api_keys() + print("The response of ApiKeyApi->list_client_api_keys:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ApiKeyApi->list_client_api_keys: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**List[ApiKey]**](ApiKey.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **revoke_api_key** +> revoke_api_key(api_key_name) + +Revoke API key + +Revoke API key + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.ApiKeyApi(api_client) + api_key_name = 'api_key_name_example' # str | API key name + + try: + # Revoke API key + api_instance.revoke_api_key(api_key_name) + except Exception as e: + print("Exception when calling ApiKeyApi->revoke_api_key: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **api_key_name** | **str**| API key name | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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/packages/python/src/api_client/docs/ApikeyApiKeyType.md b/packages/python/src/api_client/docs/ApikeyApiKeyType.md new file mode 100644 index 0000000..7b5cbb8 --- /dev/null +++ b/packages/python/src/api_client/docs/ApikeyApiKeyType.md @@ -0,0 +1,14 @@ +# ApikeyApiKeyType + + +## Enum + +* `CLIENT` (value: `'client'`) + +* `PROJECT` (value: `'project'`) + +* `WORKSPACE` (value: `'workspace'`) + +[[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/packages/python/src/api_client/docs/Build.md b/packages/python/src/api_client/docs/Build.md new file mode 100644 index 0000000..932c14c --- /dev/null +++ b/packages/python/src/api_client/docs/Build.md @@ -0,0 +1,39 @@ +# Build + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**build_config** | [**BuildConfig**](BuildConfig.md) | | [optional] +**container_config** | [**ContainerConfig**](ContainerConfig.md) | | +**created_at** | **str** | | +**env_vars** | **Dict[str, str]** | | +**id** | **str** | | +**image** | **str** | | [optional] +**prebuild_id** | **str** | | +**repository** | [**GitRepository**](GitRepository.md) | | +**state** | [**BuildBuildState**](BuildBuildState.md) | | +**updated_at** | **str** | | +**user** | **str** | | [optional] + +## Example + +```python +from api_client.models.build import Build + +# TODO update the JSON string below +json = "{}" +# create an instance of Build from a JSON string +build_instance = Build.from_json(json) +# print the JSON string representation of the object +print(Build.to_json()) + +# convert the object into a dict +build_dict = build_instance.to_dict() +# create an instance of Build from a dict +build_from_dict = Build.from_dict(build_dict) +``` +[[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/packages/python/src/api_client/docs/BuildApi.md b/packages/python/src/api_client/docs/BuildApi.md new file mode 100644 index 0000000..8485a58 --- /dev/null +++ b/packages/python/src/api_client/docs/BuildApi.md @@ -0,0 +1,479 @@ +# api_client.BuildApi + +All URIs are relative to *http://localhost:3986* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_build**](BuildApi.md#create_build) | **POST** /build | Create a build +[**delete_all_builds**](BuildApi.md#delete_all_builds) | **DELETE** /build | Delete ALL builds +[**delete_build**](BuildApi.md#delete_build) | **DELETE** /build/{buildId} | Delete build +[**delete_builds_from_prebuild**](BuildApi.md#delete_builds_from_prebuild) | **DELETE** /build/prebuild/{prebuildId} | Delete builds +[**get_build**](BuildApi.md#get_build) | **GET** /build/{buildId} | Get build data +[**list_builds**](BuildApi.md#list_builds) | **GET** /build | List builds + + +# **create_build** +> str create_build(create_build_dto) + +Create a build + +Create a build + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.create_build_dto import CreateBuildDTO +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.BuildApi(api_client) + create_build_dto = api_client.CreateBuildDTO() # CreateBuildDTO | Create Build DTO + + try: + # Create a build + api_response = api_instance.create_build(create_build_dto) + print("The response of BuildApi->create_build:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BuildApi->create_build: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **create_build_dto** | [**CreateBuildDTO**](CreateBuildDTO.md)| Create Build DTO | + +### Return type + +**str** + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | + +[[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) + +# **delete_all_builds** +> delete_all_builds(force=force) + +Delete ALL builds + +Delete ALL builds + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.BuildApi(api_client) + force = True # bool | Force (optional) + + try: + # Delete ALL builds + api_instance.delete_all_builds(force=force) + except Exception as e: + print("Exception when calling BuildApi->delete_all_builds: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **force** | **bool**| Force | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No Content | - | + +[[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) + +# **delete_build** +> delete_build(build_id, force=force) + +Delete build + +Delete build + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.BuildApi(api_client) + build_id = 'build_id_example' # str | Build ID + force = True # bool | Force (optional) + + try: + # Delete build + api_instance.delete_build(build_id, force=force) + except Exception as e: + print("Exception when calling BuildApi->delete_build: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **build_id** | **str**| Build ID | + **force** | **bool**| Force | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No Content | - | + +[[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) + +# **delete_builds_from_prebuild** +> delete_builds_from_prebuild(prebuild_id, force=force) + +Delete builds + +Delete builds + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.BuildApi(api_client) + prebuild_id = 'prebuild_id_example' # str | Prebuild ID + force = True # bool | Force (optional) + + try: + # Delete builds + api_instance.delete_builds_from_prebuild(prebuild_id, force=force) + except Exception as e: + print("Exception when calling BuildApi->delete_builds_from_prebuild: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **prebuild_id** | **str**| Prebuild ID | + **force** | **bool**| Force | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No Content | - | + +[[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) + +# **get_build** +> Build get_build(build_id) + +Get build data + +Get build data + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.build import Build +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.BuildApi(api_client) + build_id = 'build_id_example' # str | Build ID + + try: + # Get build data + api_response = api_instance.get_build(build_id) + print("The response of BuildApi->get_build:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BuildApi->get_build: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **build_id** | **str**| Build ID | + +### Return type + +[**Build**](Build.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **list_builds** +> List[Build] list_builds() + +List builds + +List builds + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.build import Build +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.BuildApi(api_client) + + try: + # List builds + api_response = api_instance.list_builds() + print("The response of BuildApi->list_builds:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BuildApi->list_builds: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**List[Build]**](Build.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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/packages/python/src/api_client/docs/BuildBuildState.md b/packages/python/src/api_client/docs/BuildBuildState.md new file mode 100644 index 0000000..97835ba --- /dev/null +++ b/packages/python/src/api_client/docs/BuildBuildState.md @@ -0,0 +1,24 @@ +# BuildBuildState + + +## Enum + +* `PENDING_MINUS_RUN` (value: `'pending-run'`) + +* `RUNNING` (value: `'running'`) + +* `ERROR` (value: `'error'`) + +* `SUCCESS` (value: `'success'`) + +* `PUBLISHED` (value: `'published'`) + +* `PENDING_MINUS_DELETE` (value: `'pending-delete'`) + +* `PENDING_MINUS_FORCED_MINUS_DELETE` (value: `'pending-forced-delete'`) + +* `DELETING` (value: `'deleting'`) + +[[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/packages/python/src/api_client/docs/BuildConfig.md b/packages/python/src/api_client/docs/BuildConfig.md new file mode 100644 index 0000000..7611c9e --- /dev/null +++ b/packages/python/src/api_client/docs/BuildConfig.md @@ -0,0 +1,30 @@ +# BuildConfig + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cached_build** | [**CachedBuild**](CachedBuild.md) | | [optional] +**devcontainer** | [**DevcontainerConfig**](DevcontainerConfig.md) | | [optional] + +## Example + +```python +from api_client.models.build_config import BuildConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of BuildConfig from a JSON string +build_config_instance = BuildConfig.from_json(json) +# print the JSON string representation of the object +print(BuildConfig.to_json()) + +# convert the object into a dict +build_config_dict = build_config_instance.to_dict() +# create an instance of BuildConfig from a dict +build_config_from_dict = BuildConfig.from_dict(build_config_dict) +``` +[[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/packages/python/src/api_client/docs/CachedBuild.md b/packages/python/src/api_client/docs/CachedBuild.md new file mode 100644 index 0000000..0a470d7 --- /dev/null +++ b/packages/python/src/api_client/docs/CachedBuild.md @@ -0,0 +1,30 @@ +# CachedBuild + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**image** | **str** | | +**user** | **str** | | + +## Example + +```python +from api_client.models.cached_build import CachedBuild + +# TODO update the JSON string below +json = "{}" +# create an instance of CachedBuild from a JSON string +cached_build_instance = CachedBuild.from_json(json) +# print the JSON string representation of the object +print(CachedBuild.to_json()) + +# convert the object into a dict +cached_build_dict = cached_build_instance.to_dict() +# create an instance of CachedBuild from a dict +cached_build_from_dict = CachedBuild.from_dict(cached_build_dict) +``` +[[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/packages/python/src/api_client/docs/CloneTarget.md b/packages/python/src/api_client/docs/CloneTarget.md new file mode 100644 index 0000000..200b1ab --- /dev/null +++ b/packages/python/src/api_client/docs/CloneTarget.md @@ -0,0 +1,12 @@ +# CloneTarget + + +## Enum + +* `BRANCH` (value: `'branch'`) + +* `COMMIT` (value: `'commit'`) + +[[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/packages/python/src/api_client/docs/CompletionContext.md b/packages/python/src/api_client/docs/CompletionContext.md new file mode 100644 index 0000000..1e7fa4f --- /dev/null +++ b/packages/python/src/api_client/docs/CompletionContext.md @@ -0,0 +1,30 @@ +# CompletionContext + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**trigger_character** | **str** | | [optional] +**trigger_kind** | **int** | | + +## Example + +```python +from api_client.models.completion_context import CompletionContext + +# TODO update the JSON string below +json = "{}" +# create an instance of CompletionContext from a JSON string +completion_context_instance = CompletionContext.from_json(json) +# print the JSON string representation of the object +print(CompletionContext.to_json()) + +# convert the object into a dict +completion_context_dict = completion_context_instance.to_dict() +# create an instance of CompletionContext from a dict +completion_context_from_dict = CompletionContext.from_dict(completion_context_dict) +``` +[[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/packages/python/src/api_client/docs/CompletionItem.md b/packages/python/src/api_client/docs/CompletionItem.md new file mode 100644 index 0000000..09674a7 --- /dev/null +++ b/packages/python/src/api_client/docs/CompletionItem.md @@ -0,0 +1,35 @@ +# CompletionItem + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**detail** | **str** | | [optional] +**documentation** | **object** | | [optional] +**filter_text** | **str** | | [optional] +**insert_text** | **str** | | [optional] +**kind** | **int** | | [optional] +**label** | **str** | | +**sort_text** | **str** | | [optional] + +## Example + +```python +from api_client.models.completion_item import CompletionItem + +# TODO update the JSON string below +json = "{}" +# create an instance of CompletionItem from a JSON string +completion_item_instance = CompletionItem.from_json(json) +# print the JSON string representation of the object +print(CompletionItem.to_json()) + +# convert the object into a dict +completion_item_dict = completion_item_instance.to_dict() +# create an instance of CompletionItem from a dict +completion_item_from_dict = CompletionItem.from_dict(completion_item_dict) +``` +[[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/packages/python/src/api_client/docs/CompletionList.md b/packages/python/src/api_client/docs/CompletionList.md new file mode 100644 index 0000000..e42d00c --- /dev/null +++ b/packages/python/src/api_client/docs/CompletionList.md @@ -0,0 +1,30 @@ +# CompletionList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**is_incomplete** | **bool** | | +**items** | [**List[CompletionItem]**](CompletionItem.md) | | + +## Example + +```python +from api_client.models.completion_list import CompletionList + +# TODO update the JSON string below +json = "{}" +# create an instance of CompletionList from a JSON string +completion_list_instance = CompletionList.from_json(json) +# print the JSON string representation of the object +print(CompletionList.to_json()) + +# convert the object into a dict +completion_list_dict = completion_list_instance.to_dict() +# create an instance of CompletionList from a dict +completion_list_from_dict = CompletionList.from_dict(completion_list_dict) +``` +[[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/packages/python/src/api_client/docs/ContainerConfig.md b/packages/python/src/api_client/docs/ContainerConfig.md new file mode 100644 index 0000000..50f536f --- /dev/null +++ b/packages/python/src/api_client/docs/ContainerConfig.md @@ -0,0 +1,30 @@ +# ContainerConfig + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**image** | **str** | | +**user** | **str** | | + +## Example + +```python +from api_client.models.container_config import ContainerConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of ContainerConfig from a JSON string +container_config_instance = ContainerConfig.from_json(json) +# print the JSON string representation of the object +print(ContainerConfig.to_json()) + +# convert the object into a dict +container_config_dict = container_config_instance.to_dict() +# create an instance of ContainerConfig from a dict +container_config_from_dict = ContainerConfig.from_dict(container_config_dict) +``` +[[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/packages/python/src/api_client/docs/ContainerRegistry.md b/packages/python/src/api_client/docs/ContainerRegistry.md new file mode 100644 index 0000000..12fc3a9 --- /dev/null +++ b/packages/python/src/api_client/docs/ContainerRegistry.md @@ -0,0 +1,31 @@ +# ContainerRegistry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**password** | **str** | | +**server** | **str** | | +**username** | **str** | | + +## Example + +```python +from api_client.models.container_registry import ContainerRegistry + +# TODO update the JSON string below +json = "{}" +# create an instance of ContainerRegistry from a JSON string +container_registry_instance = ContainerRegistry.from_json(json) +# print the JSON string representation of the object +print(ContainerRegistry.to_json()) + +# convert the object into a dict +container_registry_dict = container_registry_instance.to_dict() +# create an instance of ContainerRegistry from a dict +container_registry_from_dict = ContainerRegistry.from_dict(container_registry_dict) +``` +[[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/packages/python/src/api_client/docs/ContainerRegistryApi.md b/packages/python/src/api_client/docs/ContainerRegistryApi.md new file mode 100644 index 0000000..4ebadb4 --- /dev/null +++ b/packages/python/src/api_client/docs/ContainerRegistryApi.md @@ -0,0 +1,321 @@ +# api_client.ContainerRegistryApi + +All URIs are relative to *http://localhost:3986* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_container_registry**](ContainerRegistryApi.md#get_container_registry) | **GET** /container-registry/{server} | Get container registry credentials +[**list_container_registries**](ContainerRegistryApi.md#list_container_registries) | **GET** /container-registry | List container registries +[**remove_container_registry**](ContainerRegistryApi.md#remove_container_registry) | **DELETE** /container-registry/{server} | Remove a container registry credentials +[**set_container_registry**](ContainerRegistryApi.md#set_container_registry) | **PUT** /container-registry/{server} | Set container registry credentials + + +# **get_container_registry** +> ContainerRegistry get_container_registry(server) + +Get container registry credentials + +Get container registry credentials + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.container_registry import ContainerRegistry +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.ContainerRegistryApi(api_client) + server = 'server_example' # str | Container Registry server name + + try: + # Get container registry credentials + api_response = api_instance.get_container_registry(server) + print("The response of ContainerRegistryApi->get_container_registry:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ContainerRegistryApi->get_container_registry: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **server** | **str**| Container Registry server name | + +### Return type + +[**ContainerRegistry**](ContainerRegistry.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **list_container_registries** +> List[ContainerRegistry] list_container_registries() + +List container registries + +List container registries + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.container_registry import ContainerRegistry +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.ContainerRegistryApi(api_client) + + try: + # List container registries + api_response = api_instance.list_container_registries() + print("The response of ContainerRegistryApi->list_container_registries:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ContainerRegistryApi->list_container_registries: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**List[ContainerRegistry]**](ContainerRegistry.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **remove_container_registry** +> remove_container_registry(server) + +Remove a container registry credentials + +Remove a container registry credentials + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.ContainerRegistryApi(api_client) + server = 'server_example' # str | Container Registry server name + + try: + # Remove a container registry credentials + api_instance.remove_container_registry(server) + except Exception as e: + print("Exception when calling ContainerRegistryApi->remove_container_registry: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **server** | **str**| Container Registry server name | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No Content | - | + +[[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) + +# **set_container_registry** +> set_container_registry(server, container_registry) + +Set container registry credentials + +Set container registry credentials + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.container_registry import ContainerRegistry +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.ContainerRegistryApi(api_client) + server = 'server_example' # str | Container Registry server name + container_registry = api_client.ContainerRegistry() # ContainerRegistry | Container Registry credentials to set + + try: + # Set container registry credentials + api_instance.set_container_registry(server, container_registry) + except Exception as e: + print("Exception when calling ContainerRegistryApi->set_container_registry: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **server** | **str**| Container Registry server name | + **container_registry** | [**ContainerRegistry**](ContainerRegistry.md)| Container Registry credentials to set | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | + +[[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/packages/python/src/api_client/docs/CreateBuildDTO.md b/packages/python/src/api_client/docs/CreateBuildDTO.md new file mode 100644 index 0000000..ebbdef8 --- /dev/null +++ b/packages/python/src/api_client/docs/CreateBuildDTO.md @@ -0,0 +1,32 @@ +# CreateBuildDTO + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**branch** | **str** | | +**env_vars** | **Dict[str, str]** | | +**prebuild_id** | **str** | | [optional] +**project_config_name** | **str** | | + +## Example + +```python +from api_client.models.create_build_dto import CreateBuildDTO + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateBuildDTO from a JSON string +create_build_dto_instance = CreateBuildDTO.from_json(json) +# print the JSON string representation of the object +print(CreateBuildDTO.to_json()) + +# convert the object into a dict +create_build_dto_dict = create_build_dto_instance.to_dict() +# create an instance of CreateBuildDTO from a dict +create_build_dto_from_dict = CreateBuildDTO.from_dict(create_build_dto_dict) +``` +[[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/packages/python/src/api_client/docs/CreatePrebuildDTO.md b/packages/python/src/api_client/docs/CreatePrebuildDTO.md new file mode 100644 index 0000000..9beb583 --- /dev/null +++ b/packages/python/src/api_client/docs/CreatePrebuildDTO.md @@ -0,0 +1,33 @@ +# CreatePrebuildDTO + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**branch** | **str** | | [optional] +**commit_interval** | **int** | | [optional] +**id** | **str** | | [optional] +**retention** | **int** | | +**trigger_files** | **List[str]** | | [optional] + +## Example + +```python +from api_client.models.create_prebuild_dto import CreatePrebuildDTO + +# TODO update the JSON string below +json = "{}" +# create an instance of CreatePrebuildDTO from a JSON string +create_prebuild_dto_instance = CreatePrebuildDTO.from_json(json) +# print the JSON string representation of the object +print(CreatePrebuildDTO.to_json()) + +# convert the object into a dict +create_prebuild_dto_dict = create_prebuild_dto_instance.to_dict() +# create an instance of CreatePrebuildDTO from a dict +create_prebuild_dto_from_dict = CreatePrebuildDTO.from_dict(create_prebuild_dto_dict) +``` +[[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/packages/python/src/api_client/docs/CreateProjectConfigDTO.md b/packages/python/src/api_client/docs/CreateProjectConfigDTO.md new file mode 100644 index 0000000..eeeb958 --- /dev/null +++ b/packages/python/src/api_client/docs/CreateProjectConfigDTO.md @@ -0,0 +1,35 @@ +# CreateProjectConfigDTO + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**build_config** | [**BuildConfig**](BuildConfig.md) | | [optional] +**env_vars** | **Dict[str, str]** | | +**git_provider_config_id** | **str** | | [optional] +**image** | **str** | | [optional] +**name** | **str** | | +**repository_url** | **str** | | +**user** | **str** | | [optional] + +## Example + +```python +from api_client.models.create_project_config_dto import CreateProjectConfigDTO + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateProjectConfigDTO from a JSON string +create_project_config_dto_instance = CreateProjectConfigDTO.from_json(json) +# print the JSON string representation of the object +print(CreateProjectConfigDTO.to_json()) + +# convert the object into a dict +create_project_config_dto_dict = create_project_config_dto_instance.to_dict() +# create an instance of CreateProjectConfigDTO from a dict +create_project_config_dto_from_dict = CreateProjectConfigDTO.from_dict(create_project_config_dto_dict) +``` +[[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/packages/python/src/api_client/docs/CreateProjectDTO.md b/packages/python/src/api_client/docs/CreateProjectDTO.md new file mode 100644 index 0000000..4693b7d --- /dev/null +++ b/packages/python/src/api_client/docs/CreateProjectDTO.md @@ -0,0 +1,35 @@ +# CreateProjectDTO + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**build_config** | [**BuildConfig**](BuildConfig.md) | | [optional] +**env_vars** | **Dict[str, str]** | | +**git_provider_config_id** | **str** | | [optional] +**image** | **str** | | [optional] +**name** | **str** | | +**source** | [**CreateProjectSourceDTO**](CreateProjectSourceDTO.md) | | +**user** | **str** | | [optional] + +## Example + +```python +from api_client.models.create_project_dto import CreateProjectDTO + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateProjectDTO from a JSON string +create_project_dto_instance = CreateProjectDTO.from_json(json) +# print the JSON string representation of the object +print(CreateProjectDTO.to_json()) + +# convert the object into a dict +create_project_dto_dict = create_project_dto_instance.to_dict() +# create an instance of CreateProjectDTO from a dict +create_project_dto_from_dict = CreateProjectDTO.from_dict(create_project_dto_dict) +``` +[[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/packages/python/src/api_client/docs/CreateProjectSourceDTO.md b/packages/python/src/api_client/docs/CreateProjectSourceDTO.md new file mode 100644 index 0000000..3138d8f --- /dev/null +++ b/packages/python/src/api_client/docs/CreateProjectSourceDTO.md @@ -0,0 +1,29 @@ +# CreateProjectSourceDTO + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**repository** | [**GitRepository**](GitRepository.md) | | + +## Example + +```python +from api_client.models.create_project_source_dto import CreateProjectSourceDTO + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateProjectSourceDTO from a JSON string +create_project_source_dto_instance = CreateProjectSourceDTO.from_json(json) +# print the JSON string representation of the object +print(CreateProjectSourceDTO.to_json()) + +# convert the object into a dict +create_project_source_dto_dict = create_project_source_dto_instance.to_dict() +# create an instance of CreateProjectSourceDTO from a dict +create_project_source_dto_from_dict = CreateProjectSourceDTO.from_dict(create_project_source_dto_dict) +``` +[[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/packages/python/src/api_client/docs/CreateProviderTargetDTO.md b/packages/python/src/api_client/docs/CreateProviderTargetDTO.md new file mode 100644 index 0000000..9a4ce46 --- /dev/null +++ b/packages/python/src/api_client/docs/CreateProviderTargetDTO.md @@ -0,0 +1,31 @@ +# CreateProviderTargetDTO + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**options** | **str** | | +**provider_info** | [**ProviderProviderInfo**](ProviderProviderInfo.md) | | + +## Example + +```python +from api_client.models.create_provider_target_dto import CreateProviderTargetDTO + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateProviderTargetDTO from a JSON string +create_provider_target_dto_instance = CreateProviderTargetDTO.from_json(json) +# print the JSON string representation of the object +print(CreateProviderTargetDTO.to_json()) + +# convert the object into a dict +create_provider_target_dto_dict = create_provider_target_dto_instance.to_dict() +# create an instance of CreateProviderTargetDTO from a dict +create_provider_target_dto_from_dict = CreateProviderTargetDTO.from_dict(create_provider_target_dto_dict) +``` +[[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/packages/python/src/api_client/docs/CreateWorkspaceDTO.md b/packages/python/src/api_client/docs/CreateWorkspaceDTO.md new file mode 100644 index 0000000..6f1a4df --- /dev/null +++ b/packages/python/src/api_client/docs/CreateWorkspaceDTO.md @@ -0,0 +1,32 @@ +# CreateWorkspaceDTO + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | +**name** | **str** | | +**projects** | [**List[CreateProjectDTO]**](CreateProjectDTO.md) | | +**target** | **str** | | + +## Example + +```python +from api_client.models.create_workspace_dto import CreateWorkspaceDTO + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateWorkspaceDTO from a JSON string +create_workspace_dto_instance = CreateWorkspaceDTO.from_json(json) +# print the JSON string representation of the object +print(CreateWorkspaceDTO.to_json()) + +# convert the object into a dict +create_workspace_dto_dict = create_workspace_dto_instance.to_dict() +# create an instance of CreateWorkspaceDTO from a dict +create_workspace_dto_from_dict = CreateWorkspaceDTO.from_dict(create_workspace_dto_dict) +``` +[[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/packages/python/src/api_client/docs/DefaultApi.md b/packages/python/src/api_client/docs/DefaultApi.md new file mode 100644 index 0000000..82e25b5 --- /dev/null +++ b/packages/python/src/api_client/docs/DefaultApi.md @@ -0,0 +1,83 @@ +# api_client.DefaultApi + +All URIs are relative to *http://localhost:3986* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**health_check**](DefaultApi.md#health_check) | **GET** /health | Health check + + +# **health_check** +> Dict[str, str] health_check() + +Health check + +Health check + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.DefaultApi(api_client) + + try: + # Health check + api_response = api_instance.health_check() + print("The response of DefaultApi->health_check:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DefaultApi->health_check: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**Dict[str, str]** + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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/packages/python/src/api_client/docs/DevcontainerConfig.md b/packages/python/src/api_client/docs/DevcontainerConfig.md new file mode 100644 index 0000000..98d374d --- /dev/null +++ b/packages/python/src/api_client/docs/DevcontainerConfig.md @@ -0,0 +1,29 @@ +# DevcontainerConfig + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file_path** | **str** | | + +## Example + +```python +from api_client.models.devcontainer_config import DevcontainerConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of DevcontainerConfig from a JSON string +devcontainer_config_instance = DevcontainerConfig.from_json(json) +# print the JSON string representation of the object +print(DevcontainerConfig.to_json()) + +# convert the object into a dict +devcontainer_config_dict = devcontainer_config_instance.to_dict() +# create an instance of DevcontainerConfig from a dict +devcontainer_config_from_dict = DevcontainerConfig.from_dict(devcontainer_config_dict) +``` +[[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/packages/python/src/api_client/docs/ExecuteRequest.md b/packages/python/src/api_client/docs/ExecuteRequest.md new file mode 100644 index 0000000..3728453 --- /dev/null +++ b/packages/python/src/api_client/docs/ExecuteRequest.md @@ -0,0 +1,30 @@ +# ExecuteRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**command** | **str** | | +**timeout** | **int** | Timeout in seconds, defaults to 10 seconds | [optional] + +## Example + +```python +from api_client.models.execute_request import ExecuteRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of ExecuteRequest from a JSON string +execute_request_instance = ExecuteRequest.from_json(json) +# print the JSON string representation of the object +print(ExecuteRequest.to_json()) + +# convert the object into a dict +execute_request_dict = execute_request_instance.to_dict() +# create an instance of ExecuteRequest from a dict +execute_request_from_dict = ExecuteRequest.from_dict(execute_request_dict) +``` +[[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/packages/python/src/api_client/docs/ExecuteResponse.md b/packages/python/src/api_client/docs/ExecuteResponse.md new file mode 100644 index 0000000..a850259 --- /dev/null +++ b/packages/python/src/api_client/docs/ExecuteResponse.md @@ -0,0 +1,30 @@ +# ExecuteResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**result** | **str** | | + +## Example + +```python +from api_client.models.execute_response import ExecuteResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ExecuteResponse from a JSON string +execute_response_instance = ExecuteResponse.from_json(json) +# print the JSON string representation of the object +print(ExecuteResponse.to_json()) + +# convert the object into a dict +execute_response_dict = execute_response_instance.to_dict() +# create an instance of ExecuteResponse from a dict +execute_response_from_dict = ExecuteResponse.from_dict(execute_response_dict) +``` +[[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/packages/python/src/api_client/docs/FRPSConfig.md b/packages/python/src/api_client/docs/FRPSConfig.md new file mode 100644 index 0000000..bca7ae9 --- /dev/null +++ b/packages/python/src/api_client/docs/FRPSConfig.md @@ -0,0 +1,31 @@ +# FRPSConfig + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**domain** | **str** | | +**port** | **int** | | +**protocol** | **str** | | + +## Example + +```python +from api_client.models.frps_config import FRPSConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of FRPSConfig from a JSON string +frps_config_instance = FRPSConfig.from_json(json) +# print the JSON string representation of the object +print(FRPSConfig.to_json()) + +# convert the object into a dict +frps_config_dict = frps_config_instance.to_dict() +# create an instance of FRPSConfig from a dict +frps_config_from_dict = FRPSConfig.from_dict(frps_config_dict) +``` +[[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/packages/python/src/api_client/docs/FileInfo.md b/packages/python/src/api_client/docs/FileInfo.md new file mode 100644 index 0000000..9348fb6 --- /dev/null +++ b/packages/python/src/api_client/docs/FileInfo.md @@ -0,0 +1,36 @@ +# FileInfo + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**group** | **str** | | +**is_dir** | **bool** | | +**mod_time** | **str** | | +**mode** | **str** | | +**name** | **str** | | +**owner** | **str** | | +**permissions** | **str** | | +**size** | **int** | | + +## Example + +```python +from api_client.models.file_info import FileInfo + +# TODO update the JSON string below +json = "{}" +# create an instance of FileInfo from a JSON string +file_info_instance = FileInfo.from_json(json) +# print the JSON string representation of the object +print(FileInfo.to_json()) + +# convert the object into a dict +file_info_dict = file_info_instance.to_dict() +# create an instance of FileInfo from a dict +file_info_from_dict = FileInfo.from_dict(file_info_dict) +``` +[[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/packages/python/src/api_client/docs/FileStatus.md b/packages/python/src/api_client/docs/FileStatus.md new file mode 100644 index 0000000..21d1f38 --- /dev/null +++ b/packages/python/src/api_client/docs/FileStatus.md @@ -0,0 +1,32 @@ +# FileStatus + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**extra** | **str** | | +**name** | **str** | | +**staging** | [**Status**](Status.md) | | +**worktree** | [**Status**](Status.md) | | + +## Example + +```python +from api_client.models.file_status import FileStatus + +# TODO update the JSON string below +json = "{}" +# create an instance of FileStatus from a JSON string +file_status_instance = FileStatus.from_json(json) +# print the JSON string representation of the object +print(FileStatus.to_json()) + +# convert the object into a dict +file_status_dict = file_status_instance.to_dict() +# create an instance of FileStatus from a dict +file_status_from_dict = FileStatus.from_dict(file_status_dict) +``` +[[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/packages/python/src/api_client/docs/GetRepositoryContext.md b/packages/python/src/api_client/docs/GetRepositoryContext.md new file mode 100644 index 0000000..ed9cf59 --- /dev/null +++ b/packages/python/src/api_client/docs/GetRepositoryContext.md @@ -0,0 +1,37 @@ +# GetRepositoryContext + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**branch** | **str** | | [optional] +**id** | **str** | | [optional] +**name** | **str** | | [optional] +**owner** | **str** | | [optional] +**path** | **str** | | [optional] +**pr_number** | **int** | | [optional] +**sha** | **str** | | [optional] +**source** | **str** | | [optional] +**url** | **str** | | + +## Example + +```python +from api_client.models.get_repository_context import GetRepositoryContext + +# TODO update the JSON string below +json = "{}" +# create an instance of GetRepositoryContext from a JSON string +get_repository_context_instance = GetRepositoryContext.from_json(json) +# print the JSON string representation of the object +print(GetRepositoryContext.to_json()) + +# convert the object into a dict +get_repository_context_dict = get_repository_context_instance.to_dict() +# create an instance of GetRepositoryContext from a dict +get_repository_context_from_dict = GetRepositoryContext.from_dict(get_repository_context_dict) +``` +[[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/packages/python/src/api_client/docs/GitAddRequest.md b/packages/python/src/api_client/docs/GitAddRequest.md new file mode 100644 index 0000000..8873176 --- /dev/null +++ b/packages/python/src/api_client/docs/GitAddRequest.md @@ -0,0 +1,30 @@ +# GitAddRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**files** | **List[str]** | files to add (use . for all files) | +**path** | **str** | | + +## Example + +```python +from api_client.models.git_add_request import GitAddRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of GitAddRequest from a JSON string +git_add_request_instance = GitAddRequest.from_json(json) +# print the JSON string representation of the object +print(GitAddRequest.to_json()) + +# convert the object into a dict +git_add_request_dict = git_add_request_instance.to_dict() +# create an instance of GitAddRequest from a dict +git_add_request_from_dict = GitAddRequest.from_dict(git_add_request_dict) +``` +[[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/packages/python/src/api_client/docs/GitBranch.md b/packages/python/src/api_client/docs/GitBranch.md new file mode 100644 index 0000000..d6eabeb --- /dev/null +++ b/packages/python/src/api_client/docs/GitBranch.md @@ -0,0 +1,30 @@ +# GitBranch + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**sha** | **str** | | + +## Example + +```python +from api_client.models.git_branch import GitBranch + +# TODO update the JSON string below +json = "{}" +# create an instance of GitBranch from a JSON string +git_branch_instance = GitBranch.from_json(json) +# print the JSON string representation of the object +print(GitBranch.to_json()) + +# convert the object into a dict +git_branch_dict = git_branch_instance.to_dict() +# create an instance of GitBranch from a dict +git_branch_from_dict = GitBranch.from_dict(git_branch_dict) +``` +[[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/packages/python/src/api_client/docs/GitBranchRequest.md b/packages/python/src/api_client/docs/GitBranchRequest.md new file mode 100644 index 0000000..03d4869 --- /dev/null +++ b/packages/python/src/api_client/docs/GitBranchRequest.md @@ -0,0 +1,30 @@ +# GitBranchRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**path** | **str** | | + +## Example + +```python +from api_client.models.git_branch_request import GitBranchRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of GitBranchRequest from a JSON string +git_branch_request_instance = GitBranchRequest.from_json(json) +# print the JSON string representation of the object +print(GitBranchRequest.to_json()) + +# convert the object into a dict +git_branch_request_dict = git_branch_request_instance.to_dict() +# create an instance of GitBranchRequest from a dict +git_branch_request_from_dict = GitBranchRequest.from_dict(git_branch_request_dict) +``` +[[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/packages/python/src/api_client/docs/GitCloneRequest.md b/packages/python/src/api_client/docs/GitCloneRequest.md new file mode 100644 index 0000000..fb701d4 --- /dev/null +++ b/packages/python/src/api_client/docs/GitCloneRequest.md @@ -0,0 +1,34 @@ +# GitCloneRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**branch** | **str** | | [optional] +**commit_id** | **str** | | [optional] +**password** | **str** | | [optional] +**path** | **str** | | +**url** | **str** | | +**username** | **str** | | [optional] + +## Example + +```python +from api_client.models.git_clone_request import GitCloneRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of GitCloneRequest from a JSON string +git_clone_request_instance = GitCloneRequest.from_json(json) +# print the JSON string representation of the object +print(GitCloneRequest.to_json()) + +# convert the object into a dict +git_clone_request_dict = git_clone_request_instance.to_dict() +# create an instance of GitCloneRequest from a dict +git_clone_request_from_dict = GitCloneRequest.from_dict(git_clone_request_dict) +``` +[[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/packages/python/src/api_client/docs/GitCommitInfo.md b/packages/python/src/api_client/docs/GitCommitInfo.md new file mode 100644 index 0000000..9f58035 --- /dev/null +++ b/packages/python/src/api_client/docs/GitCommitInfo.md @@ -0,0 +1,33 @@ +# GitCommitInfo + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**author** | **str** | | +**email** | **str** | | +**hash** | **str** | | +**message** | **str** | | +**timestamp** | **str** | | + +## Example + +```python +from api_client.models.git_commit_info import GitCommitInfo + +# TODO update the JSON string below +json = "{}" +# create an instance of GitCommitInfo from a JSON string +git_commit_info_instance = GitCommitInfo.from_json(json) +# print the JSON string representation of the object +print(GitCommitInfo.to_json()) + +# convert the object into a dict +git_commit_info_dict = git_commit_info_instance.to_dict() +# create an instance of GitCommitInfo from a dict +git_commit_info_from_dict = GitCommitInfo.from_dict(git_commit_info_dict) +``` +[[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/packages/python/src/api_client/docs/GitCommitRequest.md b/packages/python/src/api_client/docs/GitCommitRequest.md new file mode 100644 index 0000000..4e7d025 --- /dev/null +++ b/packages/python/src/api_client/docs/GitCommitRequest.md @@ -0,0 +1,32 @@ +# GitCommitRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**author** | **str** | | +**email** | **str** | | +**message** | **str** | | +**path** | **str** | | + +## Example + +```python +from api_client.models.git_commit_request import GitCommitRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of GitCommitRequest from a JSON string +git_commit_request_instance = GitCommitRequest.from_json(json) +# print the JSON string representation of the object +print(GitCommitRequest.to_json()) + +# convert the object into a dict +git_commit_request_dict = git_commit_request_instance.to_dict() +# create an instance of GitCommitRequest from a dict +git_commit_request_from_dict = GitCommitRequest.from_dict(git_commit_request_dict) +``` +[[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/packages/python/src/api_client/docs/GitCommitResponse.md b/packages/python/src/api_client/docs/GitCommitResponse.md new file mode 100644 index 0000000..a082d8a --- /dev/null +++ b/packages/python/src/api_client/docs/GitCommitResponse.md @@ -0,0 +1,29 @@ +# GitCommitResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hash** | **str** | | + +## Example + +```python +from api_client.models.git_commit_response import GitCommitResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of GitCommitResponse from a JSON string +git_commit_response_instance = GitCommitResponse.from_json(json) +# print the JSON string representation of the object +print(GitCommitResponse.to_json()) + +# convert the object into a dict +git_commit_response_dict = git_commit_response_instance.to_dict() +# create an instance of GitCommitResponse from a dict +git_commit_response_from_dict = GitCommitResponse.from_dict(git_commit_response_dict) +``` +[[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/packages/python/src/api_client/docs/GitNamespace.md b/packages/python/src/api_client/docs/GitNamespace.md new file mode 100644 index 0000000..6bcc5fe --- /dev/null +++ b/packages/python/src/api_client/docs/GitNamespace.md @@ -0,0 +1,30 @@ +# GitNamespace + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | +**name** | **str** | | + +## Example + +```python +from api_client.models.git_namespace import GitNamespace + +# TODO update the JSON string below +json = "{}" +# create an instance of GitNamespace from a JSON string +git_namespace_instance = GitNamespace.from_json(json) +# print the JSON string representation of the object +print(GitNamespace.to_json()) + +# convert the object into a dict +git_namespace_dict = git_namespace_instance.to_dict() +# create an instance of GitNamespace from a dict +git_namespace_from_dict = GitNamespace.from_dict(git_namespace_dict) +``` +[[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/packages/python/src/api_client/docs/GitProvider.md b/packages/python/src/api_client/docs/GitProvider.md new file mode 100644 index 0000000..84cbd05 --- /dev/null +++ b/packages/python/src/api_client/docs/GitProvider.md @@ -0,0 +1,36 @@ +# GitProvider + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**alias** | **str** | | +**base_api_url** | **str** | | [optional] +**id** | **str** | | +**provider_id** | **str** | | +**signing_key** | **str** | | [optional] +**signing_method** | [**SigningMethod**](SigningMethod.md) | | [optional] +**token** | **str** | | +**username** | **str** | | + +## Example + +```python +from api_client.models.git_provider import GitProvider + +# TODO update the JSON string below +json = "{}" +# create an instance of GitProvider from a JSON string +git_provider_instance = GitProvider.from_json(json) +# print the JSON string representation of the object +print(GitProvider.to_json()) + +# convert the object into a dict +git_provider_dict = git_provider_instance.to_dict() +# create an instance of GitProvider from a dict +git_provider_from_dict = GitProvider.from_dict(git_provider_dict) +``` +[[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/packages/python/src/api_client/docs/GitProviderApi.md b/packages/python/src/api_client/docs/GitProviderApi.md new file mode 100644 index 0000000..be22639 --- /dev/null +++ b/packages/python/src/api_client/docs/GitProviderApi.md @@ -0,0 +1,1066 @@ +# api_client.GitProviderApi + +All URIs are relative to *http://localhost:3986* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_git_context**](GitProviderApi.md#get_git_context) | **POST** /gitprovider/context | Get Git context +[**get_git_provider**](GitProviderApi.md#get_git_provider) | **GET** /gitprovider/{gitProviderId} | Get Git provider +[**get_git_provider_id_for_url**](GitProviderApi.md#get_git_provider_id_for_url) | **GET** /gitprovider/id-for-url/{url} | Get Git provider ID +[**get_git_user**](GitProviderApi.md#get_git_user) | **GET** /gitprovider/{gitProviderId}/user | Get Git context +[**get_namespaces**](GitProviderApi.md#get_namespaces) | **GET** /gitprovider/{gitProviderId}/namespaces | Get Git namespaces +[**get_repo_branches**](GitProviderApi.md#get_repo_branches) | **GET** /gitprovider/{gitProviderId}/{namespaceId}/{repositoryId}/branches | Get Git repository branches +[**get_repo_prs**](GitProviderApi.md#get_repo_prs) | **GET** /gitprovider/{gitProviderId}/{namespaceId}/{repositoryId}/pull-requests | Get Git repository PRs +[**get_repositories**](GitProviderApi.md#get_repositories) | **GET** /gitprovider/{gitProviderId}/{namespaceId}/repositories | Get Git repositories +[**get_url_from_repository**](GitProviderApi.md#get_url_from_repository) | **POST** /gitprovider/context/url | Get URL from Git repository +[**list_git_providers**](GitProviderApi.md#list_git_providers) | **GET** /gitprovider | List Git providers +[**list_git_providers_for_url**](GitProviderApi.md#list_git_providers_for_url) | **GET** /gitprovider/for-url/{url} | List Git providers for url +[**remove_git_provider**](GitProviderApi.md#remove_git_provider) | **DELETE** /gitprovider/{gitProviderId} | Remove Git provider +[**set_git_provider**](GitProviderApi.md#set_git_provider) | **PUT** /gitprovider | Set Git provider + + +# **get_git_context** +> GitRepository get_git_context(repository) + +Get Git context + +Get Git context + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.get_repository_context import GetRepositoryContext +from api_client.models.git_repository import GitRepository +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.GitProviderApi(api_client) + repository = api_client.GetRepositoryContext() # GetRepositoryContext | Get repository context + + try: + # Get Git context + api_response = api_instance.get_git_context(repository) + print("The response of GitProviderApi->get_git_context:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling GitProviderApi->get_git_context: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | [**GetRepositoryContext**](GetRepositoryContext.md)| Get repository context | + +### Return type + +[**GitRepository**](GitRepository.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **get_git_provider** +> GitProvider get_git_provider(git_provider_id) + +Get Git provider + +Get Git provider + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.git_provider import GitProvider +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.GitProviderApi(api_client) + git_provider_id = 'git_provider_id_example' # str | ID + + try: + # Get Git provider + api_response = api_instance.get_git_provider(git_provider_id) + print("The response of GitProviderApi->get_git_provider:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling GitProviderApi->get_git_provider: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **git_provider_id** | **str**| ID | + +### Return type + +[**GitProvider**](GitProvider.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **get_git_provider_id_for_url** +> str get_git_provider_id_for_url(url) + +Get Git provider ID + +Get Git provider ID + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.GitProviderApi(api_client) + url = 'url_example' # str | Url + + try: + # Get Git provider ID + api_response = api_instance.get_git_provider_id_for_url(url) + print("The response of GitProviderApi->get_git_provider_id_for_url:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling GitProviderApi->get_git_provider_id_for_url: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **url** | **str**| Url | + +### Return type + +**str** + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **get_git_user** +> GitUser get_git_user(git_provider_id) + +Get Git context + +Get Git context + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.git_user import GitUser +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.GitProviderApi(api_client) + git_provider_id = 'git_provider_id_example' # str | Git Provider Id + + try: + # Get Git context + api_response = api_instance.get_git_user(git_provider_id) + print("The response of GitProviderApi->get_git_user:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling GitProviderApi->get_git_user: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **git_provider_id** | **str**| Git Provider Id | + +### Return type + +[**GitUser**](GitUser.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **get_namespaces** +> List[GitNamespace] get_namespaces(git_provider_id, page=page, per_page=per_page) + +Get Git namespaces + +Get Git namespaces + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.git_namespace import GitNamespace +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.GitProviderApi(api_client) + git_provider_id = 'git_provider_id_example' # str | Git provider + page = 56 # int | Page number (optional) + per_page = 56 # int | Number of items per page (optional) + + try: + # Get Git namespaces + api_response = api_instance.get_namespaces(git_provider_id, page=page, per_page=per_page) + print("The response of GitProviderApi->get_namespaces:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling GitProviderApi->get_namespaces: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **git_provider_id** | **str**| Git provider | + **page** | **int**| Page number | [optional] + **per_page** | **int**| Number of items per page | [optional] + +### Return type + +[**List[GitNamespace]**](GitNamespace.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **get_repo_branches** +> List[GitBranch] get_repo_branches(git_provider_id, namespace_id, repository_id, page=page, per_page=per_page) + +Get Git repository branches + +Get Git repository branches + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.git_branch import GitBranch +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.GitProviderApi(api_client) + git_provider_id = 'git_provider_id_example' # str | Git provider + namespace_id = 'namespace_id_example' # str | Namespace + repository_id = 'repository_id_example' # str | Repository + page = 56 # int | Page number (optional) + per_page = 56 # int | Number of items per page (optional) + + try: + # Get Git repository branches + api_response = api_instance.get_repo_branches(git_provider_id, namespace_id, repository_id, page=page, per_page=per_page) + print("The response of GitProviderApi->get_repo_branches:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling GitProviderApi->get_repo_branches: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **git_provider_id** | **str**| Git provider | + **namespace_id** | **str**| Namespace | + **repository_id** | **str**| Repository | + **page** | **int**| Page number | [optional] + **per_page** | **int**| Number of items per page | [optional] + +### Return type + +[**List[GitBranch]**](GitBranch.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **get_repo_prs** +> List[GitPullRequest] get_repo_prs(git_provider_id, namespace_id, repository_id, page=page, per_page=per_page) + +Get Git repository PRs + +Get Git repository PRs + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.git_pull_request import GitPullRequest +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.GitProviderApi(api_client) + git_provider_id = 'git_provider_id_example' # str | Git provider + namespace_id = 'namespace_id_example' # str | Namespace + repository_id = 'repository_id_example' # str | Repository + page = 56 # int | Page number (optional) + per_page = 56 # int | Number of items per page (optional) + + try: + # Get Git repository PRs + api_response = api_instance.get_repo_prs(git_provider_id, namespace_id, repository_id, page=page, per_page=per_page) + print("The response of GitProviderApi->get_repo_prs:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling GitProviderApi->get_repo_prs: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **git_provider_id** | **str**| Git provider | + **namespace_id** | **str**| Namespace | + **repository_id** | **str**| Repository | + **page** | **int**| Page number | [optional] + **per_page** | **int**| Number of items per page | [optional] + +### Return type + +[**List[GitPullRequest]**](GitPullRequest.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **get_repositories** +> List[GitRepository] get_repositories(git_provider_id, namespace_id, page=page, per_page=per_page) + +Get Git repositories + +Get Git repositories + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.git_repository import GitRepository +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.GitProviderApi(api_client) + git_provider_id = 'git_provider_id_example' # str | Git provider + namespace_id = 'namespace_id_example' # str | Namespace + page = 56 # int | Page number (optional) + per_page = 56 # int | Number of items per page (optional) + + try: + # Get Git repositories + api_response = api_instance.get_repositories(git_provider_id, namespace_id, page=page, per_page=per_page) + print("The response of GitProviderApi->get_repositories:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling GitProviderApi->get_repositories: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **git_provider_id** | **str**| Git provider | + **namespace_id** | **str**| Namespace | + **page** | **int**| Page number | [optional] + **per_page** | **int**| Number of items per page | [optional] + +### Return type + +[**List[GitRepository]**](GitRepository.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **get_url_from_repository** +> RepositoryUrl get_url_from_repository(repository) + +Get URL from Git repository + +Get URL from Git repository + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.git_repository import GitRepository +from api_client.models.repository_url import RepositoryUrl +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.GitProviderApi(api_client) + repository = api_client.GitRepository() # GitRepository | Git repository + + try: + # Get URL from Git repository + api_response = api_instance.get_url_from_repository(repository) + print("The response of GitProviderApi->get_url_from_repository:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling GitProviderApi->get_url_from_repository: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | [**GitRepository**](GitRepository.md)| Git repository | + +### Return type + +[**RepositoryUrl**](RepositoryUrl.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **list_git_providers** +> List[GitProvider] list_git_providers() + +List Git providers + +List Git providers + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.git_provider import GitProvider +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.GitProviderApi(api_client) + + try: + # List Git providers + api_response = api_instance.list_git_providers() + print("The response of GitProviderApi->list_git_providers:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling GitProviderApi->list_git_providers: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**List[GitProvider]**](GitProvider.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **list_git_providers_for_url** +> List[GitProvider] list_git_providers_for_url(url) + +List Git providers for url + +List Git providers for url + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.git_provider import GitProvider +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.GitProviderApi(api_client) + url = 'url_example' # str | Url + + try: + # List Git providers for url + api_response = api_instance.list_git_providers_for_url(url) + print("The response of GitProviderApi->list_git_providers_for_url:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling GitProviderApi->list_git_providers_for_url: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **url** | **str**| Url | + +### Return type + +[**List[GitProvider]**](GitProvider.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **remove_git_provider** +> remove_git_provider(git_provider_id) + +Remove Git provider + +Remove Git provider + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.GitProviderApi(api_client) + git_provider_id = 'git_provider_id_example' # str | Git provider + + try: + # Remove Git provider + api_instance.remove_git_provider(git_provider_id) + except Exception as e: + print("Exception when calling GitProviderApi->remove_git_provider: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **git_provider_id** | **str**| Git provider | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **set_git_provider** +> set_git_provider(git_provider_config) + +Set Git provider + +Set Git provider + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.set_git_provider_config import SetGitProviderConfig +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.GitProviderApi(api_client) + git_provider_config = api_client.SetGitProviderConfig() # SetGitProviderConfig | Git provider + + try: + # Set Git provider + api_instance.set_git_provider(git_provider_config) + except Exception as e: + print("Exception when calling GitProviderApi->set_git_provider: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **git_provider_config** | [**SetGitProviderConfig**](SetGitProviderConfig.md)| Git provider | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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/packages/python/src/api_client/docs/GitPullRequest.md b/packages/python/src/api_client/docs/GitPullRequest.md new file mode 100644 index 0000000..7ea4a08 --- /dev/null +++ b/packages/python/src/api_client/docs/GitPullRequest.md @@ -0,0 +1,35 @@ +# GitPullRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**branch** | **str** | | +**name** | **str** | | +**sha** | **str** | | +**source_repo_id** | **str** | | +**source_repo_name** | **str** | | +**source_repo_owner** | **str** | | +**source_repo_url** | **str** | | + +## Example + +```python +from api_client.models.git_pull_request import GitPullRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of GitPullRequest from a JSON string +git_pull_request_instance = GitPullRequest.from_json(json) +# print the JSON string representation of the object +print(GitPullRequest.to_json()) + +# convert the object into a dict +git_pull_request_dict = git_pull_request_instance.to_dict() +# create an instance of GitPullRequest from a dict +git_pull_request_from_dict = GitPullRequest.from_dict(git_pull_request_dict) +``` +[[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/packages/python/src/api_client/docs/GitRepoRequest.md b/packages/python/src/api_client/docs/GitRepoRequest.md new file mode 100644 index 0000000..a28b867 --- /dev/null +++ b/packages/python/src/api_client/docs/GitRepoRequest.md @@ -0,0 +1,31 @@ +# GitRepoRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**password** | **str** | | [optional] +**path** | **str** | | +**username** | **str** | | [optional] + +## Example + +```python +from api_client.models.git_repo_request import GitRepoRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of GitRepoRequest from a JSON string +git_repo_request_instance = GitRepoRequest.from_json(json) +# print the JSON string representation of the object +print(GitRepoRequest.to_json()) + +# convert the object into a dict +git_repo_request_dict = git_repo_request_instance.to_dict() +# create an instance of GitRepoRequest from a dict +git_repo_request_from_dict = GitRepoRequest.from_dict(git_repo_request_dict) +``` +[[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/packages/python/src/api_client/docs/GitRepository.md b/packages/python/src/api_client/docs/GitRepository.md new file mode 100644 index 0000000..8a415bb --- /dev/null +++ b/packages/python/src/api_client/docs/GitRepository.md @@ -0,0 +1,38 @@ +# GitRepository + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**branch** | **str** | | +**clone_target** | [**CloneTarget**](CloneTarget.md) | | [optional] +**id** | **str** | | +**name** | **str** | | +**owner** | **str** | | +**path** | **str** | | [optional] +**pr_number** | **int** | | [optional] +**sha** | **str** | | +**source** | **str** | | +**url** | **str** | | + +## Example + +```python +from api_client.models.git_repository import GitRepository + +# TODO update the JSON string below +json = "{}" +# create an instance of GitRepository from a JSON string +git_repository_instance = GitRepository.from_json(json) +# print the JSON string representation of the object +print(GitRepository.to_json()) + +# convert the object into a dict +git_repository_dict = git_repository_instance.to_dict() +# create an instance of GitRepository from a dict +git_repository_from_dict = GitRepository.from_dict(git_repository_dict) +``` +[[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/packages/python/src/api_client/docs/GitStatus.md b/packages/python/src/api_client/docs/GitStatus.md new file mode 100644 index 0000000..1fff495 --- /dev/null +++ b/packages/python/src/api_client/docs/GitStatus.md @@ -0,0 +1,33 @@ +# GitStatus + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ahead** | **int** | | [optional] +**behind** | **int** | | [optional] +**branch_published** | **bool** | | [optional] +**current_branch** | **str** | | +**file_status** | [**List[FileStatus]**](FileStatus.md) | | + +## Example + +```python +from api_client.models.git_status import GitStatus + +# TODO update the JSON string below +json = "{}" +# create an instance of GitStatus from a JSON string +git_status_instance = GitStatus.from_json(json) +# print the JSON string representation of the object +print(GitStatus.to_json()) + +# convert the object into a dict +git_status_dict = git_status_instance.to_dict() +# create an instance of GitStatus from a dict +git_status_from_dict = GitStatus.from_dict(git_status_dict) +``` +[[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/packages/python/src/api_client/docs/GitUser.md b/packages/python/src/api_client/docs/GitUser.md new file mode 100644 index 0000000..7f5b0ff --- /dev/null +++ b/packages/python/src/api_client/docs/GitUser.md @@ -0,0 +1,32 @@ +# GitUser + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **str** | | +**id** | **str** | | +**name** | **str** | | +**username** | **str** | | + +## Example + +```python +from api_client.models.git_user import GitUser + +# TODO update the JSON string below +json = "{}" +# create an instance of GitUser from a JSON string +git_user_instance = GitUser.from_json(json) +# print the JSON string representation of the object +print(GitUser.to_json()) + +# convert the object into a dict +git_user_dict = git_user_instance.to_dict() +# create an instance of GitUser from a dict +git_user_from_dict = GitUser.from_dict(git_user_dict) +``` +[[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/packages/python/src/api_client/docs/InstallProviderRequest.md b/packages/python/src/api_client/docs/InstallProviderRequest.md new file mode 100644 index 0000000..1a2a69e --- /dev/null +++ b/packages/python/src/api_client/docs/InstallProviderRequest.md @@ -0,0 +1,30 @@ +# InstallProviderRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**download_urls** | **Dict[str, str]** | | +**name** | **str** | | + +## Example + +```python +from api_client.models.install_provider_request import InstallProviderRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of InstallProviderRequest from a JSON string +install_provider_request_instance = InstallProviderRequest.from_json(json) +# print the JSON string representation of the object +print(InstallProviderRequest.to_json()) + +# convert the object into a dict +install_provider_request_dict = install_provider_request_instance.to_dict() +# create an instance of InstallProviderRequest from a dict +install_provider_request_from_dict = InstallProviderRequest.from_dict(install_provider_request_dict) +``` +[[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/packages/python/src/api_client/docs/ListBranchResponse.md b/packages/python/src/api_client/docs/ListBranchResponse.md new file mode 100644 index 0000000..9b1e3c2 --- /dev/null +++ b/packages/python/src/api_client/docs/ListBranchResponse.md @@ -0,0 +1,29 @@ +# ListBranchResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**branches** | **List[str]** | | + +## Example + +```python +from api_client.models.list_branch_response import ListBranchResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ListBranchResponse from a JSON string +list_branch_response_instance = ListBranchResponse.from_json(json) +# print the JSON string representation of the object +print(ListBranchResponse.to_json()) + +# convert the object into a dict +list_branch_response_dict = list_branch_response_instance.to_dict() +# create an instance of ListBranchResponse from a dict +list_branch_response_from_dict = ListBranchResponse.from_dict(list_branch_response_dict) +``` +[[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/packages/python/src/api_client/docs/LogFileConfig.md b/packages/python/src/api_client/docs/LogFileConfig.md new file mode 100644 index 0000000..cfdc512 --- /dev/null +++ b/packages/python/src/api_client/docs/LogFileConfig.md @@ -0,0 +1,34 @@ +# LogFileConfig + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**compress** | **bool** | | [optional] +**local_time** | **bool** | | [optional] +**max_age** | **int** | | +**max_backups** | **int** | | +**max_size** | **int** | | +**path** | **str** | | + +## Example + +```python +from api_client.models.log_file_config import LogFileConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of LogFileConfig from a JSON string +log_file_config_instance = LogFileConfig.from_json(json) +# print the JSON string representation of the object +print(LogFileConfig.to_json()) + +# convert the object into a dict +log_file_config_dict = log_file_config_instance.to_dict() +# create an instance of LogFileConfig from a dict +log_file_config_from_dict = LogFileConfig.from_dict(log_file_config_dict) +``` +[[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/packages/python/src/api_client/docs/LspCompletionParams.md b/packages/python/src/api_client/docs/LspCompletionParams.md new file mode 100644 index 0000000..dc54210 --- /dev/null +++ b/packages/python/src/api_client/docs/LspCompletionParams.md @@ -0,0 +1,33 @@ +# LspCompletionParams + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**context** | [**CompletionContext**](CompletionContext.md) | | [optional] +**language_id** | **str** | | +**path_to_project** | **str** | | +**position** | [**Position**](Position.md) | | +**uri** | **str** | | + +## Example + +```python +from api_client.models.lsp_completion_params import LspCompletionParams + +# TODO update the JSON string below +json = "{}" +# create an instance of LspCompletionParams from a JSON string +lsp_completion_params_instance = LspCompletionParams.from_json(json) +# print the JSON string representation of the object +print(LspCompletionParams.to_json()) + +# convert the object into a dict +lsp_completion_params_dict = lsp_completion_params_instance.to_dict() +# create an instance of LspCompletionParams from a dict +lsp_completion_params_from_dict = LspCompletionParams.from_dict(lsp_completion_params_dict) +``` +[[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/packages/python/src/api_client/docs/LspDocumentRequest.md b/packages/python/src/api_client/docs/LspDocumentRequest.md new file mode 100644 index 0000000..9f5b097 --- /dev/null +++ b/packages/python/src/api_client/docs/LspDocumentRequest.md @@ -0,0 +1,31 @@ +# LspDocumentRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**language_id** | **str** | | +**path_to_project** | **str** | | +**uri** | **str** | | + +## Example + +```python +from api_client.models.lsp_document_request import LspDocumentRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of LspDocumentRequest from a JSON string +lsp_document_request_instance = LspDocumentRequest.from_json(json) +# print the JSON string representation of the object +print(LspDocumentRequest.to_json()) + +# convert the object into a dict +lsp_document_request_dict = lsp_document_request_instance.to_dict() +# create an instance of LspDocumentRequest from a dict +lsp_document_request_from_dict = LspDocumentRequest.from_dict(lsp_document_request_dict) +``` +[[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/packages/python/src/api_client/docs/LspLocation.md b/packages/python/src/api_client/docs/LspLocation.md new file mode 100644 index 0000000..6544222 --- /dev/null +++ b/packages/python/src/api_client/docs/LspLocation.md @@ -0,0 +1,30 @@ +# LspLocation + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**range** | [**LspRange**](LspRange.md) | | +**uri** | **str** | | + +## Example + +```python +from api_client.models.lsp_location import LspLocation + +# TODO update the JSON string below +json = "{}" +# create an instance of LspLocation from a JSON string +lsp_location_instance = LspLocation.from_json(json) +# print the JSON string representation of the object +print(LspLocation.to_json()) + +# convert the object into a dict +lsp_location_dict = lsp_location_instance.to_dict() +# create an instance of LspLocation from a dict +lsp_location_from_dict = LspLocation.from_dict(lsp_location_dict) +``` +[[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/packages/python/src/api_client/docs/LspPosition.md b/packages/python/src/api_client/docs/LspPosition.md new file mode 100644 index 0000000..c175470 --- /dev/null +++ b/packages/python/src/api_client/docs/LspPosition.md @@ -0,0 +1,30 @@ +# LspPosition + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**character** | **int** | | +**line** | **int** | | + +## Example + +```python +from api_client.models.lsp_position import LspPosition + +# TODO update the JSON string below +json = "{}" +# create an instance of LspPosition from a JSON string +lsp_position_instance = LspPosition.from_json(json) +# print the JSON string representation of the object +print(LspPosition.to_json()) + +# convert the object into a dict +lsp_position_dict = lsp_position_instance.to_dict() +# create an instance of LspPosition from a dict +lsp_position_from_dict = LspPosition.from_dict(lsp_position_dict) +``` +[[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/packages/python/src/api_client/docs/LspRange.md b/packages/python/src/api_client/docs/LspRange.md new file mode 100644 index 0000000..5964511 --- /dev/null +++ b/packages/python/src/api_client/docs/LspRange.md @@ -0,0 +1,30 @@ +# LspRange + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**end** | [**LspPosition**](LspPosition.md) | | +**start** | [**LspPosition**](LspPosition.md) | | + +## Example + +```python +from api_client.models.lsp_range import LspRange + +# TODO update the JSON string below +json = "{}" +# create an instance of LspRange from a JSON string +lsp_range_instance = LspRange.from_json(json) +# print the JSON string representation of the object +print(LspRange.to_json()) + +# convert the object into a dict +lsp_range_dict = lsp_range_instance.to_dict() +# create an instance of LspRange from a dict +lsp_range_from_dict = LspRange.from_dict(lsp_range_dict) +``` +[[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/packages/python/src/api_client/docs/LspServerRequest.md b/packages/python/src/api_client/docs/LspServerRequest.md new file mode 100644 index 0000000..376a32a --- /dev/null +++ b/packages/python/src/api_client/docs/LspServerRequest.md @@ -0,0 +1,30 @@ +# LspServerRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**language_id** | **str** | | +**path_to_project** | **str** | | + +## Example + +```python +from api_client.models.lsp_server_request import LspServerRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of LspServerRequest from a JSON string +lsp_server_request_instance = LspServerRequest.from_json(json) +# print the JSON string representation of the object +print(LspServerRequest.to_json()) + +# convert the object into a dict +lsp_server_request_dict = lsp_server_request_instance.to_dict() +# create an instance of LspServerRequest from a dict +lsp_server_request_from_dict = LspServerRequest.from_dict(lsp_server_request_dict) +``` +[[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/packages/python/src/api_client/docs/LspSymbol.md b/packages/python/src/api_client/docs/LspSymbol.md new file mode 100644 index 0000000..d1c616f --- /dev/null +++ b/packages/python/src/api_client/docs/LspSymbol.md @@ -0,0 +1,31 @@ +# LspSymbol + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **int** | | +**location** | [**LspLocation**](LspLocation.md) | | +**name** | **str** | | + +## Example + +```python +from api_client.models.lsp_symbol import LspSymbol + +# TODO update the JSON string below +json = "{}" +# create an instance of LspSymbol from a JSON string +lsp_symbol_instance = LspSymbol.from_json(json) +# print the JSON string representation of the object +print(LspSymbol.to_json()) + +# convert the object into a dict +lsp_symbol_dict = lsp_symbol_instance.to_dict() +# create an instance of LspSymbol from a dict +lsp_symbol_from_dict = LspSymbol.from_dict(lsp_symbol_dict) +``` +[[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/packages/python/src/api_client/docs/Match.md b/packages/python/src/api_client/docs/Match.md new file mode 100644 index 0000000..efae882 --- /dev/null +++ b/packages/python/src/api_client/docs/Match.md @@ -0,0 +1,31 @@ +# Match + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | **str** | | +**file** | **str** | | +**line** | **int** | | + +## Example + +```python +from api_client.models.match import Match + +# TODO update the JSON string below +json = "{}" +# create an instance of Match from a JSON string +match_instance = Match.from_json(json) +# print the JSON string representation of the object +print(Match.to_json()) + +# convert the object into a dict +match_dict = match_instance.to_dict() +# create an instance of Match from a dict +match_from_dict = Match.from_dict(match_dict) +``` +[[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/packages/python/src/api_client/docs/NetworkKey.md b/packages/python/src/api_client/docs/NetworkKey.md new file mode 100644 index 0000000..29b6782 --- /dev/null +++ b/packages/python/src/api_client/docs/NetworkKey.md @@ -0,0 +1,29 @@ +# NetworkKey + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | **str** | | + +## Example + +```python +from api_client.models.network_key import NetworkKey + +# TODO update the JSON string below +json = "{}" +# create an instance of NetworkKey from a JSON string +network_key_instance = NetworkKey.from_json(json) +# print the JSON string representation of the object +print(NetworkKey.to_json()) + +# convert the object into a dict +network_key_dict = network_key_instance.to_dict() +# create an instance of NetworkKey from a dict +network_key_from_dict = NetworkKey.from_dict(network_key_dict) +``` +[[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/packages/python/src/api_client/docs/Position.md b/packages/python/src/api_client/docs/Position.md new file mode 100644 index 0000000..157927c --- /dev/null +++ b/packages/python/src/api_client/docs/Position.md @@ -0,0 +1,30 @@ +# Position + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**character** | **int** | | +**line** | **int** | | + +## Example + +```python +from api_client.models.position import Position + +# TODO update the JSON string below +json = "{}" +# create an instance of Position from a JSON string +position_instance = Position.from_json(json) +# print the JSON string representation of the object +print(Position.to_json()) + +# convert the object into a dict +position_dict = position_instance.to_dict() +# create an instance of Position from a dict +position_from_dict = Position.from_dict(position_dict) +``` +[[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/packages/python/src/api_client/docs/PrebuildApi.md b/packages/python/src/api_client/docs/PrebuildApi.md new file mode 100644 index 0000000..52cc460 --- /dev/null +++ b/packages/python/src/api_client/docs/PrebuildApi.md @@ -0,0 +1,486 @@ +# api_client.PrebuildApi + +All URIs are relative to *http://localhost:3986* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_prebuild**](PrebuildApi.md#delete_prebuild) | **DELETE** /project-config/{configName}/prebuild/{prebuildId} | Delete prebuild +[**get_prebuild**](PrebuildApi.md#get_prebuild) | **GET** /project-config/{configName}/prebuild/{prebuildId} | Get prebuild +[**list_prebuilds**](PrebuildApi.md#list_prebuilds) | **GET** /project-config/prebuild | List prebuilds +[**list_prebuilds_for_project_config**](PrebuildApi.md#list_prebuilds_for_project_config) | **GET** /project-config/{configName}/prebuild | List prebuilds for project config +[**process_git_event**](PrebuildApi.md#process_git_event) | **POST** /project-config/prebuild/process-git-event | ProcessGitEvent +[**set_prebuild**](PrebuildApi.md#set_prebuild) | **PUT** /project-config/{configName}/prebuild | Set prebuild + + +# **delete_prebuild** +> delete_prebuild(config_name, prebuild_id, force=force) + +Delete prebuild + +Delete prebuild + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.PrebuildApi(api_client) + config_name = 'config_name_example' # str | Project config name + prebuild_id = 'prebuild_id_example' # str | Prebuild ID + force = True # bool | Force (optional) + + try: + # Delete prebuild + api_instance.delete_prebuild(config_name, prebuild_id, force=force) + except Exception as e: + print("Exception when calling PrebuildApi->delete_prebuild: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **config_name** | **str**| Project config name | + **prebuild_id** | **str**| Prebuild ID | + **force** | **bool**| Force | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No Content | - | + +[[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) + +# **get_prebuild** +> PrebuildDTO get_prebuild(config_name, prebuild_id) + +Get prebuild + +Get prebuild + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.prebuild_dto import PrebuildDTO +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.PrebuildApi(api_client) + config_name = 'config_name_example' # str | Project config name + prebuild_id = 'prebuild_id_example' # str | Prebuild ID + + try: + # Get prebuild + api_response = api_instance.get_prebuild(config_name, prebuild_id) + print("The response of PrebuildApi->get_prebuild:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PrebuildApi->get_prebuild: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **config_name** | **str**| Project config name | + **prebuild_id** | **str**| Prebuild ID | + +### Return type + +[**PrebuildDTO**](PrebuildDTO.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **list_prebuilds** +> List[PrebuildDTO] list_prebuilds() + +List prebuilds + +List prebuilds + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.prebuild_dto import PrebuildDTO +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.PrebuildApi(api_client) + + try: + # List prebuilds + api_response = api_instance.list_prebuilds() + print("The response of PrebuildApi->list_prebuilds:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PrebuildApi->list_prebuilds: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**List[PrebuildDTO]**](PrebuildDTO.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **list_prebuilds_for_project_config** +> List[PrebuildDTO] list_prebuilds_for_project_config(config_name) + +List prebuilds for project config + +List prebuilds for project config + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.prebuild_dto import PrebuildDTO +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.PrebuildApi(api_client) + config_name = 'config_name_example' # str | Config name + + try: + # List prebuilds for project config + api_response = api_instance.list_prebuilds_for_project_config(config_name) + print("The response of PrebuildApi->list_prebuilds_for_project_config:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PrebuildApi->list_prebuilds_for_project_config: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **config_name** | **str**| Config name | + +### Return type + +[**List[PrebuildDTO]**](PrebuildDTO.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **process_git_event** +> process_git_event(workspace) + +ProcessGitEvent + +ProcessGitEvent + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.PrebuildApi(api_client) + workspace = None # object | Webhook event + + try: + # ProcessGitEvent + api_instance.process_git_event(workspace) + except Exception as e: + print("Exception when calling PrebuildApi->process_git_event: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace** | **object**| Webhook event | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **set_prebuild** +> str set_prebuild(config_name, prebuild) + +Set prebuild + +Set prebuild + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.create_prebuild_dto import CreatePrebuildDTO +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.PrebuildApi(api_client) + config_name = 'config_name_example' # str | Config name + prebuild = api_client.CreatePrebuildDTO() # CreatePrebuildDTO | Prebuild + + try: + # Set prebuild + api_response = api_instance.set_prebuild(config_name, prebuild) + print("The response of PrebuildApi->set_prebuild:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PrebuildApi->set_prebuild: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **config_name** | **str**| Config name | + **prebuild** | [**CreatePrebuildDTO**](CreatePrebuildDTO.md)| Prebuild | + +### Return type + +**str** + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | + +[[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/packages/python/src/api_client/docs/PrebuildConfig.md b/packages/python/src/api_client/docs/PrebuildConfig.md new file mode 100644 index 0000000..e0cc1ec --- /dev/null +++ b/packages/python/src/api_client/docs/PrebuildConfig.md @@ -0,0 +1,33 @@ +# PrebuildConfig + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**branch** | **str** | | +**commit_interval** | **int** | | +**id** | **str** | | +**retention** | **int** | | +**trigger_files** | **List[str]** | | + +## Example + +```python +from api_client.models.prebuild_config import PrebuildConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of PrebuildConfig from a JSON string +prebuild_config_instance = PrebuildConfig.from_json(json) +# print the JSON string representation of the object +print(PrebuildConfig.to_json()) + +# convert the object into a dict +prebuild_config_dict = prebuild_config_instance.to_dict() +# create an instance of PrebuildConfig from a dict +prebuild_config_from_dict = PrebuildConfig.from_dict(prebuild_config_dict) +``` +[[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/packages/python/src/api_client/docs/PrebuildDTO.md b/packages/python/src/api_client/docs/PrebuildDTO.md new file mode 100644 index 0000000..d89717d --- /dev/null +++ b/packages/python/src/api_client/docs/PrebuildDTO.md @@ -0,0 +1,34 @@ +# PrebuildDTO + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**branch** | **str** | | +**commit_interval** | **int** | | [optional] +**id** | **str** | | +**project_config_name** | **str** | | +**retention** | **int** | | +**trigger_files** | **List[str]** | | [optional] + +## Example + +```python +from api_client.models.prebuild_dto import PrebuildDTO + +# TODO update the JSON string below +json = "{}" +# create an instance of PrebuildDTO from a JSON string +prebuild_dto_instance = PrebuildDTO.from_json(json) +# print the JSON string representation of the object +print(PrebuildDTO.to_json()) + +# convert the object into a dict +prebuild_dto_dict = prebuild_dto_instance.to_dict() +# create an instance of PrebuildDTO from a dict +prebuild_dto_from_dict = PrebuildDTO.from_dict(prebuild_dto_dict) +``` +[[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/packages/python/src/api_client/docs/ProfileApi.md b/packages/python/src/api_client/docs/ProfileApi.md new file mode 100644 index 0000000..5078949 --- /dev/null +++ b/packages/python/src/api_client/docs/ProfileApi.md @@ -0,0 +1,235 @@ +# api_client.ProfileApi + +All URIs are relative to *http://localhost:3986* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_profile_data**](ProfileApi.md#delete_profile_data) | **DELETE** /profile | Delete profile data +[**get_profile_data**](ProfileApi.md#get_profile_data) | **GET** /profile | Get profile data +[**set_profile_data**](ProfileApi.md#set_profile_data) | **PUT** /profile | Set profile data + + +# **delete_profile_data** +> delete_profile_data() + +Delete profile data + +Delete profile data + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.ProfileApi(api_client) + + try: + # Delete profile data + api_instance.delete_profile_data() + except Exception as e: + print("Exception when calling ProfileApi->delete_profile_data: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No Content | - | + +[[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) + +# **get_profile_data** +> ProfileData get_profile_data() + +Get profile data + +Get profile data + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.profile_data import ProfileData +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.ProfileApi(api_client) + + try: + # Get profile data + api_response = api_instance.get_profile_data() + print("The response of ProfileApi->get_profile_data:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProfileApi->get_profile_data: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**ProfileData**](ProfileData.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **set_profile_data** +> set_profile_data(profile_data) + +Set profile data + +Set profile data + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.profile_data import ProfileData +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.ProfileApi(api_client) + profile_data = api_client.ProfileData() # ProfileData | Profile data + + try: + # Set profile data + api_instance.set_profile_data(profile_data) + except Exception as e: + print("Exception when calling ProfileApi->set_profile_data: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **profile_data** | [**ProfileData**](ProfileData.md)| Profile data | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | + +[[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/packages/python/src/api_client/docs/ProfileData.md b/packages/python/src/api_client/docs/ProfileData.md new file mode 100644 index 0000000..20d6a0e --- /dev/null +++ b/packages/python/src/api_client/docs/ProfileData.md @@ -0,0 +1,29 @@ +# ProfileData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**env_vars** | **Dict[str, str]** | | + +## Example + +```python +from api_client.models.profile_data import ProfileData + +# TODO update the JSON string below +json = "{}" +# create an instance of ProfileData from a JSON string +profile_data_instance = ProfileData.from_json(json) +# print the JSON string representation of the object +print(ProfileData.to_json()) + +# convert the object into a dict +profile_data_dict = profile_data_instance.to_dict() +# create an instance of ProfileData from a dict +profile_data_from_dict = ProfileData.from_dict(profile_data_dict) +``` +[[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/packages/python/src/api_client/docs/Project.md b/packages/python/src/api_client/docs/Project.md new file mode 100644 index 0000000..e8c4301 --- /dev/null +++ b/packages/python/src/api_client/docs/Project.md @@ -0,0 +1,38 @@ +# Project + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**build_config** | [**BuildConfig**](BuildConfig.md) | | [optional] +**env_vars** | **Dict[str, str]** | | +**git_provider_config_id** | **str** | | [optional] +**image** | **str** | | +**name** | **str** | | +**repository** | [**GitRepository**](GitRepository.md) | | +**state** | [**ProjectState**](ProjectState.md) | | [optional] +**target** | **str** | | +**user** | **str** | | +**workspace_id** | **str** | | + +## Example + +```python +from api_client.models.project import Project + +# TODO update the JSON string below +json = "{}" +# create an instance of Project from a JSON string +project_instance = Project.from_json(json) +# print the JSON string representation of the object +print(Project.to_json()) + +# convert the object into a dict +project_dict = project_instance.to_dict() +# create an instance of Project from a dict +project_from_dict = Project.from_dict(project_dict) +``` +[[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/packages/python/src/api_client/docs/ProjectConfig.md b/packages/python/src/api_client/docs/ProjectConfig.md new file mode 100644 index 0000000..0b1bf09 --- /dev/null +++ b/packages/python/src/api_client/docs/ProjectConfig.md @@ -0,0 +1,37 @@ +# ProjectConfig + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**build_config** | [**BuildConfig**](BuildConfig.md) | | [optional] +**default** | **bool** | | +**env_vars** | **Dict[str, str]** | | +**git_provider_config_id** | **str** | | [optional] +**image** | **str** | | +**name** | **str** | | +**prebuilds** | [**List[PrebuildConfig]**](PrebuildConfig.md) | | [optional] +**repository_url** | **str** | | +**user** | **str** | | + +## Example + +```python +from api_client.models.project_config import ProjectConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of ProjectConfig from a JSON string +project_config_instance = ProjectConfig.from_json(json) +# print the JSON string representation of the object +print(ProjectConfig.to_json()) + +# convert the object into a dict +project_config_dict = project_config_instance.to_dict() +# create an instance of ProjectConfig from a dict +project_config_from_dict = ProjectConfig.from_dict(project_config_dict) +``` +[[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/packages/python/src/api_client/docs/ProjectConfigApi.md b/packages/python/src/api_client/docs/ProjectConfigApi.md new file mode 100644 index 0000000..3535eb6 --- /dev/null +++ b/packages/python/src/api_client/docs/ProjectConfigApi.md @@ -0,0 +1,478 @@ +# api_client.ProjectConfigApi + +All URIs are relative to *http://localhost:3986* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_project_config**](ProjectConfigApi.md#delete_project_config) | **DELETE** /project-config/{configName} | Delete project config data +[**get_default_project_config**](ProjectConfigApi.md#get_default_project_config) | **GET** /project-config/default/{gitUrl} | Get project configs by git url +[**get_project_config**](ProjectConfigApi.md#get_project_config) | **GET** /project-config/{configName} | Get project config data +[**list_project_configs**](ProjectConfigApi.md#list_project_configs) | **GET** /project-config | List project configs +[**set_default_project_config**](ProjectConfigApi.md#set_default_project_config) | **PATCH** /project-config/{configName}/set-default | Set project config to default +[**set_project_config**](ProjectConfigApi.md#set_project_config) | **PUT** /project-config | Set project config data + + +# **delete_project_config** +> delete_project_config(config_name, force=force) + +Delete project config data + +Delete project config data + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.ProjectConfigApi(api_client) + config_name = 'config_name_example' # str | Config name + force = True # bool | Force (optional) + + try: + # Delete project config data + api_instance.delete_project_config(config_name, force=force) + except Exception as e: + print("Exception when calling ProjectConfigApi->delete_project_config: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **config_name** | **str**| Config name | + **force** | **bool**| Force | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No Content | - | + +[[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) + +# **get_default_project_config** +> ProjectConfig get_default_project_config(git_url) + +Get project configs by git url + +Get project configs by git url + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.project_config import ProjectConfig +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.ProjectConfigApi(api_client) + git_url = 'git_url_example' # str | Git URL + + try: + # Get project configs by git url + api_response = api_instance.get_default_project_config(git_url) + print("The response of ProjectConfigApi->get_default_project_config:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectConfigApi->get_default_project_config: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **git_url** | **str**| Git URL | + +### Return type + +[**ProjectConfig**](ProjectConfig.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **get_project_config** +> ProjectConfig get_project_config(config_name) + +Get project config data + +Get project config data + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.project_config import ProjectConfig +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.ProjectConfigApi(api_client) + config_name = 'config_name_example' # str | Config name + + try: + # Get project config data + api_response = api_instance.get_project_config(config_name) + print("The response of ProjectConfigApi->get_project_config:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectConfigApi->get_project_config: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **config_name** | **str**| Config name | + +### Return type + +[**ProjectConfig**](ProjectConfig.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **list_project_configs** +> List[ProjectConfig] list_project_configs() + +List project configs + +List project configs + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.project_config import ProjectConfig +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.ProjectConfigApi(api_client) + + try: + # List project configs + api_response = api_instance.list_project_configs() + print("The response of ProjectConfigApi->list_project_configs:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectConfigApi->list_project_configs: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**List[ProjectConfig]**](ProjectConfig.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **set_default_project_config** +> set_default_project_config(config_name) + +Set project config to default + +Set project config to default + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.ProjectConfigApi(api_client) + config_name = 'config_name_example' # str | Config name + + try: + # Set project config to default + api_instance.set_default_project_config(config_name) + except Exception as e: + print("Exception when calling ProjectConfigApi->set_default_project_config: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **config_name** | **str**| Config name | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **set_project_config** +> set_project_config(project_config) + +Set project config data + +Set project config data + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.create_project_config_dto import CreateProjectConfigDTO +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.ProjectConfigApi(api_client) + project_config = api_client.CreateProjectConfigDTO() # CreateProjectConfigDTO | Project config + + try: + # Set project config data + api_instance.set_project_config(project_config) + except Exception as e: + print("Exception when calling ProjectConfigApi->set_project_config: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_config** | [**CreateProjectConfigDTO**](CreateProjectConfigDTO.md)| Project config | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | + +[[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/packages/python/src/api_client/docs/ProjectDirResponse.md b/packages/python/src/api_client/docs/ProjectDirResponse.md new file mode 100644 index 0000000..adf55c9 --- /dev/null +++ b/packages/python/src/api_client/docs/ProjectDirResponse.md @@ -0,0 +1,29 @@ +# ProjectDirResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dir** | **str** | | [optional] + +## Example + +```python +from api_client.models.project_dir_response import ProjectDirResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ProjectDirResponse from a JSON string +project_dir_response_instance = ProjectDirResponse.from_json(json) +# print the JSON string representation of the object +print(ProjectDirResponse.to_json()) + +# convert the object into a dict +project_dir_response_dict = project_dir_response_instance.to_dict() +# create an instance of ProjectDirResponse from a dict +project_dir_response_from_dict = ProjectDirResponse.from_dict(project_dir_response_dict) +``` +[[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/packages/python/src/api_client/docs/ProjectInfo.md b/packages/python/src/api_client/docs/ProjectInfo.md new file mode 100644 index 0000000..60561c3 --- /dev/null +++ b/packages/python/src/api_client/docs/ProjectInfo.md @@ -0,0 +1,33 @@ +# ProjectInfo + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created** | **str** | | +**is_running** | **bool** | | +**name** | **str** | | +**provider_metadata** | **str** | | [optional] +**workspace_id** | **str** | | + +## Example + +```python +from api_client.models.project_info import ProjectInfo + +# TODO update the JSON string below +json = "{}" +# create an instance of ProjectInfo from a JSON string +project_info_instance = ProjectInfo.from_json(json) +# print the JSON string representation of the object +print(ProjectInfo.to_json()) + +# convert the object into a dict +project_info_dict = project_info_instance.to_dict() +# create an instance of ProjectInfo from a dict +project_info_from_dict = ProjectInfo.from_dict(project_info_dict) +``` +[[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/packages/python/src/api_client/docs/ProjectState.md b/packages/python/src/api_client/docs/ProjectState.md new file mode 100644 index 0000000..de680a2 --- /dev/null +++ b/packages/python/src/api_client/docs/ProjectState.md @@ -0,0 +1,31 @@ +# ProjectState + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**git_status** | [**GitStatus**](GitStatus.md) | | [optional] +**updated_at** | **str** | | +**uptime** | **int** | | + +## Example + +```python +from api_client.models.project_state import ProjectState + +# TODO update the JSON string below +json = "{}" +# create an instance of ProjectState from a JSON string +project_state_instance = ProjectState.from_json(json) +# print the JSON string representation of the object +print(ProjectState.to_json()) + +# convert the object into a dict +project_state_dict = project_state_instance.to_dict() +# create an instance of ProjectState from a dict +project_state_from_dict = ProjectState.from_dict(project_state_dict) +``` +[[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/packages/python/src/api_client/docs/Provider.md b/packages/python/src/api_client/docs/Provider.md new file mode 100644 index 0000000..e5510a6 --- /dev/null +++ b/packages/python/src/api_client/docs/Provider.md @@ -0,0 +1,31 @@ +# Provider + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | **str** | | [optional] +**name** | **str** | | +**version** | **str** | | + +## Example + +```python +from api_client.models.provider import Provider + +# TODO update the JSON string below +json = "{}" +# create an instance of Provider from a JSON string +provider_instance = Provider.from_json(json) +# print the JSON string representation of the object +print(Provider.to_json()) + +# convert the object into a dict +provider_dict = provider_instance.to_dict() +# create an instance of Provider from a dict +provider_from_dict = Provider.from_dict(provider_dict) +``` +[[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/packages/python/src/api_client/docs/ProviderApi.md b/packages/python/src/api_client/docs/ProviderApi.md new file mode 100644 index 0000000..03bf39e --- /dev/null +++ b/packages/python/src/api_client/docs/ProviderApi.md @@ -0,0 +1,319 @@ +# api_client.ProviderApi + +All URIs are relative to *http://localhost:3986* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_target_manifest**](ProviderApi.md#get_target_manifest) | **GET** /provider/{provider}/target-manifest | Get provider target manifest +[**install_provider**](ProviderApi.md#install_provider) | **POST** /provider/install | Install a provider +[**list_providers**](ProviderApi.md#list_providers) | **GET** /provider | List providers +[**uninstall_provider**](ProviderApi.md#uninstall_provider) | **POST** /provider/{provider}/uninstall | Uninstall a provider + + +# **get_target_manifest** +> Dict[str, ProviderProviderTargetProperty] get_target_manifest(provider) + +Get provider target manifest + +Get provider target manifest + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.provider_provider_target_property import ProviderProviderTargetProperty +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.ProviderApi(api_client) + provider = 'provider_example' # str | Provider name + + try: + # Get provider target manifest + api_response = api_instance.get_target_manifest(provider) + print("The response of ProviderApi->get_target_manifest:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProviderApi->get_target_manifest: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **provider** | **str**| Provider name | + +### Return type + +[**Dict[str, ProviderProviderTargetProperty]**](ProviderProviderTargetProperty.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **install_provider** +> install_provider(provider) + +Install a provider + +Install a provider + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.install_provider_request import InstallProviderRequest +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.ProviderApi(api_client) + provider = api_client.InstallProviderRequest() # InstallProviderRequest | Provider to install + + try: + # Install a provider + api_instance.install_provider(provider) + except Exception as e: + print("Exception when calling ProviderApi->install_provider: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **provider** | [**InstallProviderRequest**](InstallProviderRequest.md)| Provider to install | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **list_providers** +> List[Provider] list_providers() + +List providers + +List providers + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.provider import Provider +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.ProviderApi(api_client) + + try: + # List providers + api_response = api_instance.list_providers() + print("The response of ProviderApi->list_providers:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProviderApi->list_providers: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**List[Provider]**](Provider.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **uninstall_provider** +> uninstall_provider(provider) + +Uninstall a provider + +Uninstall a provider + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.ProviderApi(api_client) + provider = 'provider_example' # str | Provider to uninstall + + try: + # Uninstall a provider + api_instance.uninstall_provider(provider) + except Exception as e: + print("Exception when calling ProviderApi->uninstall_provider: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **provider** | **str**| Provider to uninstall | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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/packages/python/src/api_client/docs/ProviderProviderInfo.md b/packages/python/src/api_client/docs/ProviderProviderInfo.md new file mode 100644 index 0000000..c511b42 --- /dev/null +++ b/packages/python/src/api_client/docs/ProviderProviderInfo.md @@ -0,0 +1,31 @@ +# ProviderProviderInfo + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | **str** | | [optional] +**name** | **str** | | +**version** | **str** | | + +## Example + +```python +from api_client.models.provider_provider_info import ProviderProviderInfo + +# TODO update the JSON string below +json = "{}" +# create an instance of ProviderProviderInfo from a JSON string +provider_provider_info_instance = ProviderProviderInfo.from_json(json) +# print the JSON string representation of the object +print(ProviderProviderInfo.to_json()) + +# convert the object into a dict +provider_provider_info_dict = provider_provider_info_instance.to_dict() +# create an instance of ProviderProviderInfo from a dict +provider_provider_info_from_dict = ProviderProviderInfo.from_dict(provider_provider_info_dict) +``` +[[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/packages/python/src/api_client/docs/ProviderProviderTargetProperty.md b/packages/python/src/api_client/docs/ProviderProviderTargetProperty.md new file mode 100644 index 0000000..4f37f34 --- /dev/null +++ b/packages/python/src/api_client/docs/ProviderProviderTargetProperty.md @@ -0,0 +1,35 @@ +# ProviderProviderTargetProperty + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**default_value** | **str** | DefaultValue is converted into the appropriate type based on the Type If the property is a FilePath, the DefaultValue is a path to a directory | [optional] +**description** | **str** | Brief description of the property | [optional] +**disabled_predicate** | **str** | A regex string matched with the name of the target to determine if the property should be disabled If the regex matches the target name, the property will be disabled E.g. \"^local$\" will disable the property for the local target | [optional] +**input_masked** | **bool** | | [optional] +**options** | **List[str]** | Options is only used if the Type is ProviderTargetPropertyTypeOption | [optional] +**suggestions** | **List[str]** | Suggestions is an optional list of auto-complete values to assist the user while filling the field | [optional] +**type** | [**ProviderProviderTargetPropertyType**](ProviderProviderTargetPropertyType.md) | | [optional] + +## Example + +```python +from api_client.models.provider_provider_target_property import ProviderProviderTargetProperty + +# TODO update the JSON string below +json = "{}" +# create an instance of ProviderProviderTargetProperty from a JSON string +provider_provider_target_property_instance = ProviderProviderTargetProperty.from_json(json) +# print the JSON string representation of the object +print(ProviderProviderTargetProperty.to_json()) + +# convert the object into a dict +provider_provider_target_property_dict = provider_provider_target_property_instance.to_dict() +# create an instance of ProviderProviderTargetProperty from a dict +provider_provider_target_property_from_dict = ProviderProviderTargetProperty.from_dict(provider_provider_target_property_dict) +``` +[[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/packages/python/src/api_client/docs/ProviderProviderTargetPropertyType.md b/packages/python/src/api_client/docs/ProviderProviderTargetPropertyType.md new file mode 100644 index 0000000..153e38d --- /dev/null +++ b/packages/python/src/api_client/docs/ProviderProviderTargetPropertyType.md @@ -0,0 +1,20 @@ +# ProviderProviderTargetPropertyType + + +## Enum + +* `STRING` (value: `'string'`) + +* `OPTION` (value: `'option'`) + +* `BOOLEAN` (value: `'boolean'`) + +* `INT` (value: `'int'`) + +* `FLOAT` (value: `'float'`) + +* `FILE_MINUS_PATH` (value: `'file-path'`) + +[[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/packages/python/src/api_client/docs/ProviderTarget.md b/packages/python/src/api_client/docs/ProviderTarget.md new file mode 100644 index 0000000..68c7dec --- /dev/null +++ b/packages/python/src/api_client/docs/ProviderTarget.md @@ -0,0 +1,32 @@ +# ProviderTarget + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**is_default** | **bool** | | +**name** | **str** | | +**options** | **str** | JSON encoded map of options | +**provider_info** | [**ProviderProviderInfo**](ProviderProviderInfo.md) | | + +## Example + +```python +from api_client.models.provider_target import ProviderTarget + +# TODO update the JSON string below +json = "{}" +# create an instance of ProviderTarget from a JSON string +provider_target_instance = ProviderTarget.from_json(json) +# print the JSON string representation of the object +print(ProviderTarget.to_json()) + +# convert the object into a dict +provider_target_dict = provider_target_instance.to_dict() +# create an instance of ProviderTarget from a dict +provider_target_from_dict = ProviderTarget.from_dict(provider_target_dict) +``` +[[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/packages/python/src/api_client/docs/ReplaceRequest.md b/packages/python/src/api_client/docs/ReplaceRequest.md new file mode 100644 index 0000000..4f3055b --- /dev/null +++ b/packages/python/src/api_client/docs/ReplaceRequest.md @@ -0,0 +1,31 @@ +# ReplaceRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**files** | **List[str]** | | +**new_value** | **str** | | +**pattern** | **str** | | + +## Example + +```python +from api_client.models.replace_request import ReplaceRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of ReplaceRequest from a JSON string +replace_request_instance = ReplaceRequest.from_json(json) +# print the JSON string representation of the object +print(ReplaceRequest.to_json()) + +# convert the object into a dict +replace_request_dict = replace_request_instance.to_dict() +# create an instance of ReplaceRequest from a dict +replace_request_from_dict = ReplaceRequest.from_dict(replace_request_dict) +``` +[[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/packages/python/src/api_client/docs/ReplaceResult.md b/packages/python/src/api_client/docs/ReplaceResult.md new file mode 100644 index 0000000..fd45d5e --- /dev/null +++ b/packages/python/src/api_client/docs/ReplaceResult.md @@ -0,0 +1,31 @@ +# ReplaceResult + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **str** | | [optional] +**file** | **str** | | [optional] +**success** | **bool** | | [optional] + +## Example + +```python +from api_client.models.replace_result import ReplaceResult + +# TODO update the JSON string below +json = "{}" +# create an instance of ReplaceResult from a JSON string +replace_result_instance = ReplaceResult.from_json(json) +# print the JSON string representation of the object +print(ReplaceResult.to_json()) + +# convert the object into a dict +replace_result_dict = replace_result_instance.to_dict() +# create an instance of ReplaceResult from a dict +replace_result_from_dict = ReplaceResult.from_dict(replace_result_dict) +``` +[[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/packages/python/src/api_client/docs/RepositoryUrl.md b/packages/python/src/api_client/docs/RepositoryUrl.md new file mode 100644 index 0000000..33e78d0 --- /dev/null +++ b/packages/python/src/api_client/docs/RepositoryUrl.md @@ -0,0 +1,29 @@ +# RepositoryUrl + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | | + +## Example + +```python +from api_client.models.repository_url import RepositoryUrl + +# TODO update the JSON string below +json = "{}" +# create an instance of RepositoryUrl from a JSON string +repository_url_instance = RepositoryUrl.from_json(json) +# print the JSON string representation of the object +print(RepositoryUrl.to_json()) + +# convert the object into a dict +repository_url_dict = repository_url_instance.to_dict() +# create an instance of RepositoryUrl from a dict +repository_url_from_dict = RepositoryUrl.from_dict(repository_url_dict) +``` +[[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/packages/python/src/api_client/docs/Sample.md b/packages/python/src/api_client/docs/Sample.md new file mode 100644 index 0000000..53a521c --- /dev/null +++ b/packages/python/src/api_client/docs/Sample.md @@ -0,0 +1,31 @@ +# Sample + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **str** | | +**git_url** | **str** | | +**name** | **str** | | + +## Example + +```python +from api_client.models.sample import Sample + +# TODO update the JSON string below +json = "{}" +# create an instance of Sample from a JSON string +sample_instance = Sample.from_json(json) +# print the JSON string representation of the object +print(Sample.to_json()) + +# convert the object into a dict +sample_dict = sample_instance.to_dict() +# create an instance of Sample from a dict +sample_from_dict = Sample.from_dict(sample_dict) +``` +[[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/packages/python/src/api_client/docs/SampleApi.md b/packages/python/src/api_client/docs/SampleApi.md new file mode 100644 index 0000000..398787f --- /dev/null +++ b/packages/python/src/api_client/docs/SampleApi.md @@ -0,0 +1,84 @@ +# api_client.SampleApi + +All URIs are relative to *http://localhost:3986* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**list_samples**](SampleApi.md#list_samples) | **GET** /sample | List samples + + +# **list_samples** +> List[Sample] list_samples() + +List samples + +List samples + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.sample import Sample +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.SampleApi(api_client) + + try: + # List samples + api_response = api_instance.list_samples() + print("The response of SampleApi->list_samples:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SampleApi->list_samples: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**List[Sample]**](Sample.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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/packages/python/src/api_client/docs/SearchFilesResponse.md b/packages/python/src/api_client/docs/SearchFilesResponse.md new file mode 100644 index 0000000..7bcc279 --- /dev/null +++ b/packages/python/src/api_client/docs/SearchFilesResponse.md @@ -0,0 +1,29 @@ +# SearchFilesResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**files** | **List[str]** | | + +## Example + +```python +from api_client.models.search_files_response import SearchFilesResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of SearchFilesResponse from a JSON string +search_files_response_instance = SearchFilesResponse.from_json(json) +# print the JSON string representation of the object +print(SearchFilesResponse.to_json()) + +# convert the object into a dict +search_files_response_dict = search_files_response_instance.to_dict() +# create an instance of SearchFilesResponse from a dict +search_files_response_from_dict = SearchFilesResponse.from_dict(search_files_response_dict) +``` +[[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/packages/python/src/api_client/docs/ServerApi.md b/packages/python/src/api_client/docs/ServerApi.md new file mode 100644 index 0000000..be76a5c --- /dev/null +++ b/packages/python/src/api_client/docs/ServerApi.md @@ -0,0 +1,315 @@ +# api_client.ServerApi + +All URIs are relative to *http://localhost:3986* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**generate_network_key**](ServerApi.md#generate_network_key) | **POST** /server/network-key | Generate a new authentication key +[**get_config**](ServerApi.md#get_config) | **GET** /server/config | Get the server configuration +[**get_server_log_files**](ServerApi.md#get_server_log_files) | **GET** /server/logs | List server log files +[**set_config**](ServerApi.md#set_config) | **POST** /server/config | Set the server configuration + + +# **generate_network_key** +> NetworkKey generate_network_key() + +Generate a new authentication key + +Generate a new authentication key + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.network_key import NetworkKey +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.ServerApi(api_client) + + try: + # Generate a new authentication key + api_response = api_instance.generate_network_key() + print("The response of ServerApi->generate_network_key:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ServerApi->generate_network_key: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**NetworkKey**](NetworkKey.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **get_config** +> ServerConfig get_config() + +Get the server configuration + +Get the server configuration + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.server_config import ServerConfig +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.ServerApi(api_client) + + try: + # Get the server configuration + api_response = api_instance.get_config() + print("The response of ServerApi->get_config:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ServerApi->get_config: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**ServerConfig**](ServerConfig.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **get_server_log_files** +> List[str] get_server_log_files() + +List server log files + +List server log files + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.ServerApi(api_client) + + try: + # List server log files + api_response = api_instance.get_server_log_files() + print("The response of ServerApi->get_server_log_files:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ServerApi->get_server_log_files: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**List[str]** + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **set_config** +> ServerConfig set_config(config) + +Set the server configuration + +Set the server configuration + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.server_config import ServerConfig +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.ServerApi(api_client) + config = api_client.ServerConfig() # ServerConfig | Server configuration + + try: + # Set the server configuration + api_response = api_instance.set_config(config) + print("The response of ServerApi->set_config:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ServerApi->set_config: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **config** | [**ServerConfig**](ServerConfig.md)| Server configuration | + +### Return type + +[**ServerConfig**](ServerConfig.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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/packages/python/src/api_client/docs/ServerConfig.md b/packages/python/src/api_client/docs/ServerConfig.md new file mode 100644 index 0000000..cc81064 --- /dev/null +++ b/packages/python/src/api_client/docs/ServerConfig.md @@ -0,0 +1,45 @@ +# ServerConfig + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_port** | **int** | | +**binaries_path** | **str** | | +**build_image_namespace** | **str** | | [optional] +**builder_image** | **str** | | +**builder_registry_server** | **str** | | +**default_project_image** | **str** | | +**default_project_user** | **str** | | +**frps** | [**FRPSConfig**](FRPSConfig.md) | | [optional] +**headscale_port** | **int** | | +**id** | **str** | | +**local_builder_registry_image** | **str** | | +**local_builder_registry_port** | **int** | | +**log_file** | [**LogFileConfig**](LogFileConfig.md) | | +**providers_dir** | **str** | | +**registry_url** | **str** | | +**samples_index_url** | **str** | | [optional] +**server_download_url** | **str** | | + +## Example + +```python +from api_client.models.server_config import ServerConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of ServerConfig from a JSON string +server_config_instance = ServerConfig.from_json(json) +# print the JSON string representation of the object +print(ServerConfig.to_json()) + +# convert the object into a dict +server_config_dict = server_config_instance.to_dict() +# create an instance of ServerConfig from a dict +server_config_from_dict = ServerConfig.from_dict(server_config_dict) +``` +[[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/packages/python/src/api_client/docs/SetGitProviderConfig.md b/packages/python/src/api_client/docs/SetGitProviderConfig.md new file mode 100644 index 0000000..045bd0c --- /dev/null +++ b/packages/python/src/api_client/docs/SetGitProviderConfig.md @@ -0,0 +1,36 @@ +# SetGitProviderConfig + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**alias** | **str** | | [optional] +**base_api_url** | **str** | | [optional] +**id** | **str** | | [optional] +**provider_id** | **str** | | +**signing_key** | **str** | | [optional] +**signing_method** | [**SigningMethod**](SigningMethod.md) | | [optional] +**token** | **str** | | +**username** | **str** | | [optional] + +## Example + +```python +from api_client.models.set_git_provider_config import SetGitProviderConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of SetGitProviderConfig from a JSON string +set_git_provider_config_instance = SetGitProviderConfig.from_json(json) +# print the JSON string representation of the object +print(SetGitProviderConfig.to_json()) + +# convert the object into a dict +set_git_provider_config_dict = set_git_provider_config_instance.to_dict() +# create an instance of SetGitProviderConfig from a dict +set_git_provider_config_from_dict = SetGitProviderConfig.from_dict(set_git_provider_config_dict) +``` +[[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/packages/python/src/api_client/docs/SetProjectState.md b/packages/python/src/api_client/docs/SetProjectState.md new file mode 100644 index 0000000..758ecf7 --- /dev/null +++ b/packages/python/src/api_client/docs/SetProjectState.md @@ -0,0 +1,30 @@ +# SetProjectState + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**git_status** | [**GitStatus**](GitStatus.md) | | [optional] +**uptime** | **int** | | + +## Example + +```python +from api_client.models.set_project_state import SetProjectState + +# TODO update the JSON string below +json = "{}" +# create an instance of SetProjectState from a JSON string +set_project_state_instance = SetProjectState.from_json(json) +# print the JSON string representation of the object +print(SetProjectState.to_json()) + +# convert the object into a dict +set_project_state_dict = set_project_state_instance.to_dict() +# create an instance of SetProjectState from a dict +set_project_state_from_dict = SetProjectState.from_dict(set_project_state_dict) +``` +[[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/packages/python/src/api_client/docs/SigningMethod.md b/packages/python/src/api_client/docs/SigningMethod.md new file mode 100644 index 0000000..28ed93b --- /dev/null +++ b/packages/python/src/api_client/docs/SigningMethod.md @@ -0,0 +1,12 @@ +# SigningMethod + + +## Enum + +* `SSH` (value: `'ssh'`) + +* `GPG` (value: `'gpg'`) + +[[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/packages/python/src/api_client/docs/Status.md b/packages/python/src/api_client/docs/Status.md new file mode 100644 index 0000000..3f2e84b --- /dev/null +++ b/packages/python/src/api_client/docs/Status.md @@ -0,0 +1,24 @@ +# Status + + +## Enum + +* `UNMODIFIED` (value: `'Unmodified'`) + +* `UNTRACKED` (value: `'Untracked'`) + +* `MODIFIED` (value: `'Modified'`) + +* `ADDED` (value: `'Added'`) + +* `DELETED` (value: `'Deleted'`) + +* `RENAMED` (value: `'Renamed'`) + +* `COPIED` (value: `'Copied'`) + +* `UPDATED_BUT_UNMERGED` (value: `'Updated but unmerged'`) + +[[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/packages/python/src/api_client/docs/TargetApi.md b/packages/python/src/api_client/docs/TargetApi.md new file mode 100644 index 0000000..8cee21a --- /dev/null +++ b/packages/python/src/api_client/docs/TargetApi.md @@ -0,0 +1,316 @@ +# api_client.TargetApi + +All URIs are relative to *http://localhost:3986* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**list_targets**](TargetApi.md#list_targets) | **GET** /target | List targets +[**remove_target**](TargetApi.md#remove_target) | **DELETE** /target/{target} | Remove a target +[**set_default_target**](TargetApi.md#set_default_target) | **PATCH** /target/{target}/set-default | Set target to default +[**set_target**](TargetApi.md#set_target) | **PUT** /target | Set a target + + +# **list_targets** +> List[ProviderTarget] list_targets() + +List targets + +List targets + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.provider_target import ProviderTarget +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.TargetApi(api_client) + + try: + # List targets + api_response = api_instance.list_targets() + print("The response of TargetApi->list_targets:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TargetApi->list_targets: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**List[ProviderTarget]**](ProviderTarget.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **remove_target** +> remove_target(target) + +Remove a target + +Remove a target + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.TargetApi(api_client) + target = 'target_example' # str | Target name + + try: + # Remove a target + api_instance.remove_target(target) + except Exception as e: + print("Exception when calling TargetApi->remove_target: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **target** | **str**| Target name | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No Content | - | + +[[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) + +# **set_default_target** +> set_default_target(target) + +Set target to default + +Set target to default + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.TargetApi(api_client) + target = 'target_example' # str | Target name + + try: + # Set target to default + api_instance.set_default_target(target) + except Exception as e: + print("Exception when calling TargetApi->set_default_target: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **target** | **str**| Target name | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **set_target** +> set_target(target) + +Set a target + +Set a target + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.create_provider_target_dto import CreateProviderTargetDTO +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.TargetApi(api_client) + target = api_client.CreateProviderTargetDTO() # CreateProviderTargetDTO | Target to set + + try: + # Set a target + api_instance.set_target(target) + except Exception as e: + print("Exception when calling TargetApi->set_target: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **target** | [**CreateProviderTargetDTO**](CreateProviderTargetDTO.md)| Target to set | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | + +[[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/packages/python/src/api_client/docs/Workspace.md b/packages/python/src/api_client/docs/Workspace.md new file mode 100644 index 0000000..9737fb6 --- /dev/null +++ b/packages/python/src/api_client/docs/Workspace.md @@ -0,0 +1,32 @@ +# Workspace + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | +**name** | **str** | | +**projects** | [**List[Project]**](Project.md) | | +**target** | **str** | | + +## Example + +```python +from api_client.models.workspace import Workspace + +# TODO update the JSON string below +json = "{}" +# create an instance of Workspace from a JSON string +workspace_instance = Workspace.from_json(json) +# print the JSON string representation of the object +print(Workspace.to_json()) + +# convert the object into a dict +workspace_dict = workspace_instance.to_dict() +# create an instance of Workspace from a dict +workspace_from_dict = Workspace.from_dict(workspace_dict) +``` +[[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/packages/python/src/api_client/docs/WorkspaceApi.md b/packages/python/src/api_client/docs/WorkspaceApi.md new file mode 100644 index 0000000..d1e4c4b --- /dev/null +++ b/packages/python/src/api_client/docs/WorkspaceApi.md @@ -0,0 +1,724 @@ +# api_client.WorkspaceApi + +All URIs are relative to *http://localhost:3986* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_workspace**](WorkspaceApi.md#create_workspace) | **POST** /workspace | Create a workspace +[**get_workspace**](WorkspaceApi.md#get_workspace) | **GET** /workspace/{workspaceId} | Get workspace info +[**list_workspaces**](WorkspaceApi.md#list_workspaces) | **GET** /workspace | List workspaces +[**remove_workspace**](WorkspaceApi.md#remove_workspace) | **DELETE** /workspace/{workspaceId} | Remove workspace +[**set_project_state**](WorkspaceApi.md#set_project_state) | **POST** /workspace/{workspaceId}/{projectId}/state | Set project state +[**start_project**](WorkspaceApi.md#start_project) | **POST** /workspace/{workspaceId}/{projectId}/start | Start project +[**start_workspace**](WorkspaceApi.md#start_workspace) | **POST** /workspace/{workspaceId}/start | Start workspace +[**stop_project**](WorkspaceApi.md#stop_project) | **POST** /workspace/{workspaceId}/{projectId}/stop | Stop project +[**stop_workspace**](WorkspaceApi.md#stop_workspace) | **POST** /workspace/{workspaceId}/stop | Stop workspace + + +# **create_workspace** +> Workspace create_workspace(workspace) + +Create a workspace + +Create a workspace + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.create_workspace_dto import CreateWorkspaceDTO +from api_client.models.workspace import Workspace +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceApi(api_client) + workspace = api_client.CreateWorkspaceDTO() # CreateWorkspaceDTO | Create workspace + + try: + # Create a workspace + api_response = api_instance.create_workspace(workspace) + print("The response of WorkspaceApi->create_workspace:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WorkspaceApi->create_workspace: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace** | [**CreateWorkspaceDTO**](CreateWorkspaceDTO.md)| Create workspace | + +### Return type + +[**Workspace**](Workspace.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **get_workspace** +> WorkspaceDTO get_workspace(workspace_id, verbose=verbose) + +Get workspace info + +Get workspace info + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.workspace_dto import WorkspaceDTO +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + verbose = True # bool | Verbose (optional) + + try: + # Get workspace info + api_response = api_instance.get_workspace(workspace_id, verbose=verbose) + print("The response of WorkspaceApi->get_workspace:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WorkspaceApi->get_workspace: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + **verbose** | **bool**| Verbose | [optional] + +### Return type + +[**WorkspaceDTO**](WorkspaceDTO.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **list_workspaces** +> List[WorkspaceDTO] list_workspaces(verbose=verbose) + +List workspaces + +List workspaces + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.workspace_dto import WorkspaceDTO +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceApi(api_client) + verbose = True # bool | Verbose (optional) + + try: + # List workspaces + api_response = api_instance.list_workspaces(verbose=verbose) + print("The response of WorkspaceApi->list_workspaces:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WorkspaceApi->list_workspaces: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **verbose** | **bool**| Verbose | [optional] + +### Return type + +[**List[WorkspaceDTO]**](WorkspaceDTO.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **remove_workspace** +> remove_workspace(workspace_id, force=force) + +Remove workspace + +Remove workspace + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID + force = True # bool | Force (optional) + + try: + # Remove workspace + api_instance.remove_workspace(workspace_id, force=force) + except Exception as e: + print("Exception when calling WorkspaceApi->remove_workspace: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID | + **force** | **bool**| Force | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **set_project_state** +> set_project_state(workspace_id, project_id, set_state) + +Set project state + +Set project state + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.set_project_state import SetProjectState +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + project_id = 'project_id_example' # str | Project ID + set_state = api_client.SetProjectState() # SetProjectState | Set State + + try: + # Set project state + api_instance.set_project_state(workspace_id, project_id, set_state) + except Exception as e: + print("Exception when calling WorkspaceApi->set_project_state: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + **project_id** | **str**| Project ID | + **set_state** | [**SetProjectState**](SetProjectState.md)| Set State | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **start_project** +> start_project(workspace_id, project_id) + +Start project + +Start project + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + project_id = 'project_id_example' # str | Project ID + + try: + # Start project + api_instance.start_project(workspace_id, project_id) + except Exception as e: + print("Exception when calling WorkspaceApi->start_project: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + **project_id** | **str**| Project ID | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **start_workspace** +> start_workspace(workspace_id) + +Start workspace + +Start workspace + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + + try: + # Start workspace + api_instance.start_workspace(workspace_id) + except Exception as e: + print("Exception when calling WorkspaceApi->start_workspace: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **stop_project** +> stop_project(workspace_id, project_id) + +Stop project + +Stop project + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + project_id = 'project_id_example' # str | Project ID + + try: + # Stop project + api_instance.stop_project(workspace_id, project_id) + except Exception as e: + print("Exception when calling WorkspaceApi->stop_project: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + **project_id** | **str**| Project ID | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **stop_workspace** +> stop_workspace(workspace_id) + +Stop workspace + +Stop workspace + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + + try: + # Stop workspace + api_instance.stop_workspace(workspace_id) + except Exception as e: + print("Exception when calling WorkspaceApi->stop_workspace: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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/packages/python/src/api_client/docs/WorkspaceDTO.md b/packages/python/src/api_client/docs/WorkspaceDTO.md new file mode 100644 index 0000000..9f9c5aa --- /dev/null +++ b/packages/python/src/api_client/docs/WorkspaceDTO.md @@ -0,0 +1,33 @@ +# WorkspaceDTO + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | +**info** | [**WorkspaceInfo**](WorkspaceInfo.md) | | [optional] +**name** | **str** | | +**projects** | [**List[Project]**](Project.md) | | +**target** | **str** | | + +## Example + +```python +from api_client.models.workspace_dto import WorkspaceDTO + +# TODO update the JSON string below +json = "{}" +# create an instance of WorkspaceDTO from a JSON string +workspace_dto_instance = WorkspaceDTO.from_json(json) +# print the JSON string representation of the object +print(WorkspaceDTO.to_json()) + +# convert the object into a dict +workspace_dto_dict = workspace_dto_instance.to_dict() +# create an instance of WorkspaceDTO from a dict +workspace_dto_from_dict = WorkspaceDTO.from_dict(workspace_dto_dict) +``` +[[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/packages/python/src/api_client/docs/WorkspaceInfo.md b/packages/python/src/api_client/docs/WorkspaceInfo.md new file mode 100644 index 0000000..6cb1efe --- /dev/null +++ b/packages/python/src/api_client/docs/WorkspaceInfo.md @@ -0,0 +1,31 @@ +# WorkspaceInfo + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**projects** | [**List[ProjectInfo]**](ProjectInfo.md) | | +**provider_metadata** | **str** | | [optional] + +## Example + +```python +from api_client.models.workspace_info import WorkspaceInfo + +# TODO update the JSON string below +json = "{}" +# create an instance of WorkspaceInfo from a JSON string +workspace_info_instance = WorkspaceInfo.from_json(json) +# print the JSON string representation of the object +print(WorkspaceInfo.to_json()) + +# convert the object into a dict +workspace_info_dict = workspace_info_instance.to_dict() +# create an instance of WorkspaceInfo from a dict +workspace_info_from_dict = WorkspaceInfo.from_dict(workspace_info_dict) +``` +[[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/packages/python/src/api_client/docs/WorkspaceToolboxApi.md b/packages/python/src/api_client/docs/WorkspaceToolboxApi.md new file mode 100644 index 0000000..845fccc --- /dev/null +++ b/packages/python/src/api_client/docs/WorkspaceToolboxApi.md @@ -0,0 +1,2436 @@ +# api_client.WorkspaceToolboxApi + +All URIs are relative to *http://localhost:3986* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fs_create_folder**](WorkspaceToolboxApi.md#fs_create_folder) | **POST** /workspace/{workspaceId}/{projectId}/toolbox/files/folder | Create folder +[**fs_delete_file**](WorkspaceToolboxApi.md#fs_delete_file) | **DELETE** /workspace/{workspaceId}/{projectId}/toolbox/files | Delete file +[**fs_download_file**](WorkspaceToolboxApi.md#fs_download_file) | **GET** /workspace/{workspaceId}/{projectId}/toolbox/files/download | Download file +[**fs_find_in_files**](WorkspaceToolboxApi.md#fs_find_in_files) | **GET** /workspace/{workspaceId}/{projectId}/toolbox/files/find | Search for text/pattern in files +[**fs_get_file_details**](WorkspaceToolboxApi.md#fs_get_file_details) | **GET** /workspace/{workspaceId}/{projectId}/toolbox/files/info | Get file info +[**fs_list_files**](WorkspaceToolboxApi.md#fs_list_files) | **GET** /workspace/{workspaceId}/{projectId}/toolbox/files | List files +[**fs_move_file**](WorkspaceToolboxApi.md#fs_move_file) | **POST** /workspace/{workspaceId}/{projectId}/toolbox/files/move | Create folder +[**fs_replace_in_files**](WorkspaceToolboxApi.md#fs_replace_in_files) | **POST** /workspace/{workspaceId}/{projectId}/toolbox/files/replace | Repleace text/pattern in files +[**fs_search_files**](WorkspaceToolboxApi.md#fs_search_files) | **GET** /workspace/{workspaceId}/{projectId}/toolbox/files/search | Search for files +[**fs_set_file_permissions**](WorkspaceToolboxApi.md#fs_set_file_permissions) | **POST** /workspace/{workspaceId}/{projectId}/toolbox/files/permissions | Set file owner/group/permissions +[**fs_upload_file**](WorkspaceToolboxApi.md#fs_upload_file) | **POST** /workspace/{workspaceId}/{projectId}/toolbox/files/upload | Upload file +[**get_project_dir**](WorkspaceToolboxApi.md#get_project_dir) | **GET** /workspace/{workspaceId}/{projectId}/toolbox/project-dir | Get project dir +[**git_add_files**](WorkspaceToolboxApi.md#git_add_files) | **POST** /workspace/{workspaceId}/{projectId}/toolbox/git/add | Add files +[**git_branch_list**](WorkspaceToolboxApi.md#git_branch_list) | **GET** /workspace/{workspaceId}/{projectId}/toolbox/git/branches | Get branch list +[**git_clone_repository**](WorkspaceToolboxApi.md#git_clone_repository) | **POST** /workspace/{workspaceId}/{projectId}/toolbox/git/clone | Clone git repository +[**git_commit_changes**](WorkspaceToolboxApi.md#git_commit_changes) | **POST** /workspace/{workspaceId}/{projectId}/toolbox/git/commit | Commit changes +[**git_commit_history**](WorkspaceToolboxApi.md#git_commit_history) | **GET** /workspace/{workspaceId}/{projectId}/toolbox/git/history | Get commit history +[**git_create_branch**](WorkspaceToolboxApi.md#git_create_branch) | **POST** /workspace/{workspaceId}/{projectId}/toolbox/git/branches | Create branch +[**git_git_status**](WorkspaceToolboxApi.md#git_git_status) | **GET** /workspace/{workspaceId}/{projectId}/toolbox/git/status | Get git status +[**git_pull_changes**](WorkspaceToolboxApi.md#git_pull_changes) | **POST** /workspace/{workspaceId}/{projectId}/toolbox/git/pull | Pull changes +[**git_push_changes**](WorkspaceToolboxApi.md#git_push_changes) | **POST** /workspace/{workspaceId}/{projectId}/toolbox/git/push | Push changes +[**lsp_completions**](WorkspaceToolboxApi.md#lsp_completions) | **POST** /workspace/{workspaceId}/{projectId}/toolbox/lsp/completions | Get Lsp Completions +[**lsp_did_close**](WorkspaceToolboxApi.md#lsp_did_close) | **POST** /workspace/{workspaceId}/{projectId}/toolbox/lsp/did-close | Call Lsp DidClose +[**lsp_did_open**](WorkspaceToolboxApi.md#lsp_did_open) | **POST** /workspace/{workspaceId}/{projectId}/toolbox/lsp/did-open | Call Lsp DidOpen +[**lsp_document_symbols**](WorkspaceToolboxApi.md#lsp_document_symbols) | **GET** /workspace/{workspaceId}/{projectId}/toolbox/lsp/document-symbols | Call Lsp DocumentSymbols +[**lsp_start**](WorkspaceToolboxApi.md#lsp_start) | **POST** /workspace/{workspaceId}/{projectId}/toolbox/lsp/start | Start Lsp server +[**lsp_stop**](WorkspaceToolboxApi.md#lsp_stop) | **POST** /workspace/{workspaceId}/{projectId}/toolbox/lsp/stop | Stop Lsp server +[**lsp_workspace_symbols**](WorkspaceToolboxApi.md#lsp_workspace_symbols) | **GET** /workspace/{workspaceId}/{projectId}/toolbox/lsp/workspace-symbols | Call Lsp WorkspaceSymbols +[**process_execute_command**](WorkspaceToolboxApi.md#process_execute_command) | **POST** /workspace/{workspaceId}/{projectId}/toolbox/process/execute | Execute command + + +# **fs_create_folder** +> fs_create_folder(workspace_id, project_id, path, mode) + +Create folder + +Create folder inside workspace project + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceToolboxApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + project_id = 'project_id_example' # str | Project ID + path = 'path_example' # str | Path + mode = 'mode_example' # str | Mode + + try: + # Create folder + api_instance.fs_create_folder(workspace_id, project_id, path, mode) + except Exception as e: + print("Exception when calling WorkspaceToolboxApi->fs_create_folder: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + **project_id** | **str**| Project ID | + **path** | **str**| Path | + **mode** | **str**| Mode | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | + +[[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) + +# **fs_delete_file** +> fs_delete_file(workspace_id, project_id, path) + +Delete file + +Delete file inside workspace project + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceToolboxApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + project_id = 'project_id_example' # str | Project ID + path = 'path_example' # str | Path + + try: + # Delete file + api_instance.fs_delete_file(workspace_id, project_id, path) + except Exception as e: + print("Exception when calling WorkspaceToolboxApi->fs_delete_file: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + **project_id** | **str**| Project ID | + **path** | **str**| Path | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No Content | - | + +[[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) + +# **fs_download_file** +> bytearray fs_download_file(workspace_id, project_id, path) + +Download file + +Download file from workspace project + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceToolboxApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + project_id = 'project_id_example' # str | Project ID + path = 'path_example' # str | Path + + try: + # Download file + api_response = api_instance.fs_download_file(workspace_id, project_id, path) + print("The response of WorkspaceToolboxApi->fs_download_file:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WorkspaceToolboxApi->fs_download_file: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + **project_id** | **str**| Project ID | + **path** | **str**| Path | + +### Return type + +**bytearray** + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | response contains the file | - | + +[[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) + +# **fs_find_in_files** +> List[Match] fs_find_in_files(workspace_id, project_id, path, pattern) + +Search for text/pattern in files + +Search for text/pattern inside workspace project files + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.match import Match +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceToolboxApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + project_id = 'project_id_example' # str | Project ID + path = 'path_example' # str | Path + pattern = 'pattern_example' # str | Pattern + + try: + # Search for text/pattern in files + api_response = api_instance.fs_find_in_files(workspace_id, project_id, path, pattern) + print("The response of WorkspaceToolboxApi->fs_find_in_files:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WorkspaceToolboxApi->fs_find_in_files: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + **project_id** | **str**| Project ID | + **path** | **str**| Path | + **pattern** | **str**| Pattern | + +### Return type + +[**List[Match]**](Match.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **fs_get_file_details** +> FileInfo fs_get_file_details(workspace_id, project_id, path) + +Get file info + +Get file info inside workspace project + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.file_info import FileInfo +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceToolboxApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + project_id = 'project_id_example' # str | Project ID + path = 'path_example' # str | Path + + try: + # Get file info + api_response = api_instance.fs_get_file_details(workspace_id, project_id, path) + print("The response of WorkspaceToolboxApi->fs_get_file_details:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WorkspaceToolboxApi->fs_get_file_details: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + **project_id** | **str**| Project ID | + **path** | **str**| Path | + +### Return type + +[**FileInfo**](FileInfo.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **fs_list_files** +> List[FileInfo] fs_list_files(workspace_id, project_id, path=path) + +List files + +List files inside workspace project + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.file_info import FileInfo +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceToolboxApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + project_id = 'project_id_example' # str | Project ID + path = 'path_example' # str | Path (optional) + + try: + # List files + api_response = api_instance.fs_list_files(workspace_id, project_id, path=path) + print("The response of WorkspaceToolboxApi->fs_list_files:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WorkspaceToolboxApi->fs_list_files: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + **project_id** | **str**| Project ID | + **path** | **str**| Path | [optional] + +### Return type + +[**List[FileInfo]**](FileInfo.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **fs_move_file** +> fs_move_file(workspace_id, project_id, source, destination) + +Create folder + +Create folder inside workspace project + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceToolboxApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + project_id = 'project_id_example' # str | Project ID + source = 'source_example' # str | Source path + destination = 'destination_example' # str | Destination path + + try: + # Create folder + api_instance.fs_move_file(workspace_id, project_id, source, destination) + except Exception as e: + print("Exception when calling WorkspaceToolboxApi->fs_move_file: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + **project_id** | **str**| Project ID | + **source** | **str**| Source path | + **destination** | **str**| Destination path | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **fs_replace_in_files** +> List[ReplaceResult] fs_replace_in_files(workspace_id, project_id, replace) + +Repleace text/pattern in files + +Repleace text/pattern in mutilple files inside workspace project + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.replace_request import ReplaceRequest +from api_client.models.replace_result import ReplaceResult +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceToolboxApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + project_id = 'project_id_example' # str | Project ID + replace = api_client.ReplaceRequest() # ReplaceRequest | ReplaceParams + + try: + # Repleace text/pattern in files + api_response = api_instance.fs_replace_in_files(workspace_id, project_id, replace) + print("The response of WorkspaceToolboxApi->fs_replace_in_files:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WorkspaceToolboxApi->fs_replace_in_files: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + **project_id** | **str**| Project ID | + **replace** | [**ReplaceRequest**](ReplaceRequest.md)| ReplaceParams | + +### Return type + +[**List[ReplaceResult]**](ReplaceResult.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **fs_search_files** +> SearchFilesResponse fs_search_files(workspace_id, project_id, path, pattern) + +Search for files + +Search for files inside workspace project + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.search_files_response import SearchFilesResponse +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceToolboxApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + project_id = 'project_id_example' # str | Project ID + path = 'path_example' # str | Path + pattern = 'pattern_example' # str | Pattern + + try: + # Search for files + api_response = api_instance.fs_search_files(workspace_id, project_id, path, pattern) + print("The response of WorkspaceToolboxApi->fs_search_files:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WorkspaceToolboxApi->fs_search_files: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + **project_id** | **str**| Project ID | + **path** | **str**| Path | + **pattern** | **str**| Pattern | + +### Return type + +[**SearchFilesResponse**](SearchFilesResponse.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **fs_set_file_permissions** +> fs_set_file_permissions(workspace_id, project_id, path, owner=owner, group=group, mode=mode) + +Set file owner/group/permissions + +Set file owner/group/permissions inside workspace project + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceToolboxApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + project_id = 'project_id_example' # str | Project ID + path = 'path_example' # str | Path + owner = 'owner_example' # str | Owner (optional) + group = 'group_example' # str | Group (optional) + mode = 'mode_example' # str | Mode (optional) + + try: + # Set file owner/group/permissions + api_instance.fs_set_file_permissions(workspace_id, project_id, path, owner=owner, group=group, mode=mode) + except Exception as e: + print("Exception when calling WorkspaceToolboxApi->fs_set_file_permissions: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + **project_id** | **str**| Project ID | + **path** | **str**| Path | + **owner** | **str**| Owner | [optional] + **group** | **str**| Group | [optional] + **mode** | **str**| Mode | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **fs_upload_file** +> fs_upload_file(workspace_id, project_id, path, file) + +Upload file + +Upload file inside workspace project + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceToolboxApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + project_id = 'project_id_example' # str | Project ID + path = 'path_example' # str | Path + file = None # bytearray | File + + try: + # Upload file + api_instance.fs_upload_file(workspace_id, project_id, path, file) + except Exception as e: + print("Exception when calling WorkspaceToolboxApi->fs_upload_file: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + **project_id** | **str**| Project ID | + **path** | **str**| Path | + **file** | **bytearray**| File | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **get_project_dir** +> ProjectDirResponse get_project_dir(workspace_id, project_id) + +Get project dir + +Get project directory + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.project_dir_response import ProjectDirResponse +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceToolboxApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + project_id = 'project_id_example' # str | Project ID + + try: + # Get project dir + api_response = api_instance.get_project_dir(workspace_id, project_id) + print("The response of WorkspaceToolboxApi->get_project_dir:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WorkspaceToolboxApi->get_project_dir: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + **project_id** | **str**| Project ID | + +### Return type + +[**ProjectDirResponse**](ProjectDirResponse.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **git_add_files** +> git_add_files(workspace_id, project_id, params) + +Add files + +Add files to git commit + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.git_add_request import GitAddRequest +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceToolboxApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + project_id = 'project_id_example' # str | Project ID + params = api_client.GitAddRequest() # GitAddRequest | GitAddRequest + + try: + # Add files + api_instance.git_add_files(workspace_id, project_id, params) + except Exception as e: + print("Exception when calling WorkspaceToolboxApi->git_add_files: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + **project_id** | **str**| Project ID | + **params** | [**GitAddRequest**](GitAddRequest.md)| GitAddRequest | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **git_branch_list** +> ListBranchResponse git_branch_list(workspace_id, project_id, path) + +Get branch list + +Get branch list from git repository inside workspace project + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.list_branch_response import ListBranchResponse +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceToolboxApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + project_id = 'project_id_example' # str | Project ID + path = 'path_example' # str | Path to git repository + + try: + # Get branch list + api_response = api_instance.git_branch_list(workspace_id, project_id, path) + print("The response of WorkspaceToolboxApi->git_branch_list:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WorkspaceToolboxApi->git_branch_list: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + **project_id** | **str**| Project ID | + **path** | **str**| Path to git repository | + +### Return type + +[**ListBranchResponse**](ListBranchResponse.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **git_clone_repository** +> git_clone_repository(workspace_id, project_id, params) + +Clone git repository + +Clone git repository inside workspace project + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.git_clone_request import GitCloneRequest +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceToolboxApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + project_id = 'project_id_example' # str | Project ID + params = api_client.GitCloneRequest() # GitCloneRequest | GitCloneRequest + + try: + # Clone git repository + api_instance.git_clone_repository(workspace_id, project_id, params) + except Exception as e: + print("Exception when calling WorkspaceToolboxApi->git_clone_repository: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + **project_id** | **str**| Project ID | + **params** | [**GitCloneRequest**](GitCloneRequest.md)| GitCloneRequest | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **git_commit_changes** +> GitCommitResponse git_commit_changes(workspace_id, project_id, params) + +Commit changes + +Commit changes to git repository inside workspace project + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.git_commit_request import GitCommitRequest +from api_client.models.git_commit_response import GitCommitResponse +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceToolboxApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + project_id = 'project_id_example' # str | Project ID + params = api_client.GitCommitRequest() # GitCommitRequest | GitCommitRequest + + try: + # Commit changes + api_response = api_instance.git_commit_changes(workspace_id, project_id, params) + print("The response of WorkspaceToolboxApi->git_commit_changes:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WorkspaceToolboxApi->git_commit_changes: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + **project_id** | **str**| Project ID | + **params** | [**GitCommitRequest**](GitCommitRequest.md)| GitCommitRequest | + +### Return type + +[**GitCommitResponse**](GitCommitResponse.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **git_commit_history** +> List[GitCommitInfo] git_commit_history(workspace_id, project_id, path) + +Get commit history + +Get commit history from git repository inside workspace project + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.git_commit_info import GitCommitInfo +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceToolboxApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + project_id = 'project_id_example' # str | Project ID + path = 'path_example' # str | Path to git repository + + try: + # Get commit history + api_response = api_instance.git_commit_history(workspace_id, project_id, path) + print("The response of WorkspaceToolboxApi->git_commit_history:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WorkspaceToolboxApi->git_commit_history: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + **project_id** | **str**| Project ID | + **path** | **str**| Path to git repository | + +### Return type + +[**List[GitCommitInfo]**](GitCommitInfo.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **git_create_branch** +> git_create_branch(workspace_id, project_id, params) + +Create branch + +Create branch on git repository inside workspace project + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.git_branch_request import GitBranchRequest +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceToolboxApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + project_id = 'project_id_example' # str | Project ID + params = api_client.GitBranchRequest() # GitBranchRequest | GitBranchRequest + + try: + # Create branch + api_instance.git_create_branch(workspace_id, project_id, params) + except Exception as e: + print("Exception when calling WorkspaceToolboxApi->git_create_branch: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + **project_id** | **str**| Project ID | + **params** | [**GitBranchRequest**](GitBranchRequest.md)| GitBranchRequest | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | + +[[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) + +# **git_git_status** +> GitStatus git_git_status(workspace_id, project_id, path) + +Get git status + +Get status from git repository inside workspace project + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.git_status import GitStatus +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceToolboxApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + project_id = 'project_id_example' # str | Project ID + path = 'path_example' # str | Path to git repository + + try: + # Get git status + api_response = api_instance.git_git_status(workspace_id, project_id, path) + print("The response of WorkspaceToolboxApi->git_git_status:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WorkspaceToolboxApi->git_git_status: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + **project_id** | **str**| Project ID | + **path** | **str**| Path to git repository | + +### Return type + +[**GitStatus**](GitStatus.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **git_pull_changes** +> git_pull_changes(workspace_id, project_id, params) + +Pull changes + +Pull changes from remote to git repository inside workspace project + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.git_repo_request import GitRepoRequest +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceToolboxApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + project_id = 'project_id_example' # str | Project ID + params = api_client.GitRepoRequest() # GitRepoRequest | Git pull request + + try: + # Pull changes + api_instance.git_pull_changes(workspace_id, project_id, params) + except Exception as e: + print("Exception when calling WorkspaceToolboxApi->git_pull_changes: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + **project_id** | **str**| Project ID | + **params** | [**GitRepoRequest**](GitRepoRequest.md)| Git pull request | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **git_push_changes** +> git_push_changes(workspace_id, project_id, params) + +Push changes + +Push changes to remote from git repository inside workspace project + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.git_repo_request import GitRepoRequest +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceToolboxApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + project_id = 'project_id_example' # str | Project ID + params = api_client.GitRepoRequest() # GitRepoRequest | Git push request + + try: + # Push changes + api_instance.git_push_changes(workspace_id, project_id, params) + except Exception as e: + print("Exception when calling WorkspaceToolboxApi->git_push_changes: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + **project_id** | **str**| Project ID | + **params** | [**GitRepoRequest**](GitRepoRequest.md)| Git push request | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **lsp_completions** +> CompletionList lsp_completions(workspace_id, project_id, params) + +Get Lsp Completions + +The Completion request is sent from the client to the server to compute completion items at a given cursor position. + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.completion_list import CompletionList +from api_client.models.lsp_completion_params import LspCompletionParams +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceToolboxApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + project_id = 'project_id_example' # str | Project ID + params = api_client.LspCompletionParams() # LspCompletionParams | LspCompletionParams + + try: + # Get Lsp Completions + api_response = api_instance.lsp_completions(workspace_id, project_id, params) + print("The response of WorkspaceToolboxApi->lsp_completions:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WorkspaceToolboxApi->lsp_completions: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + **project_id** | **str**| Project ID | + **params** | [**LspCompletionParams**](LspCompletionParams.md)| LspCompletionParams | + +### Return type + +[**CompletionList**](CompletionList.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **lsp_did_close** +> lsp_did_close(workspace_id, project_id, params) + +Call Lsp DidClose + +The document close notification is sent from the client to the server when the document got closed in the client. + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.lsp_document_request import LspDocumentRequest +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceToolboxApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + project_id = 'project_id_example' # str | Project ID + params = api_client.LspDocumentRequest() # LspDocumentRequest | LspDocumentRequest + + try: + # Call Lsp DidClose + api_instance.lsp_did_close(workspace_id, project_id, params) + except Exception as e: + print("Exception when calling WorkspaceToolboxApi->lsp_did_close: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + **project_id** | **str**| Project ID | + **params** | [**LspDocumentRequest**](LspDocumentRequest.md)| LspDocumentRequest | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **lsp_did_open** +> lsp_did_open(workspace_id, project_id, params) + +Call Lsp DidOpen + +The document open notification is sent from the client to the server to signal newly opened text documents. + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.lsp_document_request import LspDocumentRequest +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceToolboxApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + project_id = 'project_id_example' # str | Project ID + params = api_client.LspDocumentRequest() # LspDocumentRequest | LspDocumentRequest + + try: + # Call Lsp DidOpen + api_instance.lsp_did_open(workspace_id, project_id, params) + except Exception as e: + print("Exception when calling WorkspaceToolboxApi->lsp_did_open: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + **project_id** | **str**| Project ID | + **params** | [**LspDocumentRequest**](LspDocumentRequest.md)| LspDocumentRequest | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **lsp_document_symbols** +> List[LspSymbol] lsp_document_symbols(workspace_id, project_id, language_id, path_to_project, uri) + +Call Lsp DocumentSymbols + +The document symbol request is sent from the client to the server. + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.lsp_symbol import LspSymbol +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceToolboxApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + project_id = 'project_id_example' # str | Project ID + language_id = 'language_id_example' # str | Language ID + path_to_project = 'path_to_project_example' # str | Path to project + uri = 'uri_example' # str | Document Uri + + try: + # Call Lsp DocumentSymbols + api_response = api_instance.lsp_document_symbols(workspace_id, project_id, language_id, path_to_project, uri) + print("The response of WorkspaceToolboxApi->lsp_document_symbols:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WorkspaceToolboxApi->lsp_document_symbols: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + **project_id** | **str**| Project ID | + **language_id** | **str**| Language ID | + **path_to_project** | **str**| Path to project | + **uri** | **str**| Document Uri | + +### Return type + +[**List[LspSymbol]**](LspSymbol.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **lsp_start** +> lsp_start(workspace_id, project_id, params) + +Start Lsp server + +Start Lsp server process inside workspace project + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.lsp_server_request import LspServerRequest +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceToolboxApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + project_id = 'project_id_example' # str | Project ID + params = api_client.LspServerRequest() # LspServerRequest | LspServerRequest + + try: + # Start Lsp server + api_instance.lsp_start(workspace_id, project_id, params) + except Exception as e: + print("Exception when calling WorkspaceToolboxApi->lsp_start: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + **project_id** | **str**| Project ID | + **params** | [**LspServerRequest**](LspServerRequest.md)| LspServerRequest | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **lsp_stop** +> lsp_stop(workspace_id, project_id, params) + +Stop Lsp server + +Stop Lsp server process inside workspace project + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.lsp_server_request import LspServerRequest +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceToolboxApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + project_id = 'project_id_example' # str | Project ID + params = api_client.LspServerRequest() # LspServerRequest | LspServerRequest + + try: + # Stop Lsp server + api_instance.lsp_stop(workspace_id, project_id, params) + except Exception as e: + print("Exception when calling WorkspaceToolboxApi->lsp_stop: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + **project_id** | **str**| Project ID | + **params** | [**LspServerRequest**](LspServerRequest.md)| LspServerRequest | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **lsp_workspace_symbols** +> List[LspSymbol] lsp_workspace_symbols(workspace_id, project_id, language_id, path_to_project, query) + +Call Lsp WorkspaceSymbols + +The workspace symbol request is sent from the client to the server to list project-wide symbols matching the query string. + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.lsp_symbol import LspSymbol +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceToolboxApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + project_id = 'project_id_example' # str | Project ID + language_id = 'language_id_example' # str | Language ID + path_to_project = 'path_to_project_example' # str | Path to project + query = 'query_example' # str | Symbol Query + + try: + # Call Lsp WorkspaceSymbols + api_response = api_instance.lsp_workspace_symbols(workspace_id, project_id, language_id, path_to_project, query) + print("The response of WorkspaceToolboxApi->lsp_workspace_symbols:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WorkspaceToolboxApi->lsp_workspace_symbols: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + **project_id** | **str**| Project ID | + **language_id** | **str**| Language ID | + **path_to_project** | **str**| Path to project | + **query** | **str**| Symbol Query | + +### Return type + +[**List[LspSymbol]**](LspSymbol.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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) + +# **process_execute_command** +> ExecuteResponse process_execute_command(workspace_id, project_id, params) + +Execute command + +Execute command synchronously inside workspace project + +### Example + +* Api Key Authentication (Bearer): + +```python +import api_client +from api_client.models.execute_request import ExecuteRequest +from api_client.models.execute_response import ExecuteResponse +from api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost:3986 +# See configuration.py for a list of all supported configuration parameters. +configuration = api_client.Configuration( + host = "http://localhost:3986" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +with api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = api_client.WorkspaceToolboxApi(api_client) + workspace_id = 'workspace_id_example' # str | Workspace ID or Name + project_id = 'project_id_example' # str | Project ID + params = api_client.ExecuteRequest() # ExecuteRequest | Execute command request + + try: + # Execute command + api_response = api_instance.process_execute_command(workspace_id, project_id, params) + print("The response of WorkspaceToolboxApi->process_execute_command:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WorkspaceToolboxApi->process_execute_command: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspace_id** | **str**| Workspace ID or Name | + **project_id** | **str**| Project ID | + **params** | [**ExecuteRequest**](ExecuteRequest.md)| Execute command request | + +### Return type + +[**ExecuteResponse**](ExecuteResponse.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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/packages/python/src/api_client/exceptions.py b/packages/python/src/api_client/exceptions.py new file mode 100644 index 0000000..f1e44a0 --- /dev/null +++ b/packages/python/src/api_client/exceptions.py @@ -0,0 +1,199 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from typing import Any, Optional +from typing_extensions import Self + + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__( + self, msg, path_to_item=None, valid_classes=None, key_type=None + ) -> None: + """Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Raised when an attribute reference or assignment fails. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiAttributeError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + + def __init__( + self, + status=None, + reason=None, + http_resp=None, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body + self.data = data + self.headers = None + + if http_resp: + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode("utf-8") + except Exception: + pass + self.headers = http_resp.getheaders() + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(http_resp=http_resp, body=body, data=data) + + if 500 <= http_resp.status <= 599: + raise ServiceException(http_resp=http_resp, body=body, data=data) + raise ApiException(http_resp=http_resp, body=body, data=data) + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n" "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format(self.headers) + + if self.data or self.body: + error_message += "HTTP response body: {0}\n".format(self.data or self.body) + + return error_message + + +class BadRequestException(ApiException): + pass + + +class NotFoundException(ApiException): + pass + + +class UnauthorizedException(ApiException): + pass + + +class ForbiddenException(ApiException): + pass + + +class ServiceException(ApiException): + pass + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, int): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/packages/python/src/api_client/models/__init__.py b/packages/python/src/api_client/models/__init__.py new file mode 100644 index 0000000..deb93a2 --- /dev/null +++ b/packages/python/src/api_client/models/__init__.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +# flake8: noqa +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +# import models into model package +from api_client.models.api_key import ApiKey +from api_client.models.apikey_api_key_type import ApikeyApiKeyType +from api_client.models.build import Build +from api_client.models.build_build_state import BuildBuildState +from api_client.models.build_config import BuildConfig +from api_client.models.cached_build import CachedBuild +from api_client.models.clone_target import CloneTarget +from api_client.models.completion_context import CompletionContext +from api_client.models.completion_item import CompletionItem +from api_client.models.completion_list import CompletionList +from api_client.models.container_config import ContainerConfig +from api_client.models.container_registry import ContainerRegistry +from api_client.models.create_build_dto import CreateBuildDTO +from api_client.models.create_prebuild_dto import CreatePrebuildDTO +from api_client.models.create_project_config_dto import CreateProjectConfigDTO +from api_client.models.create_project_dto import CreateProjectDTO +from api_client.models.create_project_source_dto import CreateProjectSourceDTO +from api_client.models.create_provider_target_dto import CreateProviderTargetDTO +from api_client.models.create_workspace_dto import CreateWorkspaceDTO +from api_client.models.devcontainer_config import DevcontainerConfig +from api_client.models.execute_request import ExecuteRequest +from api_client.models.execute_response import ExecuteResponse +from api_client.models.frps_config import FRPSConfig +from api_client.models.file_info import FileInfo +from api_client.models.file_status import FileStatus +from api_client.models.get_repository_context import GetRepositoryContext +from api_client.models.git_add_request import GitAddRequest +from api_client.models.git_branch import GitBranch +from api_client.models.git_branch_request import GitBranchRequest +from api_client.models.git_clone_request import GitCloneRequest +from api_client.models.git_commit_info import GitCommitInfo +from api_client.models.git_commit_request import GitCommitRequest +from api_client.models.git_commit_response import GitCommitResponse +from api_client.models.git_namespace import GitNamespace +from api_client.models.git_provider import GitProvider +from api_client.models.git_pull_request import GitPullRequest +from api_client.models.git_repo_request import GitRepoRequest +from api_client.models.git_repository import GitRepository +from api_client.models.git_status import GitStatus +from api_client.models.git_user import GitUser +from api_client.models.install_provider_request import InstallProviderRequest +from api_client.models.list_branch_response import ListBranchResponse +from api_client.models.log_file_config import LogFileConfig +from api_client.models.lsp_completion_params import LspCompletionParams +from api_client.models.lsp_document_request import LspDocumentRequest +from api_client.models.lsp_location import LspLocation +from api_client.models.lsp_position import LspPosition +from api_client.models.lsp_range import LspRange +from api_client.models.lsp_server_request import LspServerRequest +from api_client.models.lsp_symbol import LspSymbol +from api_client.models.match import Match +from api_client.models.network_key import NetworkKey +from api_client.models.position import Position +from api_client.models.prebuild_config import PrebuildConfig +from api_client.models.prebuild_dto import PrebuildDTO +from api_client.models.profile_data import ProfileData +from api_client.models.project import Project +from api_client.models.project_config import ProjectConfig +from api_client.models.project_dir_response import ProjectDirResponse +from api_client.models.project_info import ProjectInfo +from api_client.models.project_state import ProjectState +from api_client.models.provider import Provider +from api_client.models.provider_provider_info import ProviderProviderInfo +from api_client.models.provider_provider_target_property import ( + ProviderProviderTargetProperty, +) +from api_client.models.provider_provider_target_property_type import ( + ProviderProviderTargetPropertyType, +) +from api_client.models.provider_target import ProviderTarget +from api_client.models.replace_request import ReplaceRequest +from api_client.models.replace_result import ReplaceResult +from api_client.models.repository_url import RepositoryUrl +from api_client.models.sample import Sample +from api_client.models.search_files_response import SearchFilesResponse +from api_client.models.server_config import ServerConfig +from api_client.models.set_git_provider_config import SetGitProviderConfig +from api_client.models.set_project_state import SetProjectState +from api_client.models.signing_method import SigningMethod +from api_client.models.status import Status +from api_client.models.workspace import Workspace +from api_client.models.workspace_dto import WorkspaceDTO +from api_client.models.workspace_info import WorkspaceInfo diff --git a/packages/python/src/api_client/models/api_key.py b/packages/python/src/api_client/models/api_key.py new file mode 100644 index 0000000..49a6bfb --- /dev/null +++ b/packages/python/src/api_client/models/api_key.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from api_client.models.apikey_api_key_type import ApikeyApiKeyType +from typing import Optional, Set +from typing_extensions import Self + + +class ApiKey(BaseModel): + """ + ApiKey + """ # noqa: E501 + + key_hash: StrictStr = Field(alias="keyHash") + name: StrictStr = Field(description="Project or client name") + type: ApikeyApiKeyType + __properties: ClassVar[List[str]] = ["keyHash", "name", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ApiKey from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ApiKey from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "keyHash": obj.get("keyHash"), + "name": obj.get("name"), + "type": obj.get("type"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/apikey_api_key_type.py b/packages/python/src/api_client/models/apikey_api_key_type.py new file mode 100644 index 0000000..e9f18f2 --- /dev/null +++ b/packages/python/src/api_client/models/apikey_api_key_type.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class ApikeyApiKeyType(str, Enum): + """ + ApikeyApiKeyType + """ + + """ + allowed enum values + """ + CLIENT = "client" + PROJECT = "project" + WORKSPACE = "workspace" + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ApikeyApiKeyType from a JSON string""" + return cls(json.loads(json_str)) diff --git a/packages/python/src/api_client/models/build.py b/packages/python/src/api_client/models/build.py new file mode 100644 index 0000000..4c206ab --- /dev/null +++ b/packages/python/src/api_client/models/build.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from api_client.models.build_build_state import BuildBuildState +from api_client.models.build_config import BuildConfig +from api_client.models.container_config import ContainerConfig +from api_client.models.git_repository import GitRepository +from typing import Optional, Set +from typing_extensions import Self + + +class Build(BaseModel): + """ + Build + """ # noqa: E501 + + build_config: Optional[BuildConfig] = Field(default=None, alias="buildConfig") + container_config: ContainerConfig = Field(alias="containerConfig") + created_at: StrictStr = Field(alias="createdAt") + env_vars: Dict[str, StrictStr] = Field(alias="envVars") + id: StrictStr + image: Optional[StrictStr] = None + prebuild_id: StrictStr = Field(alias="prebuildId") + repository: GitRepository + state: BuildBuildState + updated_at: StrictStr = Field(alias="updatedAt") + user: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = [ + "buildConfig", + "containerConfig", + "createdAt", + "envVars", + "id", + "image", + "prebuildId", + "repository", + "state", + "updatedAt", + "user", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Build from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of build_config + if self.build_config: + _dict["buildConfig"] = self.build_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of container_config + if self.container_config: + _dict["containerConfig"] = self.container_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of repository + if self.repository: + _dict["repository"] = self.repository.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Build from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "buildConfig": ( + BuildConfig.from_dict(obj["buildConfig"]) + if obj.get("buildConfig") is not None + else None + ), + "containerConfig": ( + ContainerConfig.from_dict(obj["containerConfig"]) + if obj.get("containerConfig") is not None + else None + ), + "createdAt": obj.get("createdAt"), + "envVars": obj.get("envVars"), + "id": obj.get("id"), + "image": obj.get("image"), + "prebuildId": obj.get("prebuildId"), + "repository": ( + GitRepository.from_dict(obj["repository"]) + if obj.get("repository") is not None + else None + ), + "state": obj.get("state"), + "updatedAt": obj.get("updatedAt"), + "user": obj.get("user"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/build_build_state.py b/packages/python/src/api_client/models/build_build_state.py new file mode 100644 index 0000000..2f6cb78 --- /dev/null +++ b/packages/python/src/api_client/models/build_build_state.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class BuildBuildState(str, Enum): + """ + BuildBuildState + """ + + """ + allowed enum values + """ + PENDING_MINUS_RUN = "pending-run" + RUNNING = "running" + ERROR = "error" + SUCCESS = "success" + PUBLISHED = "published" + PENDING_MINUS_DELETE = "pending-delete" + PENDING_MINUS_FORCED_MINUS_DELETE = "pending-forced-delete" + DELETING = "deleting" + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of BuildBuildState from a JSON string""" + return cls(json.loads(json_str)) diff --git a/packages/python/src/api_client/models/build_config.py b/packages/python/src/api_client/models/build_config.py new file mode 100644 index 0000000..00e8551 --- /dev/null +++ b/packages/python/src/api_client/models/build_config.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from api_client.models.cached_build import CachedBuild +from api_client.models.devcontainer_config import DevcontainerConfig +from typing import Optional, Set +from typing_extensions import Self + + +class BuildConfig(BaseModel): + """ + BuildConfig + """ # noqa: E501 + + cached_build: Optional[CachedBuild] = Field(default=None, alias="cachedBuild") + devcontainer: Optional[DevcontainerConfig] = None + __properties: ClassVar[List[str]] = ["cachedBuild", "devcontainer"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BuildConfig from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of cached_build + if self.cached_build: + _dict["cachedBuild"] = self.cached_build.to_dict() + # override the default output from pydantic by calling `to_dict()` of devcontainer + if self.devcontainer: + _dict["devcontainer"] = self.devcontainer.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BuildConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "cachedBuild": ( + CachedBuild.from_dict(obj["cachedBuild"]) + if obj.get("cachedBuild") is not None + else None + ), + "devcontainer": ( + DevcontainerConfig.from_dict(obj["devcontainer"]) + if obj.get("devcontainer") is not None + else None + ), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/cached_build.py b/packages/python/src/api_client/models/cached_build.py new file mode 100644 index 0000000..1c563cb --- /dev/null +++ b/packages/python/src/api_client/models/cached_build.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class CachedBuild(BaseModel): + """ + CachedBuild + """ # noqa: E501 + + image: StrictStr + user: StrictStr + __properties: ClassVar[List[str]] = ["image", "user"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CachedBuild from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CachedBuild from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"image": obj.get("image"), "user": obj.get("user")}) + return _obj diff --git a/packages/python/src/api_client/models/clone_target.py b/packages/python/src/api_client/models/clone_target.py new file mode 100644 index 0000000..c8cbf60 --- /dev/null +++ b/packages/python/src/api_client/models/clone_target.py @@ -0,0 +1,35 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class CloneTarget(str, Enum): + """ + CloneTarget + """ + + """ + allowed enum values + """ + BRANCH = "branch" + COMMIT = "commit" + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of CloneTarget from a JSON string""" + return cls(json.loads(json_str)) diff --git a/packages/python/src/api_client/models/completion_context.py b/packages/python/src/api_client/models/completion_context.py new file mode 100644 index 0000000..36ad8cf --- /dev/null +++ b/packages/python/src/api_client/models/completion_context.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + + +class CompletionContext(BaseModel): + """ + CompletionContext + """ # noqa: E501 + + trigger_character: Optional[StrictStr] = Field( + default=None, alias="triggerCharacter" + ) + trigger_kind: StrictInt = Field(alias="triggerKind") + __properties: ClassVar[List[str]] = ["triggerCharacter", "triggerKind"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CompletionContext from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CompletionContext from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "triggerCharacter": obj.get("triggerCharacter"), + "triggerKind": obj.get("triggerKind"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/completion_item.py b/packages/python/src/api_client/models/completion_item.py new file mode 100644 index 0000000..f393df3 --- /dev/null +++ b/packages/python/src/api_client/models/completion_item.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + + +class CompletionItem(BaseModel): + """ + CompletionItem + """ # noqa: E501 + + detail: Optional[StrictStr] = None + documentation: Optional[Dict[str, Any]] = None + filter_text: Optional[StrictStr] = Field(default=None, alias="filterText") + insert_text: Optional[StrictStr] = Field(default=None, alias="insertText") + kind: Optional[StrictInt] = None + label: StrictStr + sort_text: Optional[StrictStr] = Field(default=None, alias="sortText") + __properties: ClassVar[List[str]] = [ + "detail", + "documentation", + "filterText", + "insertText", + "kind", + "label", + "sortText", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CompletionItem from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CompletionItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "detail": obj.get("detail"), + "documentation": obj.get("documentation"), + "filterText": obj.get("filterText"), + "insertText": obj.get("insertText"), + "kind": obj.get("kind"), + "label": obj.get("label"), + "sortText": obj.get("sortText"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/completion_list.py b/packages/python/src/api_client/models/completion_list.py new file mode 100644 index 0000000..b843502 --- /dev/null +++ b/packages/python/src/api_client/models/completion_list.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List +from api_client.models.completion_item import CompletionItem +from typing import Optional, Set +from typing_extensions import Self + + +class CompletionList(BaseModel): + """ + CompletionList + """ # noqa: E501 + + is_incomplete: StrictBool = Field(alias="isIncomplete") + items: List[CompletionItem] + __properties: ClassVar[List[str]] = ["isIncomplete", "items"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CompletionList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict["items"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CompletionList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "isIncomplete": obj.get("isIncomplete"), + "items": ( + [CompletionItem.from_dict(_item) for _item in obj["items"]] + if obj.get("items") is not None + else None + ), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/container_config.py b/packages/python/src/api_client/models/container_config.py new file mode 100644 index 0000000..6fb784c --- /dev/null +++ b/packages/python/src/api_client/models/container_config.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class ContainerConfig(BaseModel): + """ + ContainerConfig + """ # noqa: E501 + + image: StrictStr + user: StrictStr + __properties: ClassVar[List[str]] = ["image", "user"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ContainerConfig from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ContainerConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"image": obj.get("image"), "user": obj.get("user")}) + return _obj diff --git a/packages/python/src/api_client/models/container_registry.py b/packages/python/src/api_client/models/container_registry.py new file mode 100644 index 0000000..4dfb889 --- /dev/null +++ b/packages/python/src/api_client/models/container_registry.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class ContainerRegistry(BaseModel): + """ + ContainerRegistry + """ # noqa: E501 + + password: StrictStr + server: StrictStr + username: StrictStr + __properties: ClassVar[List[str]] = ["password", "server", "username"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ContainerRegistry from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ContainerRegistry from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "password": obj.get("password"), + "server": obj.get("server"), + "username": obj.get("username"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/create_build_dto.py b/packages/python/src/api_client/models/create_build_dto.py new file mode 100644 index 0000000..e6d1b58 --- /dev/null +++ b/packages/python/src/api_client/models/create_build_dto.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + + +class CreateBuildDTO(BaseModel): + """ + CreateBuildDTO + """ # noqa: E501 + + branch: StrictStr + env_vars: Dict[str, StrictStr] = Field(alias="envVars") + prebuild_id: Optional[StrictStr] = Field(default=None, alias="prebuildId") + project_config_name: StrictStr = Field(alias="projectConfigName") + __properties: ClassVar[List[str]] = [ + "branch", + "envVars", + "prebuildId", + "projectConfigName", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateBuildDTO from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateBuildDTO from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "branch": obj.get("branch"), + "envVars": obj.get("envVars"), + "prebuildId": obj.get("prebuildId"), + "projectConfigName": obj.get("projectConfigName"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/create_prebuild_dto.py b/packages/python/src/api_client/models/create_prebuild_dto.py new file mode 100644 index 0000000..779c2d4 --- /dev/null +++ b/packages/python/src/api_client/models/create_prebuild_dto.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + + +class CreatePrebuildDTO(BaseModel): + """ + CreatePrebuildDTO + """ # noqa: E501 + + branch: Optional[StrictStr] = None + commit_interval: Optional[StrictInt] = Field(default=None, alias="commitInterval") + id: Optional[StrictStr] = None + retention: StrictInt + trigger_files: Optional[List[StrictStr]] = Field(default=None, alias="triggerFiles") + __properties: ClassVar[List[str]] = [ + "branch", + "commitInterval", + "id", + "retention", + "triggerFiles", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreatePrebuildDTO from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreatePrebuildDTO from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "branch": obj.get("branch"), + "commitInterval": obj.get("commitInterval"), + "id": obj.get("id"), + "retention": obj.get("retention"), + "triggerFiles": obj.get("triggerFiles"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/create_project_config_dto.py b/packages/python/src/api_client/models/create_project_config_dto.py new file mode 100644 index 0000000..713a27e --- /dev/null +++ b/packages/python/src/api_client/models/create_project_config_dto.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from api_client.models.build_config import BuildConfig +from typing import Optional, Set +from typing_extensions import Self + + +class CreateProjectConfigDTO(BaseModel): + """ + CreateProjectConfigDTO + """ # noqa: E501 + + build_config: Optional[BuildConfig] = Field(default=None, alias="buildConfig") + env_vars: Dict[str, StrictStr] = Field(alias="envVars") + git_provider_config_id: Optional[StrictStr] = Field( + default=None, alias="gitProviderConfigId" + ) + image: Optional[StrictStr] = None + name: StrictStr + repository_url: StrictStr = Field(alias="repositoryUrl") + user: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = [ + "buildConfig", + "envVars", + "gitProviderConfigId", + "image", + "name", + "repositoryUrl", + "user", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateProjectConfigDTO from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of build_config + if self.build_config: + _dict["buildConfig"] = self.build_config.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateProjectConfigDTO from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "buildConfig": ( + BuildConfig.from_dict(obj["buildConfig"]) + if obj.get("buildConfig") is not None + else None + ), + "envVars": obj.get("envVars"), + "gitProviderConfigId": obj.get("gitProviderConfigId"), + "image": obj.get("image"), + "name": obj.get("name"), + "repositoryUrl": obj.get("repositoryUrl"), + "user": obj.get("user"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/create_project_dto.py b/packages/python/src/api_client/models/create_project_dto.py new file mode 100644 index 0000000..cab3ab3 --- /dev/null +++ b/packages/python/src/api_client/models/create_project_dto.py @@ -0,0 +1,125 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from api_client.models.build_config import BuildConfig +from api_client.models.create_project_source_dto import CreateProjectSourceDTO +from typing import Optional, Set +from typing_extensions import Self + + +class CreateProjectDTO(BaseModel): + """ + CreateProjectDTO + """ # noqa: E501 + + build_config: Optional[BuildConfig] = Field(default=None, alias="buildConfig") + env_vars: Dict[str, StrictStr] = Field(alias="envVars") + git_provider_config_id: Optional[StrictStr] = Field( + default=None, alias="gitProviderConfigId" + ) + image: Optional[StrictStr] = None + name: StrictStr + source: CreateProjectSourceDTO + user: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = [ + "buildConfig", + "envVars", + "gitProviderConfigId", + "image", + "name", + "source", + "user", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateProjectDTO from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of build_config + if self.build_config: + _dict["buildConfig"] = self.build_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of source + if self.source: + _dict["source"] = self.source.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateProjectDTO from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "buildConfig": ( + BuildConfig.from_dict(obj["buildConfig"]) + if obj.get("buildConfig") is not None + else None + ), + "envVars": obj.get("envVars"), + "gitProviderConfigId": obj.get("gitProviderConfigId"), + "image": obj.get("image"), + "name": obj.get("name"), + "source": ( + CreateProjectSourceDTO.from_dict(obj["source"]) + if obj.get("source") is not None + else None + ), + "user": obj.get("user"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/create_project_source_dto.py b/packages/python/src/api_client/models/create_project_source_dto.py new file mode 100644 index 0000000..e668426 --- /dev/null +++ b/packages/python/src/api_client/models/create_project_source_dto.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from api_client.models.git_repository import GitRepository +from typing import Optional, Set +from typing_extensions import Self + + +class CreateProjectSourceDTO(BaseModel): + """ + CreateProjectSourceDTO + """ # noqa: E501 + + repository: GitRepository + __properties: ClassVar[List[str]] = ["repository"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateProjectSourceDTO from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of repository + if self.repository: + _dict["repository"] = self.repository.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateProjectSourceDTO from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "repository": ( + GitRepository.from_dict(obj["repository"]) + if obj.get("repository") is not None + else None + ) + } + ) + return _obj diff --git a/packages/python/src/api_client/models/create_provider_target_dto.py b/packages/python/src/api_client/models/create_provider_target_dto.py new file mode 100644 index 0000000..f54f177 --- /dev/null +++ b/packages/python/src/api_client/models/create_provider_target_dto.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from api_client.models.provider_provider_info import ProviderProviderInfo +from typing import Optional, Set +from typing_extensions import Self + + +class CreateProviderTargetDTO(BaseModel): + """ + CreateProviderTargetDTO + """ # noqa: E501 + + name: StrictStr + options: StrictStr + provider_info: ProviderProviderInfo = Field(alias="providerInfo") + __properties: ClassVar[List[str]] = ["name", "options", "providerInfo"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateProviderTargetDTO from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of provider_info + if self.provider_info: + _dict["providerInfo"] = self.provider_info.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateProviderTargetDTO from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "name": obj.get("name"), + "options": obj.get("options"), + "providerInfo": ( + ProviderProviderInfo.from_dict(obj["providerInfo"]) + if obj.get("providerInfo") is not None + else None + ), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/create_workspace_dto.py b/packages/python/src/api_client/models/create_workspace_dto.py new file mode 100644 index 0000000..e8b8d53 --- /dev/null +++ b/packages/python/src/api_client/models/create_workspace_dto.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from api_client.models.create_project_dto import CreateProjectDTO +from typing import Optional, Set +from typing_extensions import Self + + +class CreateWorkspaceDTO(BaseModel): + """ + CreateWorkspaceDTO + """ # noqa: E501 + + id: StrictStr + name: StrictStr + projects: List[CreateProjectDTO] + target: StrictStr + __properties: ClassVar[List[str]] = ["id", "name", "projects", "target"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateWorkspaceDTO from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in projects (list) + _items = [] + if self.projects: + for _item_projects in self.projects: + if _item_projects: + _items.append(_item_projects.to_dict()) + _dict["projects"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateWorkspaceDTO from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "id": obj.get("id"), + "name": obj.get("name"), + "projects": ( + [CreateProjectDTO.from_dict(_item) for _item in obj["projects"]] + if obj.get("projects") is not None + else None + ), + "target": obj.get("target"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/devcontainer_config.py b/packages/python/src/api_client/models/devcontainer_config.py new file mode 100644 index 0000000..e6b1cfe --- /dev/null +++ b/packages/python/src/api_client/models/devcontainer_config.py @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class DevcontainerConfig(BaseModel): + """ + DevcontainerConfig + """ # noqa: E501 + + file_path: StrictStr = Field(alias="filePath") + __properties: ClassVar[List[str]] = ["filePath"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DevcontainerConfig from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DevcontainerConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"filePath": obj.get("filePath")}) + return _obj diff --git a/packages/python/src/api_client/models/execute_request.py b/packages/python/src/api_client/models/execute_request.py new file mode 100644 index 0000000..7cdb8a6 --- /dev/null +++ b/packages/python/src/api_client/models/execute_request.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + + +class ExecuteRequest(BaseModel): + """ + ExecuteRequest + """ # noqa: E501 + + command: StrictStr + timeout: Optional[StrictInt] = Field( + default=None, description="Timeout in seconds, defaults to 10 seconds" + ) + __properties: ClassVar[List[str]] = ["command", "timeout"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ExecuteRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ExecuteRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"command": obj.get("command"), "timeout": obj.get("timeout")} + ) + return _obj diff --git a/packages/python/src/api_client/models/execute_response.py b/packages/python/src/api_client/models/execute_response.py new file mode 100644 index 0000000..507fe05 --- /dev/null +++ b/packages/python/src/api_client/models/execute_response.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class ExecuteResponse(BaseModel): + """ + ExecuteResponse + """ # noqa: E501 + + code: StrictInt + result: StrictStr + __properties: ClassVar[List[str]] = ["code", "result"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ExecuteResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ExecuteResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"code": obj.get("code"), "result": obj.get("result")} + ) + return _obj diff --git a/packages/python/src/api_client/models/file_info.py b/packages/python/src/api_client/models/file_info.py new file mode 100644 index 0000000..cf326d1 --- /dev/null +++ b/packages/python/src/api_client/models/file_info.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class FileInfo(BaseModel): + """ + FileInfo + """ # noqa: E501 + + group: StrictStr + is_dir: StrictBool = Field(alias="isDir") + mod_time: StrictStr = Field(alias="modTime") + mode: StrictStr + name: StrictStr + owner: StrictStr + permissions: StrictStr + size: StrictInt + __properties: ClassVar[List[str]] = [ + "group", + "isDir", + "modTime", + "mode", + "name", + "owner", + "permissions", + "size", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FileInfo from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FileInfo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "group": obj.get("group"), + "isDir": obj.get("isDir"), + "modTime": obj.get("modTime"), + "mode": obj.get("mode"), + "name": obj.get("name"), + "owner": obj.get("owner"), + "permissions": obj.get("permissions"), + "size": obj.get("size"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/file_status.py b/packages/python/src/api_client/models/file_status.py new file mode 100644 index 0000000..7af7363 --- /dev/null +++ b/packages/python/src/api_client/models/file_status.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from api_client.models.status import Status +from typing import Optional, Set +from typing_extensions import Self + + +class FileStatus(BaseModel): + """ + FileStatus + """ # noqa: E501 + + extra: StrictStr + name: StrictStr + staging: Status + worktree: Status + __properties: ClassVar[List[str]] = ["extra", "name", "staging", "worktree"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FileStatus from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FileStatus from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "extra": obj.get("extra"), + "name": obj.get("name"), + "staging": obj.get("staging"), + "worktree": obj.get("worktree"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/frps_config.py b/packages/python/src/api_client/models/frps_config.py new file mode 100644 index 0000000..8b06f8a --- /dev/null +++ b/packages/python/src/api_client/models/frps_config.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class FRPSConfig(BaseModel): + """ + FRPSConfig + """ # noqa: E501 + + domain: StrictStr + port: StrictInt + protocol: StrictStr + __properties: ClassVar[List[str]] = ["domain", "port", "protocol"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FRPSConfig from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FRPSConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "domain": obj.get("domain"), + "port": obj.get("port"), + "protocol": obj.get("protocol"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/get_repository_context.py b/packages/python/src/api_client/models/get_repository_context.py new file mode 100644 index 0000000..9cbce49 --- /dev/null +++ b/packages/python/src/api_client/models/get_repository_context.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + + +class GetRepositoryContext(BaseModel): + """ + GetRepositoryContext + """ # noqa: E501 + + branch: Optional[StrictStr] = None + id: Optional[StrictStr] = None + name: Optional[StrictStr] = None + owner: Optional[StrictStr] = None + path: Optional[StrictStr] = None + pr_number: Optional[StrictInt] = Field(default=None, alias="prNumber") + sha: Optional[StrictStr] = None + source: Optional[StrictStr] = None + url: StrictStr + __properties: ClassVar[List[str]] = [ + "branch", + "id", + "name", + "owner", + "path", + "prNumber", + "sha", + "source", + "url", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GetRepositoryContext from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetRepositoryContext from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "branch": obj.get("branch"), + "id": obj.get("id"), + "name": obj.get("name"), + "owner": obj.get("owner"), + "path": obj.get("path"), + "prNumber": obj.get("prNumber"), + "sha": obj.get("sha"), + "source": obj.get("source"), + "url": obj.get("url"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/git_add_request.py b/packages/python/src/api_client/models/git_add_request.py new file mode 100644 index 0000000..fe2e87c --- /dev/null +++ b/packages/python/src/api_client/models/git_add_request.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class GitAddRequest(BaseModel): + """ + GitAddRequest + """ # noqa: E501 + + files: List[StrictStr] = Field(description="files to add (use . for all files)") + path: StrictStr + __properties: ClassVar[List[str]] = ["files", "path"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GitAddRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GitAddRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"files": obj.get("files"), "path": obj.get("path")}) + return _obj diff --git a/packages/python/src/api_client/models/git_branch.py b/packages/python/src/api_client/models/git_branch.py new file mode 100644 index 0000000..3aa821c --- /dev/null +++ b/packages/python/src/api_client/models/git_branch.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class GitBranch(BaseModel): + """ + GitBranch + """ # noqa: E501 + + name: StrictStr + sha: StrictStr + __properties: ClassVar[List[str]] = ["name", "sha"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GitBranch from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GitBranch from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"name": obj.get("name"), "sha": obj.get("sha")}) + return _obj diff --git a/packages/python/src/api_client/models/git_branch_request.py b/packages/python/src/api_client/models/git_branch_request.py new file mode 100644 index 0000000..1218c9d --- /dev/null +++ b/packages/python/src/api_client/models/git_branch_request.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class GitBranchRequest(BaseModel): + """ + GitBranchRequest + """ # noqa: E501 + + name: StrictStr + path: StrictStr + __properties: ClassVar[List[str]] = ["name", "path"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GitBranchRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GitBranchRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"name": obj.get("name"), "path": obj.get("path")}) + return _obj diff --git a/packages/python/src/api_client/models/git_clone_request.py b/packages/python/src/api_client/models/git_clone_request.py new file mode 100644 index 0000000..5782af0 --- /dev/null +++ b/packages/python/src/api_client/models/git_clone_request.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + + +class GitCloneRequest(BaseModel): + """ + GitCloneRequest + """ # noqa: E501 + + branch: Optional[StrictStr] = None + commit_id: Optional[StrictStr] = None + password: Optional[StrictStr] = None + path: StrictStr + url: StrictStr + username: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = [ + "branch", + "commit_id", + "password", + "path", + "url", + "username", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GitCloneRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GitCloneRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "branch": obj.get("branch"), + "commit_id": obj.get("commit_id"), + "password": obj.get("password"), + "path": obj.get("path"), + "url": obj.get("url"), + "username": obj.get("username"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/git_commit_info.py b/packages/python/src/api_client/models/git_commit_info.py new file mode 100644 index 0000000..6c78b96 --- /dev/null +++ b/packages/python/src/api_client/models/git_commit_info.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class GitCommitInfo(BaseModel): + """ + GitCommitInfo + """ # noqa: E501 + + author: StrictStr + email: StrictStr + hash: StrictStr + message: StrictStr + timestamp: StrictStr + __properties: ClassVar[List[str]] = [ + "author", + "email", + "hash", + "message", + "timestamp", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GitCommitInfo from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GitCommitInfo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "author": obj.get("author"), + "email": obj.get("email"), + "hash": obj.get("hash"), + "message": obj.get("message"), + "timestamp": obj.get("timestamp"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/git_commit_request.py b/packages/python/src/api_client/models/git_commit_request.py new file mode 100644 index 0000000..b0ab9e0 --- /dev/null +++ b/packages/python/src/api_client/models/git_commit_request.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class GitCommitRequest(BaseModel): + """ + GitCommitRequest + """ # noqa: E501 + + author: StrictStr + email: StrictStr + message: StrictStr + path: StrictStr + __properties: ClassVar[List[str]] = ["author", "email", "message", "path"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GitCommitRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GitCommitRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "author": obj.get("author"), + "email": obj.get("email"), + "message": obj.get("message"), + "path": obj.get("path"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/git_commit_response.py b/packages/python/src/api_client/models/git_commit_response.py new file mode 100644 index 0000000..5ae9402 --- /dev/null +++ b/packages/python/src/api_client/models/git_commit_response.py @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class GitCommitResponse(BaseModel): + """ + GitCommitResponse + """ # noqa: E501 + + hash: StrictStr + __properties: ClassVar[List[str]] = ["hash"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GitCommitResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GitCommitResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"hash": obj.get("hash")}) + return _obj diff --git a/packages/python/src/api_client/models/git_namespace.py b/packages/python/src/api_client/models/git_namespace.py new file mode 100644 index 0000000..2d99dc4 --- /dev/null +++ b/packages/python/src/api_client/models/git_namespace.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class GitNamespace(BaseModel): + """ + GitNamespace + """ # noqa: E501 + + id: StrictStr + name: StrictStr + __properties: ClassVar[List[str]] = ["id", "name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GitNamespace from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GitNamespace from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"id": obj.get("id"), "name": obj.get("name")}) + return _obj diff --git a/packages/python/src/api_client/models/git_provider.py b/packages/python/src/api_client/models/git_provider.py new file mode 100644 index 0000000..b9a0fdd --- /dev/null +++ b/packages/python/src/api_client/models/git_provider.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from api_client.models.signing_method import SigningMethod +from typing import Optional, Set +from typing_extensions import Self + + +class GitProvider(BaseModel): + """ + GitProvider + """ # noqa: E501 + + alias: StrictStr + base_api_url: Optional[StrictStr] = Field(default=None, alias="baseApiUrl") + id: StrictStr + provider_id: StrictStr = Field(alias="providerId") + signing_key: Optional[StrictStr] = Field(default=None, alias="signingKey") + signing_method: Optional[SigningMethod] = Field(default=None, alias="signingMethod") + token: StrictStr + username: StrictStr + __properties: ClassVar[List[str]] = [ + "alias", + "baseApiUrl", + "id", + "providerId", + "signingKey", + "signingMethod", + "token", + "username", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GitProvider from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GitProvider from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "alias": obj.get("alias"), + "baseApiUrl": obj.get("baseApiUrl"), + "id": obj.get("id"), + "providerId": obj.get("providerId"), + "signingKey": obj.get("signingKey"), + "signingMethod": obj.get("signingMethod"), + "token": obj.get("token"), + "username": obj.get("username"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/git_pull_request.py b/packages/python/src/api_client/models/git_pull_request.py new file mode 100644 index 0000000..b9eca81 --- /dev/null +++ b/packages/python/src/api_client/models/git_pull_request.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class GitPullRequest(BaseModel): + """ + GitPullRequest + """ # noqa: E501 + + branch: StrictStr + name: StrictStr + sha: StrictStr + source_repo_id: StrictStr = Field(alias="sourceRepoId") + source_repo_name: StrictStr = Field(alias="sourceRepoName") + source_repo_owner: StrictStr = Field(alias="sourceRepoOwner") + source_repo_url: StrictStr = Field(alias="sourceRepoUrl") + __properties: ClassVar[List[str]] = [ + "branch", + "name", + "sha", + "sourceRepoId", + "sourceRepoName", + "sourceRepoOwner", + "sourceRepoUrl", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GitPullRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GitPullRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "branch": obj.get("branch"), + "name": obj.get("name"), + "sha": obj.get("sha"), + "sourceRepoId": obj.get("sourceRepoId"), + "sourceRepoName": obj.get("sourceRepoName"), + "sourceRepoOwner": obj.get("sourceRepoOwner"), + "sourceRepoUrl": obj.get("sourceRepoUrl"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/git_repo_request.py b/packages/python/src/api_client/models/git_repo_request.py new file mode 100644 index 0000000..f216350 --- /dev/null +++ b/packages/python/src/api_client/models/git_repo_request.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + + +class GitRepoRequest(BaseModel): + """ + GitRepoRequest + """ # noqa: E501 + + password: Optional[StrictStr] = None + path: StrictStr + username: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["password", "path", "username"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GitRepoRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GitRepoRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "password": obj.get("password"), + "path": obj.get("path"), + "username": obj.get("username"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/git_repository.py b/packages/python/src/api_client/models/git_repository.py new file mode 100644 index 0000000..6afa194 --- /dev/null +++ b/packages/python/src/api_client/models/git_repository.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from api_client.models.clone_target import CloneTarget +from typing import Optional, Set +from typing_extensions import Self + + +class GitRepository(BaseModel): + """ + GitRepository + """ # noqa: E501 + + branch: StrictStr + clone_target: Optional[CloneTarget] = Field(default=None, alias="cloneTarget") + id: StrictStr + name: StrictStr + owner: StrictStr + path: Optional[StrictStr] = None + pr_number: Optional[StrictInt] = Field(default=None, alias="prNumber") + sha: StrictStr + source: StrictStr + url: StrictStr + __properties: ClassVar[List[str]] = [ + "branch", + "cloneTarget", + "id", + "name", + "owner", + "path", + "prNumber", + "sha", + "source", + "url", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GitRepository from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GitRepository from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "branch": obj.get("branch"), + "cloneTarget": obj.get("cloneTarget"), + "id": obj.get("id"), + "name": obj.get("name"), + "owner": obj.get("owner"), + "path": obj.get("path"), + "prNumber": obj.get("prNumber"), + "sha": obj.get("sha"), + "source": obj.get("source"), + "url": obj.get("url"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/git_status.py b/packages/python/src/api_client/models/git_status.py new file mode 100644 index 0000000..dc7fc0e --- /dev/null +++ b/packages/python/src/api_client/models/git_status.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from api_client.models.file_status import FileStatus +from typing import Optional, Set +from typing_extensions import Self + + +class GitStatus(BaseModel): + """ + GitStatus + """ # noqa: E501 + + ahead: Optional[StrictInt] = None + behind: Optional[StrictInt] = None + branch_published: Optional[StrictBool] = Field( + default=None, alias="branchPublished" + ) + current_branch: StrictStr = Field(alias="currentBranch") + file_status: List[FileStatus] = Field(alias="fileStatus") + __properties: ClassVar[List[str]] = [ + "ahead", + "behind", + "branchPublished", + "currentBranch", + "fileStatus", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GitStatus from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in file_status (list) + _items = [] + if self.file_status: + for _item_file_status in self.file_status: + if _item_file_status: + _items.append(_item_file_status.to_dict()) + _dict["fileStatus"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GitStatus from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "ahead": obj.get("ahead"), + "behind": obj.get("behind"), + "branchPublished": obj.get("branchPublished"), + "currentBranch": obj.get("currentBranch"), + "fileStatus": ( + [FileStatus.from_dict(_item) for _item in obj["fileStatus"]] + if obj.get("fileStatus") is not None + else None + ), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/git_user.py b/packages/python/src/api_client/models/git_user.py new file mode 100644 index 0000000..7348514 --- /dev/null +++ b/packages/python/src/api_client/models/git_user.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class GitUser(BaseModel): + """ + GitUser + """ # noqa: E501 + + email: StrictStr + id: StrictStr + name: StrictStr + username: StrictStr + __properties: ClassVar[List[str]] = ["email", "id", "name", "username"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GitUser from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GitUser from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "email": obj.get("email"), + "id": obj.get("id"), + "name": obj.get("name"), + "username": obj.get("username"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/install_provider_request.py b/packages/python/src/api_client/models/install_provider_request.py new file mode 100644 index 0000000..82e4722 --- /dev/null +++ b/packages/python/src/api_client/models/install_provider_request.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class InstallProviderRequest(BaseModel): + """ + InstallProviderRequest + """ # noqa: E501 + + download_urls: Dict[str, StrictStr] = Field(alias="downloadUrls") + name: StrictStr + __properties: ClassVar[List[str]] = ["downloadUrls", "name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of InstallProviderRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InstallProviderRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"downloadUrls": obj.get("downloadUrls"), "name": obj.get("name")} + ) + return _obj diff --git a/packages/python/src/api_client/models/list_branch_response.py b/packages/python/src/api_client/models/list_branch_response.py new file mode 100644 index 0000000..17d9851 --- /dev/null +++ b/packages/python/src/api_client/models/list_branch_response.py @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class ListBranchResponse(BaseModel): + """ + ListBranchResponse + """ # noqa: E501 + + branches: List[StrictStr] + __properties: ClassVar[List[str]] = ["branches"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListBranchResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListBranchResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"branches": obj.get("branches")}) + return _obj diff --git a/packages/python/src/api_client/models/log_file_config.py b/packages/python/src/api_client/models/log_file_config.py new file mode 100644 index 0000000..f23fd7c --- /dev/null +++ b/packages/python/src/api_client/models/log_file_config.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + + +class LogFileConfig(BaseModel): + """ + LogFileConfig + """ # noqa: E501 + + compress: Optional[StrictBool] = None + local_time: Optional[StrictBool] = Field(default=None, alias="localTime") + max_age: StrictInt = Field(alias="maxAge") + max_backups: StrictInt = Field(alias="maxBackups") + max_size: StrictInt = Field(alias="maxSize") + path: StrictStr + __properties: ClassVar[List[str]] = [ + "compress", + "localTime", + "maxAge", + "maxBackups", + "maxSize", + "path", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LogFileConfig from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LogFileConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "compress": obj.get("compress"), + "localTime": obj.get("localTime"), + "maxAge": obj.get("maxAge"), + "maxBackups": obj.get("maxBackups"), + "maxSize": obj.get("maxSize"), + "path": obj.get("path"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/lsp_completion_params.py b/packages/python/src/api_client/models/lsp_completion_params.py new file mode 100644 index 0000000..167ff9f --- /dev/null +++ b/packages/python/src/api_client/models/lsp_completion_params.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from api_client.models.completion_context import CompletionContext +from api_client.models.position import Position +from typing import Optional, Set +from typing_extensions import Self + + +class LspCompletionParams(BaseModel): + """ + LspCompletionParams + """ # noqa: E501 + + context: Optional[CompletionContext] = None + language_id: StrictStr = Field(alias="languageId") + path_to_project: StrictStr = Field(alias="pathToProject") + position: Position + uri: StrictStr + __properties: ClassVar[List[str]] = [ + "context", + "languageId", + "pathToProject", + "position", + "uri", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LspCompletionParams from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of context + if self.context: + _dict["context"] = self.context.to_dict() + # override the default output from pydantic by calling `to_dict()` of position + if self.position: + _dict["position"] = self.position.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LspCompletionParams from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "context": ( + CompletionContext.from_dict(obj["context"]) + if obj.get("context") is not None + else None + ), + "languageId": obj.get("languageId"), + "pathToProject": obj.get("pathToProject"), + "position": ( + Position.from_dict(obj["position"]) + if obj.get("position") is not None + else None + ), + "uri": obj.get("uri"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/lsp_document_request.py b/packages/python/src/api_client/models/lsp_document_request.py new file mode 100644 index 0000000..e7b37c1 --- /dev/null +++ b/packages/python/src/api_client/models/lsp_document_request.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class LspDocumentRequest(BaseModel): + """ + LspDocumentRequest + """ # noqa: E501 + + language_id: StrictStr = Field(alias="languageId") + path_to_project: StrictStr = Field(alias="pathToProject") + uri: StrictStr + __properties: ClassVar[List[str]] = ["languageId", "pathToProject", "uri"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LspDocumentRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LspDocumentRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "languageId": obj.get("languageId"), + "pathToProject": obj.get("pathToProject"), + "uri": obj.get("uri"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/lsp_location.py b/packages/python/src/api_client/models/lsp_location.py new file mode 100644 index 0000000..0fc33de --- /dev/null +++ b/packages/python/src/api_client/models/lsp_location.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from api_client.models.lsp_range import LspRange +from typing import Optional, Set +from typing_extensions import Self + + +class LspLocation(BaseModel): + """ + LspLocation + """ # noqa: E501 + + range: LspRange + uri: StrictStr + __properties: ClassVar[List[str]] = ["range", "uri"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LspLocation from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of range + if self.range: + _dict["range"] = self.range.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LspLocation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "range": ( + LspRange.from_dict(obj["range"]) + if obj.get("range") is not None + else None + ), + "uri": obj.get("uri"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/lsp_position.py b/packages/python/src/api_client/models/lsp_position.py new file mode 100644 index 0000000..8bad689 --- /dev/null +++ b/packages/python/src/api_client/models/lsp_position.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class LspPosition(BaseModel): + """ + LspPosition + """ # noqa: E501 + + character: StrictInt + line: StrictInt + __properties: ClassVar[List[str]] = ["character", "line"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LspPosition from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LspPosition from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"character": obj.get("character"), "line": obj.get("line")} + ) + return _obj diff --git a/packages/python/src/api_client/models/lsp_range.py b/packages/python/src/api_client/models/lsp_range.py new file mode 100644 index 0000000..84ca7ab --- /dev/null +++ b/packages/python/src/api_client/models/lsp_range.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from api_client.models.lsp_position import LspPosition +from typing import Optional, Set +from typing_extensions import Self + + +class LspRange(BaseModel): + """ + LspRange + """ # noqa: E501 + + end: LspPosition + start: LspPosition + __properties: ClassVar[List[str]] = ["end", "start"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LspRange from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of end + if self.end: + _dict["end"] = self.end.to_dict() + # override the default output from pydantic by calling `to_dict()` of start + if self.start: + _dict["start"] = self.start.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LspRange from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "end": ( + LspPosition.from_dict(obj["end"]) + if obj.get("end") is not None + else None + ), + "start": ( + LspPosition.from_dict(obj["start"]) + if obj.get("start") is not None + else None + ), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/lsp_server_request.py b/packages/python/src/api_client/models/lsp_server_request.py new file mode 100644 index 0000000..82f1d70 --- /dev/null +++ b/packages/python/src/api_client/models/lsp_server_request.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class LspServerRequest(BaseModel): + """ + LspServerRequest + """ # noqa: E501 + + language_id: StrictStr = Field(alias="languageId") + path_to_project: StrictStr = Field(alias="pathToProject") + __properties: ClassVar[List[str]] = ["languageId", "pathToProject"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LspServerRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LspServerRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "languageId": obj.get("languageId"), + "pathToProject": obj.get("pathToProject"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/lsp_symbol.py b/packages/python/src/api_client/models/lsp_symbol.py new file mode 100644 index 0000000..01c3256 --- /dev/null +++ b/packages/python/src/api_client/models/lsp_symbol.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from api_client.models.lsp_location import LspLocation +from typing import Optional, Set +from typing_extensions import Self + + +class LspSymbol(BaseModel): + """ + LspSymbol + """ # noqa: E501 + + kind: StrictInt + location: LspLocation + name: StrictStr + __properties: ClassVar[List[str]] = ["kind", "location", "name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LspSymbol from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of location + if self.location: + _dict["location"] = self.location.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LspSymbol from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "kind": obj.get("kind"), + "location": ( + LspLocation.from_dict(obj["location"]) + if obj.get("location") is not None + else None + ), + "name": obj.get("name"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/match.py b/packages/python/src/api_client/models/match.py new file mode 100644 index 0000000..d52ef95 --- /dev/null +++ b/packages/python/src/api_client/models/match.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class Match(BaseModel): + """ + Match + """ # noqa: E501 + + content: StrictStr + file: StrictStr + line: StrictInt + __properties: ClassVar[List[str]] = ["content", "file", "line"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Match from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Match from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "content": obj.get("content"), + "file": obj.get("file"), + "line": obj.get("line"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/network_key.py b/packages/python/src/api_client/models/network_key.py new file mode 100644 index 0000000..e872a3f --- /dev/null +++ b/packages/python/src/api_client/models/network_key.py @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class NetworkKey(BaseModel): + """ + NetworkKey + """ # noqa: E501 + + key: StrictStr + __properties: ClassVar[List[str]] = ["key"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NetworkKey from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NetworkKey from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"key": obj.get("key")}) + return _obj diff --git a/packages/python/src/api_client/models/position.py b/packages/python/src/api_client/models/position.py new file mode 100644 index 0000000..4d5b364 --- /dev/null +++ b/packages/python/src/api_client/models/position.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class Position(BaseModel): + """ + Position + """ # noqa: E501 + + character: StrictInt + line: StrictInt + __properties: ClassVar[List[str]] = ["character", "line"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Position from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Position from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"character": obj.get("character"), "line": obj.get("line")} + ) + return _obj diff --git a/packages/python/src/api_client/models/prebuild_config.py b/packages/python/src/api_client/models/prebuild_config.py new file mode 100644 index 0000000..71f485c --- /dev/null +++ b/packages/python/src/api_client/models/prebuild_config.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class PrebuildConfig(BaseModel): + """ + PrebuildConfig + """ # noqa: E501 + + branch: StrictStr + commit_interval: StrictInt = Field(alias="commitInterval") + id: StrictStr + retention: StrictInt + trigger_files: List[StrictStr] = Field(alias="triggerFiles") + __properties: ClassVar[List[str]] = [ + "branch", + "commitInterval", + "id", + "retention", + "triggerFiles", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PrebuildConfig from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PrebuildConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "branch": obj.get("branch"), + "commitInterval": obj.get("commitInterval"), + "id": obj.get("id"), + "retention": obj.get("retention"), + "triggerFiles": obj.get("triggerFiles"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/prebuild_dto.py b/packages/python/src/api_client/models/prebuild_dto.py new file mode 100644 index 0000000..78bf7b5 --- /dev/null +++ b/packages/python/src/api_client/models/prebuild_dto.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + + +class PrebuildDTO(BaseModel): + """ + PrebuildDTO + """ # noqa: E501 + + branch: StrictStr + commit_interval: Optional[StrictInt] = Field(default=None, alias="commitInterval") + id: StrictStr + project_config_name: StrictStr = Field(alias="projectConfigName") + retention: StrictInt + trigger_files: Optional[List[StrictStr]] = Field(default=None, alias="triggerFiles") + __properties: ClassVar[List[str]] = [ + "branch", + "commitInterval", + "id", + "projectConfigName", + "retention", + "triggerFiles", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PrebuildDTO from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PrebuildDTO from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "branch": obj.get("branch"), + "commitInterval": obj.get("commitInterval"), + "id": obj.get("id"), + "projectConfigName": obj.get("projectConfigName"), + "retention": obj.get("retention"), + "triggerFiles": obj.get("triggerFiles"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/profile_data.py b/packages/python/src/api_client/models/profile_data.py new file mode 100644 index 0000000..7ff3731 --- /dev/null +++ b/packages/python/src/api_client/models/profile_data.py @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class ProfileData(BaseModel): + """ + ProfileData + """ # noqa: E501 + + env_vars: Dict[str, StrictStr] = Field(alias="envVars") + __properties: ClassVar[List[str]] = ["envVars"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ProfileData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProfileData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"envVars": obj.get("envVars")}) + return _obj diff --git a/packages/python/src/api_client/models/project.py b/packages/python/src/api_client/models/project.py new file mode 100644 index 0000000..d1a6ae8 --- /dev/null +++ b/packages/python/src/api_client/models/project.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from api_client.models.build_config import BuildConfig +from api_client.models.git_repository import GitRepository +from api_client.models.project_state import ProjectState +from typing import Optional, Set +from typing_extensions import Self + + +class Project(BaseModel): + """ + Project + """ # noqa: E501 + + build_config: Optional[BuildConfig] = Field(default=None, alias="buildConfig") + env_vars: Dict[str, StrictStr] = Field(alias="envVars") + git_provider_config_id: Optional[StrictStr] = Field( + default=None, alias="gitProviderConfigId" + ) + image: StrictStr + name: StrictStr + repository: GitRepository + state: Optional[ProjectState] = None + target: StrictStr + user: StrictStr + workspace_id: StrictStr = Field(alias="workspaceId") + __properties: ClassVar[List[str]] = [ + "buildConfig", + "envVars", + "gitProviderConfigId", + "image", + "name", + "repository", + "state", + "target", + "user", + "workspaceId", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Project from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of build_config + if self.build_config: + _dict["buildConfig"] = self.build_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of repository + if self.repository: + _dict["repository"] = self.repository.to_dict() + # override the default output from pydantic by calling `to_dict()` of state + if self.state: + _dict["state"] = self.state.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Project from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "buildConfig": ( + BuildConfig.from_dict(obj["buildConfig"]) + if obj.get("buildConfig") is not None + else None + ), + "envVars": obj.get("envVars"), + "gitProviderConfigId": obj.get("gitProviderConfigId"), + "image": obj.get("image"), + "name": obj.get("name"), + "repository": ( + GitRepository.from_dict(obj["repository"]) + if obj.get("repository") is not None + else None + ), + "state": ( + ProjectState.from_dict(obj["state"]) + if obj.get("state") is not None + else None + ), + "target": obj.get("target"), + "user": obj.get("user"), + "workspaceId": obj.get("workspaceId"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/project_config.py b/packages/python/src/api_client/models/project_config.py new file mode 100644 index 0000000..3cdca04 --- /dev/null +++ b/packages/python/src/api_client/models/project_config.py @@ -0,0 +1,135 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from api_client.models.build_config import BuildConfig +from api_client.models.prebuild_config import PrebuildConfig +from typing import Optional, Set +from typing_extensions import Self + + +class ProjectConfig(BaseModel): + """ + ProjectConfig + """ # noqa: E501 + + build_config: Optional[BuildConfig] = Field(default=None, alias="buildConfig") + default: StrictBool + env_vars: Dict[str, StrictStr] = Field(alias="envVars") + git_provider_config_id: Optional[StrictStr] = Field( + default=None, alias="gitProviderConfigId" + ) + image: StrictStr + name: StrictStr + prebuilds: Optional[List[PrebuildConfig]] = None + repository_url: StrictStr = Field(alias="repositoryUrl") + user: StrictStr + __properties: ClassVar[List[str]] = [ + "buildConfig", + "default", + "envVars", + "gitProviderConfigId", + "image", + "name", + "prebuilds", + "repositoryUrl", + "user", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ProjectConfig from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of build_config + if self.build_config: + _dict["buildConfig"] = self.build_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in prebuilds (list) + _items = [] + if self.prebuilds: + for _item_prebuilds in self.prebuilds: + if _item_prebuilds: + _items.append(_item_prebuilds.to_dict()) + _dict["prebuilds"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProjectConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "buildConfig": ( + BuildConfig.from_dict(obj["buildConfig"]) + if obj.get("buildConfig") is not None + else None + ), + "default": obj.get("default"), + "envVars": obj.get("envVars"), + "gitProviderConfigId": obj.get("gitProviderConfigId"), + "image": obj.get("image"), + "name": obj.get("name"), + "prebuilds": ( + [PrebuildConfig.from_dict(_item) for _item in obj["prebuilds"]] + if obj.get("prebuilds") is not None + else None + ), + "repositoryUrl": obj.get("repositoryUrl"), + "user": obj.get("user"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/project_dir_response.py b/packages/python/src/api_client/models/project_dir_response.py new file mode 100644 index 0000000..f8e6de3 --- /dev/null +++ b/packages/python/src/api_client/models/project_dir_response.py @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + + +class ProjectDirResponse(BaseModel): + """ + ProjectDirResponse + """ # noqa: E501 + + dir: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["dir"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ProjectDirResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProjectDirResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"dir": obj.get("dir")}) + return _obj diff --git a/packages/python/src/api_client/models/project_info.py b/packages/python/src/api_client/models/project_info.py new file mode 100644 index 0000000..8e6d7c9 --- /dev/null +++ b/packages/python/src/api_client/models/project_info.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + + +class ProjectInfo(BaseModel): + """ + ProjectInfo + """ # noqa: E501 + + created: StrictStr + is_running: StrictBool = Field(alias="isRunning") + name: StrictStr + provider_metadata: Optional[StrictStr] = Field( + default=None, alias="providerMetadata" + ) + workspace_id: StrictStr = Field(alias="workspaceId") + __properties: ClassVar[List[str]] = [ + "created", + "isRunning", + "name", + "providerMetadata", + "workspaceId", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ProjectInfo from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProjectInfo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "created": obj.get("created"), + "isRunning": obj.get("isRunning"), + "name": obj.get("name"), + "providerMetadata": obj.get("providerMetadata"), + "workspaceId": obj.get("workspaceId"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/project_state.py b/packages/python/src/api_client/models/project_state.py new file mode 100644 index 0000000..9e793a1 --- /dev/null +++ b/packages/python/src/api_client/models/project_state.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from api_client.models.git_status import GitStatus +from typing import Optional, Set +from typing_extensions import Self + + +class ProjectState(BaseModel): + """ + ProjectState + """ # noqa: E501 + + git_status: Optional[GitStatus] = Field(default=None, alias="gitStatus") + updated_at: StrictStr = Field(alias="updatedAt") + uptime: StrictInt + __properties: ClassVar[List[str]] = ["gitStatus", "updatedAt", "uptime"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ProjectState from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of git_status + if self.git_status: + _dict["gitStatus"] = self.git_status.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProjectState from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "gitStatus": ( + GitStatus.from_dict(obj["gitStatus"]) + if obj.get("gitStatus") is not None + else None + ), + "updatedAt": obj.get("updatedAt"), + "uptime": obj.get("uptime"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/provider.py b/packages/python/src/api_client/models/provider.py new file mode 100644 index 0000000..bb98a25 --- /dev/null +++ b/packages/python/src/api_client/models/provider.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + + +class Provider(BaseModel): + """ + Provider + """ # noqa: E501 + + label: Optional[StrictStr] = None + name: StrictStr + version: StrictStr + __properties: ClassVar[List[str]] = ["label", "name", "version"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Provider from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Provider from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "label": obj.get("label"), + "name": obj.get("name"), + "version": obj.get("version"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/provider_provider_info.py b/packages/python/src/api_client/models/provider_provider_info.py new file mode 100644 index 0000000..38f272c --- /dev/null +++ b/packages/python/src/api_client/models/provider_provider_info.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + + +class ProviderProviderInfo(BaseModel): + """ + ProviderProviderInfo + """ # noqa: E501 + + label: Optional[StrictStr] = None + name: StrictStr + version: StrictStr + __properties: ClassVar[List[str]] = ["label", "name", "version"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ProviderProviderInfo from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProviderProviderInfo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "label": obj.get("label"), + "name": obj.get("name"), + "version": obj.get("version"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/provider_provider_target_property.py b/packages/python/src/api_client/models/provider_provider_target_property.py new file mode 100644 index 0000000..982fd79 --- /dev/null +++ b/packages/python/src/api_client/models/provider_provider_target_property.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from api_client.models.provider_provider_target_property_type import ( + ProviderProviderTargetPropertyType, +) +from typing import Optional, Set +from typing_extensions import Self + + +class ProviderProviderTargetProperty(BaseModel): + """ + ProviderProviderTargetProperty + """ # noqa: E501 + + default_value: Optional[StrictStr] = Field( + default=None, + description="DefaultValue is converted into the appropriate type based on the Type If the property is a FilePath, the DefaultValue is a path to a directory", + alias="defaultValue", + ) + description: Optional[StrictStr] = Field( + default=None, description="Brief description of the property" + ) + disabled_predicate: Optional[StrictStr] = Field( + default=None, + description='A regex string matched with the name of the target to determine if the property should be disabled If the regex matches the target name, the property will be disabled E.g. "^local$" will disable the property for the local target', + alias="disabledPredicate", + ) + input_masked: Optional[StrictBool] = Field(default=None, alias="inputMasked") + options: Optional[List[StrictStr]] = Field( + default=None, + description="Options is only used if the Type is ProviderTargetPropertyTypeOption", + ) + suggestions: Optional[List[StrictStr]] = Field( + default=None, + description="Suggestions is an optional list of auto-complete values to assist the user while filling the field", + ) + type: Optional[ProviderProviderTargetPropertyType] = None + __properties: ClassVar[List[str]] = [ + "defaultValue", + "description", + "disabledPredicate", + "inputMasked", + "options", + "suggestions", + "type", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ProviderProviderTargetProperty from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProviderProviderTargetProperty from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "defaultValue": obj.get("defaultValue"), + "description": obj.get("description"), + "disabledPredicate": obj.get("disabledPredicate"), + "inputMasked": obj.get("inputMasked"), + "options": obj.get("options"), + "suggestions": obj.get("suggestions"), + "type": obj.get("type"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/provider_provider_target_property_type.py b/packages/python/src/api_client/models/provider_provider_target_property_type.py new file mode 100644 index 0000000..68279fa --- /dev/null +++ b/packages/python/src/api_client/models/provider_provider_target_property_type.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class ProviderProviderTargetPropertyType(str, Enum): + """ + ProviderProviderTargetPropertyType + """ + + """ + allowed enum values + """ + STRING = "string" + OPTION = "option" + BOOLEAN = "boolean" + INT = "int" + FLOAT = "float" + FILE_MINUS_PATH = "file-path" + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ProviderProviderTargetPropertyType from a JSON string""" + return cls(json.loads(json_str)) diff --git a/packages/python/src/api_client/models/provider_target.py b/packages/python/src/api_client/models/provider_target.py new file mode 100644 index 0000000..cb8f4fd --- /dev/null +++ b/packages/python/src/api_client/models/provider_target.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List +from api_client.models.provider_provider_info import ProviderProviderInfo +from typing import Optional, Set +from typing_extensions import Self + + +class ProviderTarget(BaseModel): + """ + ProviderTarget + """ # noqa: E501 + + is_default: StrictBool = Field(alias="isDefault") + name: StrictStr + options: StrictStr = Field(description="JSON encoded map of options") + provider_info: ProviderProviderInfo = Field(alias="providerInfo") + __properties: ClassVar[List[str]] = ["isDefault", "name", "options", "providerInfo"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ProviderTarget from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of provider_info + if self.provider_info: + _dict["providerInfo"] = self.provider_info.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProviderTarget from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "isDefault": obj.get("isDefault"), + "name": obj.get("name"), + "options": obj.get("options"), + "providerInfo": ( + ProviderProviderInfo.from_dict(obj["providerInfo"]) + if obj.get("providerInfo") is not None + else None + ), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/replace_request.py b/packages/python/src/api_client/models/replace_request.py new file mode 100644 index 0000000..8c3c4db --- /dev/null +++ b/packages/python/src/api_client/models/replace_request.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class ReplaceRequest(BaseModel): + """ + ReplaceRequest + """ # noqa: E501 + + files: List[StrictStr] + new_value: StrictStr = Field(alias="newValue") + pattern: StrictStr + __properties: ClassVar[List[str]] = ["files", "newValue", "pattern"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ReplaceRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ReplaceRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "files": obj.get("files"), + "newValue": obj.get("newValue"), + "pattern": obj.get("pattern"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/replace_result.py b/packages/python/src/api_client/models/replace_result.py new file mode 100644 index 0000000..144b972 --- /dev/null +++ b/packages/python/src/api_client/models/replace_result.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + + +class ReplaceResult(BaseModel): + """ + ReplaceResult + """ # noqa: E501 + + error: Optional[StrictStr] = None + file: Optional[StrictStr] = None + success: Optional[StrictBool] = None + __properties: ClassVar[List[str]] = ["error", "file", "success"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ReplaceResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ReplaceResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "error": obj.get("error"), + "file": obj.get("file"), + "success": obj.get("success"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/repository_url.py b/packages/python/src/api_client/models/repository_url.py new file mode 100644 index 0000000..b78035c --- /dev/null +++ b/packages/python/src/api_client/models/repository_url.py @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class RepositoryUrl(BaseModel): + """ + RepositoryUrl + """ # noqa: E501 + + url: StrictStr + __properties: ClassVar[List[str]] = ["url"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RepositoryUrl from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RepositoryUrl from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"url": obj.get("url")}) + return _obj diff --git a/packages/python/src/api_client/models/sample.py b/packages/python/src/api_client/models/sample.py new file mode 100644 index 0000000..1c54ad3 --- /dev/null +++ b/packages/python/src/api_client/models/sample.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class Sample(BaseModel): + """ + Sample + """ # noqa: E501 + + description: StrictStr + git_url: StrictStr = Field(alias="gitUrl") + name: StrictStr + __properties: ClassVar[List[str]] = ["description", "gitUrl", "name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Sample from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Sample from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "description": obj.get("description"), + "gitUrl": obj.get("gitUrl"), + "name": obj.get("name"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/search_files_response.py b/packages/python/src/api_client/models/search_files_response.py new file mode 100644 index 0000000..bdc67f3 --- /dev/null +++ b/packages/python/src/api_client/models/search_files_response.py @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + + +class SearchFilesResponse(BaseModel): + """ + SearchFilesResponse + """ # noqa: E501 + + files: List[StrictStr] + __properties: ClassVar[List[str]] = ["files"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SearchFilesResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SearchFilesResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"files": obj.get("files")}) + return _obj diff --git a/packages/python/src/api_client/models/server_config.py b/packages/python/src/api_client/models/server_config.py new file mode 100644 index 0000000..25c0259 --- /dev/null +++ b/packages/python/src/api_client/models/server_config.py @@ -0,0 +1,157 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from api_client.models.frps_config import FRPSConfig +from api_client.models.log_file_config import LogFileConfig +from typing import Optional, Set +from typing_extensions import Self + + +class ServerConfig(BaseModel): + """ + ServerConfig + """ # noqa: E501 + + api_port: StrictInt = Field(alias="apiPort") + binaries_path: StrictStr = Field(alias="binariesPath") + build_image_namespace: Optional[StrictStr] = Field( + default=None, alias="buildImageNamespace" + ) + builder_image: StrictStr = Field(alias="builderImage") + builder_registry_server: StrictStr = Field(alias="builderRegistryServer") + default_project_image: StrictStr = Field(alias="defaultProjectImage") + default_project_user: StrictStr = Field(alias="defaultProjectUser") + frps: Optional[FRPSConfig] = None + headscale_port: StrictInt = Field(alias="headscalePort") + id: StrictStr + local_builder_registry_image: StrictStr = Field(alias="localBuilderRegistryImage") + local_builder_registry_port: StrictInt = Field(alias="localBuilderRegistryPort") + log_file: LogFileConfig = Field(alias="logFile") + providers_dir: StrictStr = Field(alias="providersDir") + registry_url: StrictStr = Field(alias="registryUrl") + samples_index_url: Optional[StrictStr] = Field( + default=None, alias="samplesIndexUrl" + ) + server_download_url: StrictStr = Field(alias="serverDownloadUrl") + __properties: ClassVar[List[str]] = [ + "apiPort", + "binariesPath", + "buildImageNamespace", + "builderImage", + "builderRegistryServer", + "defaultProjectImage", + "defaultProjectUser", + "frps", + "headscalePort", + "id", + "localBuilderRegistryImage", + "localBuilderRegistryPort", + "logFile", + "providersDir", + "registryUrl", + "samplesIndexUrl", + "serverDownloadUrl", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ServerConfig from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of frps + if self.frps: + _dict["frps"] = self.frps.to_dict() + # override the default output from pydantic by calling `to_dict()` of log_file + if self.log_file: + _dict["logFile"] = self.log_file.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ServerConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "apiPort": obj.get("apiPort"), + "binariesPath": obj.get("binariesPath"), + "buildImageNamespace": obj.get("buildImageNamespace"), + "builderImage": obj.get("builderImage"), + "builderRegistryServer": obj.get("builderRegistryServer"), + "defaultProjectImage": obj.get("defaultProjectImage"), + "defaultProjectUser": obj.get("defaultProjectUser"), + "frps": ( + FRPSConfig.from_dict(obj["frps"]) + if obj.get("frps") is not None + else None + ), + "headscalePort": obj.get("headscalePort"), + "id": obj.get("id"), + "localBuilderRegistryImage": obj.get("localBuilderRegistryImage"), + "localBuilderRegistryPort": obj.get("localBuilderRegistryPort"), + "logFile": ( + LogFileConfig.from_dict(obj["logFile"]) + if obj.get("logFile") is not None + else None + ), + "providersDir": obj.get("providersDir"), + "registryUrl": obj.get("registryUrl"), + "samplesIndexUrl": obj.get("samplesIndexUrl"), + "serverDownloadUrl": obj.get("serverDownloadUrl"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/set_git_provider_config.py b/packages/python/src/api_client/models/set_git_provider_config.py new file mode 100644 index 0000000..0be1a51 --- /dev/null +++ b/packages/python/src/api_client/models/set_git_provider_config.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from api_client.models.signing_method import SigningMethod +from typing import Optional, Set +from typing_extensions import Self + + +class SetGitProviderConfig(BaseModel): + """ + SetGitProviderConfig + """ # noqa: E501 + + alias: Optional[StrictStr] = None + base_api_url: Optional[StrictStr] = Field(default=None, alias="baseApiUrl") + id: Optional[StrictStr] = None + provider_id: StrictStr = Field(alias="providerId") + signing_key: Optional[StrictStr] = Field(default=None, alias="signingKey") + signing_method: Optional[SigningMethod] = Field(default=None, alias="signingMethod") + token: StrictStr + username: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = [ + "alias", + "baseApiUrl", + "id", + "providerId", + "signingKey", + "signingMethod", + "token", + "username", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SetGitProviderConfig from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SetGitProviderConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "alias": obj.get("alias"), + "baseApiUrl": obj.get("baseApiUrl"), + "id": obj.get("id"), + "providerId": obj.get("providerId"), + "signingKey": obj.get("signingKey"), + "signingMethod": obj.get("signingMethod"), + "token": obj.get("token"), + "username": obj.get("username"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/set_project_state.py b/packages/python/src/api_client/models/set_project_state.py new file mode 100644 index 0000000..4eadd72 --- /dev/null +++ b/packages/python/src/api_client/models/set_project_state.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from api_client.models.git_status import GitStatus +from typing import Optional, Set +from typing_extensions import Self + + +class SetProjectState(BaseModel): + """ + SetProjectState + """ # noqa: E501 + + git_status: Optional[GitStatus] = Field(default=None, alias="gitStatus") + uptime: StrictInt + __properties: ClassVar[List[str]] = ["gitStatus", "uptime"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SetProjectState from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of git_status + if self.git_status: + _dict["gitStatus"] = self.git_status.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SetProjectState from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "gitStatus": ( + GitStatus.from_dict(obj["gitStatus"]) + if obj.get("gitStatus") is not None + else None + ), + "uptime": obj.get("uptime"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/signing_method.py b/packages/python/src/api_client/models/signing_method.py new file mode 100644 index 0000000..ae90dea --- /dev/null +++ b/packages/python/src/api_client/models/signing_method.py @@ -0,0 +1,35 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class SigningMethod(str, Enum): + """ + SigningMethod + """ + + """ + allowed enum values + """ + SSH = "ssh" + GPG = "gpg" + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SigningMethod from a JSON string""" + return cls(json.loads(json_str)) diff --git a/packages/python/src/api_client/models/status.py b/packages/python/src/api_client/models/status.py new file mode 100644 index 0000000..20b3dfe --- /dev/null +++ b/packages/python/src/api_client/models/status.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class Status(str, Enum): + """ + Status + """ + + """ + allowed enum values + """ + UNMODIFIED = "Unmodified" + UNTRACKED = "Untracked" + MODIFIED = "Modified" + ADDED = "Added" + DELETED = "Deleted" + RENAMED = "Renamed" + COPIED = "Copied" + UPDATED_BUT_UNMERGED = "Updated but unmerged" + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of Status from a JSON string""" + return cls(json.loads(json_str)) diff --git a/packages/python/src/api_client/models/workspace.py b/packages/python/src/api_client/models/workspace.py new file mode 100644 index 0000000..096e9f0 --- /dev/null +++ b/packages/python/src/api_client/models/workspace.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from api_client.models.project import Project +from typing import Optional, Set +from typing_extensions import Self + + +class Workspace(BaseModel): + """ + Workspace + """ # noqa: E501 + + id: StrictStr + name: StrictStr + projects: List[Project] + target: StrictStr + __properties: ClassVar[List[str]] = ["id", "name", "projects", "target"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Workspace from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in projects (list) + _items = [] + if self.projects: + for _item_projects in self.projects: + if _item_projects: + _items.append(_item_projects.to_dict()) + _dict["projects"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Workspace from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "id": obj.get("id"), + "name": obj.get("name"), + "projects": ( + [Project.from_dict(_item) for _item in obj["projects"]] + if obj.get("projects") is not None + else None + ), + "target": obj.get("target"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/workspace_dto.py b/packages/python/src/api_client/models/workspace_dto.py new file mode 100644 index 0000000..231f67b --- /dev/null +++ b/packages/python/src/api_client/models/workspace_dto.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from api_client.models.project import Project +from api_client.models.workspace_info import WorkspaceInfo +from typing import Optional, Set +from typing_extensions import Self + + +class WorkspaceDTO(BaseModel): + """ + WorkspaceDTO + """ # noqa: E501 + + id: StrictStr + info: Optional[WorkspaceInfo] = None + name: StrictStr + projects: List[Project] + target: StrictStr + __properties: ClassVar[List[str]] = ["id", "info", "name", "projects", "target"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WorkspaceDTO from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of info + if self.info: + _dict["info"] = self.info.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in projects (list) + _items = [] + if self.projects: + for _item_projects in self.projects: + if _item_projects: + _items.append(_item_projects.to_dict()) + _dict["projects"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WorkspaceDTO from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "id": obj.get("id"), + "info": ( + WorkspaceInfo.from_dict(obj["info"]) + if obj.get("info") is not None + else None + ), + "name": obj.get("name"), + "projects": ( + [Project.from_dict(_item) for _item in obj["projects"]] + if obj.get("projects") is not None + else None + ), + "target": obj.get("target"), + } + ) + return _obj diff --git a/packages/python/src/api_client/models/workspace_info.py b/packages/python/src/api_client/models/workspace_info.py new file mode 100644 index 0000000..83904ed --- /dev/null +++ b/packages/python/src/api_client/models/workspace_info.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from api_client.models.project_info import ProjectInfo +from typing import Optional, Set +from typing_extensions import Self + + +class WorkspaceInfo(BaseModel): + """ + WorkspaceInfo + """ # noqa: E501 + + name: StrictStr + projects: List[ProjectInfo] + provider_metadata: Optional[StrictStr] = Field( + default=None, alias="providerMetadata" + ) + __properties: ClassVar[List[str]] = ["name", "projects", "providerMetadata"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WorkspaceInfo from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in projects (list) + _items = [] + if self.projects: + for _item_projects in self.projects: + if _item_projects: + _items.append(_item_projects.to_dict()) + _dict["projects"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WorkspaceInfo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "name": obj.get("name"), + "projects": ( + [ProjectInfo.from_dict(_item) for _item in obj["projects"]] + if obj.get("projects") is not None + else None + ), + "providerMetadata": obj.get("providerMetadata"), + } + ) + return _obj diff --git a/packages/python/src/api_client/rest.py b/packages/python/src/api_client/rest.py new file mode 100644 index 0000000..1ef60f6 --- /dev/null +++ b/packages/python/src/api_client/rest.py @@ -0,0 +1,246 @@ +# coding: utf-8 + +""" + Daytona Server API + + Daytona Server API + + The version of the OpenAPI document: v0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import io +import json +import re +import ssl + +import urllib3 + +from api_client.exceptions import ApiException, ApiValueError + +SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"} +RESTResponseType = urllib3.HTTPResponse + + +def is_socks_proxy_url(url): + if url is None: + return False + split_section = url.split("://") + if len(split_section) < 2: + return False + else: + return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES + + +class RESTResponse(io.IOBase): + + def __init__(self, resp) -> None: + self.response = resp + self.status = resp.status + self.reason = resp.reason + self.data = None + + def read(self): + if self.data is None: + self.data = self.response.data + return self.data + + def getheaders(self): + """Returns a dictionary of the response headers.""" + return self.response.headers + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.response.headers.get(name, default) + + +class RESTClientObject: + + def __init__(self, configuration) -> None: + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + pool_args = { + "cert_reqs": cert_reqs, + "ca_certs": configuration.ssl_ca_cert, + "cert_file": configuration.cert_file, + "key_file": configuration.key_file, + } + if configuration.assert_hostname is not None: + pool_args["assert_hostname"] = configuration.assert_hostname + + if configuration.retries is not None: + pool_args["retries"] = configuration.retries + + if configuration.tls_server_name: + pool_args["server_hostname"] = configuration.tls_server_name + + if configuration.socket_options is not None: + pool_args["socket_options"] = configuration.socket_options + + if configuration.connection_pool_maxsize is not None: + pool_args["maxsize"] = configuration.connection_pool_maxsize + + # https pool manager + self.pool_manager: urllib3.PoolManager + + if configuration.proxy: + if is_socks_proxy_url(configuration.proxy): + from urllib3.contrib.socks import SOCKSProxyManager + + pool_args["proxy_url"] = configuration.proxy + pool_args["headers"] = configuration.proxy_headers + self.pool_manager = SOCKSProxyManager(**pool_args) + else: + pool_args["proxy_url"] = configuration.proxy + pool_args["proxy_headers"] = configuration.proxy_headers + self.pool_manager = urllib3.ProxyManager(**pool_args) + else: + self.pool_manager = urllib3.PoolManager(**pool_args) + + def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None, + ): + """Perform requests. + + :param method: http request method + :param url: http request url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in ["GET", "HEAD", "DELETE", "POST", "PUT", "PATCH", "OPTIONS"] + + if post_params and body: + raise ApiValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, (int, float)): + timeout = urllib3.Timeout(total=_request_timeout) + elif isinstance(_request_timeout, tuple) and len(_request_timeout) == 2: + timeout = urllib3.Timeout( + connect=_request_timeout[0], read=_request_timeout[1] + ) + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ["POST", "PUT", "PATCH", "OPTIONS", "DELETE"]: + + # no content type provided or payload is json + content_type = headers.get("Content-Type") + if not content_type or re.search("json", content_type, re.IGNORECASE): + request_body = None + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request( + method, + url, + body=request_body, + timeout=timeout, + headers=headers, + preload_content=False, + ) + elif content_type == "application/x-www-form-urlencoded": + r = self.pool_manager.request( + method, + url, + fields=post_params, + encode_multipart=False, + timeout=timeout, + headers=headers, + preload_content=False, + ) + elif content_type == "multipart/form-data": + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers["Content-Type"] + # Ensures that dict objects are serialized + post_params = [ + (a, json.dumps(b)) if isinstance(b, dict) else (a, b) + for a, b in post_params + ] + r = self.pool_manager.request( + method, + url, + fields=post_params, + encode_multipart=True, + timeout=timeout, + headers=headers, + preload_content=False, + ) + # Pass a `string` parameter directly in the body to support + # other content types than JSON when `body` argument is + # provided in serialized form. + elif isinstance(body, str) or isinstance(body, bytes): + r = self.pool_manager.request( + method, + url, + body=body, + timeout=timeout, + headers=headers, + preload_content=False, + ) + elif headers["Content-Type"].startswith("text/") and isinstance( + body, bool + ): + request_body = "true" if body else "false" + r = self.pool_manager.request( + method, + url, + body=request_body, + preload_content=False, + timeout=timeout, + headers=headers, + ) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request( + method, + url, + fields={}, + timeout=timeout, + headers=headers, + preload_content=False, + ) + except urllib3.exceptions.SSLError as e: + msg = "\n".join([type(e).__name__, str(e)]) + raise ApiException(status=0, reason=msg) + + return RESTResponse(r) diff --git a/packages/python/src/daytona_sdk/__init__.py b/packages/python/src/daytona_sdk/__init__.py new file mode 100644 index 0000000..8407b83 --- /dev/null +++ b/packages/python/src/daytona_sdk/__init__.py @@ -0,0 +1,10 @@ +from .daytona import ( + Daytona, + DaytonaConfig, + CreateWorkspaceParams, + CodeLanguage, + Workspace, +) + +__all__ = ["Daytona", "DaytonaConfig", + "CreateWorkspaceParams", "CodeLanguage", "Workspace"] diff --git a/packages/python/src/daytona_sdk/api_client.py b/packages/python/src/daytona_sdk/api_client.py new file mode 100644 index 0000000..9669eae --- /dev/null +++ b/packages/python/src/daytona_sdk/api_client.py @@ -0,0 +1,36 @@ +import aiohttp +from typing import Any, Dict, Optional +from urllib.parse import urljoin + + +class AsyncApiClient: + def __init__(self, base_url: str, headers: Optional[Dict[str, str]] = None): + self.base_url = base_url.rstrip("/") + self.headers = headers or {} + self.session = None + + async def __aenter__(self): + self.session = aiohttp.ClientSession(headers=self.headers) + return self + + async def __aexit__(self, exc_type, exc_val, exc_tb): + if self.session: + await self.session.close() + + async def request(self, method: str, path: str, **kwargs) -> Any: + if not self.session: + self.session = aiohttp.ClientSession(headers=self.headers) + + url = urljoin(self.base_url, path) + async with self.session.request(method, url, **kwargs) as response: + response.raise_for_status() + return await response.json() + + async def get(self, path: str, **kwargs) -> Any: + return await self.request("GET", path, **kwargs) + + async def post(self, path: str, **kwargs) -> Any: + return await self.request("POST", path, **kwargs) + + async def delete(self, path: str, **kwargs) -> Any: + return await self.request("DELETE", path, **kwargs) diff --git a/packages/python/src/daytona_sdk/code_toolbox/__init__.py b/packages/python/src/daytona_sdk/code_toolbox/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/packages/python/src/daytona_sdk/code_toolbox/workspace_python_code_toolbox.py b/packages/python/src/daytona_sdk/code_toolbox/workspace_python_code_toolbox.py new file mode 100644 index 0000000..a8f3ce1 --- /dev/null +++ b/packages/python/src/daytona_sdk/code_toolbox/workspace_python_code_toolbox.py @@ -0,0 +1,16 @@ +import base64 +from typing import Protocol + + +class WorkspaceCodeToolbox(Protocol): + def get_default_image(self) -> str: ... + def get_run_command(self, code: str) -> str: ... + + +class WorkspacePythonCodeToolbox: + def get_default_image(self) -> str: + return "daytonaio/ai-test:0.1.0" # todo: replace with ts image + + def get_run_command(self, code: str) -> str: + base64_code = base64.b64encode(code.encode()).decode() + return f"python3 -c \"exec(__import__('base64').b64decode('{base64_code}').decode())\"" diff --git a/packages/python/src/daytona_sdk/code_toolbox/workspace_ts_code_toolbox.py b/packages/python/src/daytona_sdk/code_toolbox/workspace_ts_code_toolbox.py new file mode 100644 index 0000000..ea049f2 --- /dev/null +++ b/packages/python/src/daytona_sdk/code_toolbox/workspace_ts_code_toolbox.py @@ -0,0 +1,16 @@ +import base64 +from typing import Protocol + + +class WorkspaceCodeToolbox(Protocol): + def get_default_image(self) -> str: ... + def get_run_command(self, code: str) -> str: ... + + +class WorkspaceTsCodeToolbox: + def get_default_image(self) -> str: + return "daytonaio/ai-test:0.1.0" # todo: replace with ts image + + def get_run_command(self, code: str) -> str: + base64_code = base64.b64encode(code.encode()).decode() + return f"python3 -c \"exec(__import__('base64').b64decode('{base64_code}').decode())\"" diff --git a/packages/python/src/daytona_sdk/daytona.py b/packages/python/src/daytona_sdk/daytona.py new file mode 100644 index 0000000..cc1ceab --- /dev/null +++ b/packages/python/src/daytona_sdk/daytona.py @@ -0,0 +1,178 @@ +import os +import uuid +from typing import Optional, Literal, Dict, Any +from dataclasses import dataclass +from environs import Env +import time + +from .code_toolbox.workspace_python_code_toolbox import WorkspacePythonCodeToolbox +from .code_toolbox.workspace_ts_code_toolbox import WorkspaceTsCodeToolbox +from .workspace import Workspace +from api_client import ( + Configuration, + WorkspaceApi, + GitProviderApi, + WorkspaceToolboxApi, + ApiClient, +) + +# Type definitions +CodeLanguage = Literal["python", "javascript", "typescript"] + + +@dataclass +class DaytonaConfig: + api_key: str + server_url: str + target: str + + +@dataclass +class CreateWorkspaceParams: + language: CodeLanguage + id: Optional[str] = None + image: Optional[str] = None + + +class Daytona: + def __init__(self, config: Optional[DaytonaConfig] = None): + """ + Initialize Daytona instance with optional configuration. + If no config is provided, reads from environment variables using environs. + + Args: + config: Optional DaytonaConfig object containing api_key, server_url, and target + + Raises: + ValueError: If API key or Server URL is not provided either through config or environment variables + """ + if config is None: + # Initialize env - it automatically reads from .env and .env.local + env = Env() + env.read_env() # reads .env + # reads .env.local and overrides values + env.read_env(".env.local", override=True) + + self.api_key = env.str("DAYTONA_API_KEY") + self.server_url = env.str("DAYTONA_SERVER_URL") + self.target = env.str("DAYTONA_TARGET", "local") + else: + self.api_key = config.api_key + self.server_url = config.server_url + self.target = config.target + + if not self.api_key: + raise ValueError("API key is required") + + if not self.server_url: + raise ValueError("Server URL is required") + + # Create API configuration without api_key + configuration = Configuration(host=self.server_url) + api_client = ApiClient(configuration) + api_client.default_headers["Authorization"] = f"Bearer {self.api_key}" + + # Initialize API clients with the api_client instance + self.git_provider_api = GitProviderApi(api_client) + self.workspace_api = WorkspaceApi(api_client) + self.toolbox_api = WorkspaceToolboxApi(api_client) + + def create(self, params: Optional[CreateWorkspaceParams] = None) -> Workspace: + """ + Create a new workspace with the specified parameters. + """ + workspace_id = ( + params.id if params and params.id else f"sandbox-{str(uuid.uuid4())[:8]}" + ) + code_toolbox = self._get_code_toolbox(params) + + try: + # Create project as a dictionary + project = { + "name": "main", + "image": ( + params.image + if params and params.image + else code_toolbox.get_default_image() + ), + "env_vars": {"DAYTONA_SKIP_CLONE": "true"}, + "source": { + "repository": { + "branch": "main", + "clone_target": "branch", + "id": "python-helloworld", + "name": "python-helloworld", + "owner": "dbarnett", + "path": None, + "pr_number": None, + "sha": "288d7ced1b971fd1b3b0c36002b96e1c3f91542e", + "source": "github.com", + "url": "https://github.com/dbarnett/python-helloworld.git", + } + }, + } + + # Create workspace using dictionary + workspace_data = { + "id": workspace_id, + "name": workspace_id, + "projects": [project], + "target": self.target, + } + + response = self.workspace_api.create_workspace(workspace=workspace_data) + return Workspace(workspace_id, response, self.toolbox_api, code_toolbox) + + except Exception as e: + try: + self.workspace_api.remove_workspace(workspace_id=workspace_id) + except: + pass + raise Exception(f"Failed to create workspace: {str(e)}") from e + + def _get_code_toolbox(self, params: Optional[CreateWorkspaceParams] = None): + """Helper method to get the appropriate code toolbox""" + if not params: + return WorkspacePythonCodeToolbox() + + match params.language: + case "javascript" | "typescript": + return WorkspaceTsCodeToolbox() + case "python": + return WorkspacePythonCodeToolbox() + case _: + raise ValueError(f"Unsupported language: {params.language}") + + def remove(self, workspace: Workspace) -> None: + """ + Remove a workspace. + + Args: + workspace: The workspace to remove + """ + return self.workspace_api.remove_workspace(workspace_id=workspace.id) + + def get_current_workspace(self) -> Workspace: + """ + Get the current workspace based on environment variables. + + Returns: + Workspace: The current workspace instance + + Raises: + ValueError: If DAYTONA_WORKSPACE_ID is not set in environment + """ + env = Env() + workspace_id = env.str("DAYTONA_WORKSPACE_ID") + + if not workspace_id: + raise ValueError("DAYTONA_WORKSPACE_ID environment variable is required") + + # Get the workspace instance + workspace_instance = self.workspace_api.get_workspace(workspace_id=workspace_id) + + # Create and return workspace with Python code toolbox as default + code_toolbox = WorkspacePythonCodeToolbox() + return Workspace( + workspace_id, workspace_instance, self.toolbox_api, code_toolbox + ) diff --git a/packages/python/src/daytona_sdk/filesystem.py b/packages/python/src/daytona_sdk/filesystem.py new file mode 100644 index 0000000..6e1aa5f --- /dev/null +++ b/packages/python/src/daytona_sdk/filesystem.py @@ -0,0 +1,87 @@ +from typing import List, Optional +from api_client import ( + FileInfo, + Match, + ReplaceRequest, + ReplaceResult, + SearchFilesResponse, + Workspace as WorkspaceInstance, + WorkspaceToolboxApi, +) + + +class FileSystem: + def __init__(self, instance: WorkspaceInstance, toolbox_api: WorkspaceToolboxApi): + self.instance = instance + self.toolbox_api = toolbox_api + + def create_folder(self, path: str, mode: str) -> None: + self.toolbox_api.fs_create_folder( + workspace_id=self.instance.id, project_id="main", path=path, mode=mode + ) + + def delete_file(self, path: str) -> None: + self.toolbox_api.fs_delete_file( + workspace_id=self.instance.id, project_id="main", path=path + ) + + def download_file(self, path: str) -> bytes: + return self.toolbox_api.fs_download_file( + workspace_id=self.instance.id, project_id="main", path=path + ) + + def find_files(self, path: str, pattern: str) -> List[Match]: + return self.toolbox_api.fs_find_in_files( + workspace_id=self.instance.id, project_id="main", path=path, pattern=pattern + ) + + def get_file_details(self, path: str) -> FileInfo: + return self.toolbox_api.fs_get_file_details( + workspace_id=self.instance.id, project_id="main", path=path + ) + + def list_files(self, path: str) -> List[FileInfo]: + return self.toolbox_api.fs_list_files( + workspace_id=self.instance.id, project_id="main", path=path + ) + + def move_files(self, source: str, destination: str) -> None: + self.toolbox_api.fs_move_file( + workspace_id=self.instance.id, + project_id="main", + source=source, + destination=destination, + ) + + def replace_in_files( + self, files: List[str], pattern: str, new_value: str + ) -> List[ReplaceResult]: + replace_request = ReplaceRequest( + files=files, new_value=new_value, pattern=pattern + ) + + return self.toolbox_api.fs_replace_in_files( + workspace_id=self.instance.id, project_id="main", replace=replace_request + ) + + def search_files(self, path: str, pattern: str) -> SearchFilesResponse: + return self.toolbox_api.fs_search_files( + workspace_id=self.instance.id, project_id="main", path=path, pattern=pattern + ) + + def set_file_permissions( + self, path: str, mode: str = None, owner: str = None, group: str = None + ) -> None: + self.toolbox_api.fs_set_file_permissions( + workspace_id=self.instance.id, + project_id="main", + path=path, + mode=mode, + owner=owner, + group=group, + ) + + def upload_file(self, path: str, file: bytes) -> None: + self.toolbox_api.fs_upload_file( + workspace_id=self.instance.id, project_id="main", path=path, file=file + ) diff --git a/packages/python/src/daytona_sdk/git.py b/packages/python/src/daytona_sdk/git.py new file mode 100644 index 0000000..1a31a1e --- /dev/null +++ b/packages/python/src/daytona_sdk/git.py @@ -0,0 +1,91 @@ +from typing import List, Optional, TYPE_CHECKING +from api_client import ( + GitStatus, + ListBranchResponse, + Match, + Workspace as WorkspaceInstance, + WorkspaceToolboxApi, +) + +if TYPE_CHECKING: + from .workspace import Workspace + + +class Git: + def __init__( + self, + workspace: "Workspace", + toolbox_api: WorkspaceToolboxApi, + instance: WorkspaceInstance, + ): + self.workspace = workspace + self.toolbox_api = toolbox_api + self.instance = instance + + def add(self, path: str, files: List[str]) -> None: + self.toolbox_api.git_add_files( + workspace_id=self.instance.id, + project_id="main", # todo: remove this after project refactor + params={"path": path, "files": files}, + ) + + def branches(self, path: str) -> ListBranchResponse: + return self.toolbox_api.git_branch_list( + workspace_id=self.instance.id, + project_id="main", # todo: remove this after project refactor + path=path, + ) + + def clone( + self, + url: str, + path: str, + branch: Optional[str] = None, + commit_id: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + ) -> None: + self.toolbox_api.git_clone_repository( + workspace_id=self.instance.id, + project_id="main", # todo: remove this after project refactor + params={ + "url": url, + "branch": branch, + "path": path, + "username": username, + "password": password, + "commitId": commit_id, + }, + ) + + def commit(self, path: str, message: str, author: str, email: str) -> None: + self.toolbox_api.git_commit_changes( + workspace_id=self.instance.id, + project_id="main", # todo: remove this after project refactor + params={"path": path, "message": message, "author": author, "email": email}, + ) + + def push( + self, path: str, username: Optional[str] = None, password: Optional[str] = None + ) -> None: + self.toolbox_api.git_push_changes( + workspace_id=self.instance.id, + project_id="main", # todo: remove this after project refactor + params={"path": path, "username": username, "password": password}, + ) + + def pull( + self, path: str, username: Optional[str] = None, password: Optional[str] = None + ) -> None: + self.toolbox_api.git_pull_changes( + workspace_id=self.instance.id, + project_id="main", # todo: remove this after project refactor + params={"path": path, "username": username, "password": password}, + ) + + def status(self, path: str) -> GitStatus: + return self.toolbox_api.git_git_status( + workspace_id=self.instance.id, + project_id="main", # todo: remove this after project refactor + path=path, + ) diff --git a/packages/python/src/daytona_sdk/lsp_server.py b/packages/python/src/daytona_sdk/lsp_server.py new file mode 100644 index 0000000..5eb4891 --- /dev/null +++ b/packages/python/src/daytona_sdk/lsp_server.py @@ -0,0 +1,101 @@ +from typing import List, Dict, Literal +from api_client import ( + CompletionList, + LspSymbol, + Workspace as WorkspaceInstance, + WorkspaceToolboxApi, +) + +LspLanguageId = Literal["typescript"] + + +class Position: + def __init__(self, line: int, character: int): + self.line = line + self.character = character + + +class LspServer: + def __init__( + self, + language_id: LspLanguageId, + path_to_project: str, + toolbox_api: WorkspaceToolboxApi, + instance: WorkspaceInstance, + ): + self.language_id = language_id + self.path_to_project = path_to_project + self.toolbox_api = toolbox_api + self.instance = instance + + def start(self) -> None: + self.toolbox_api.lsp_start( + workspace_id=self.instance.id, + project_id="main", + params={ + "language_id": self.language_id, + "path_to_project": self.path_to_project, + }, + ) + + def stop(self) -> None: + self.toolbox_api.lsp_stop( + workspace_id=self.instance.id, + project_id="main", + params={ + "language_id": self.language_id, + "path_to_project": self.path_to_project, + }, + ) + + def did_open(self, path: str) -> None: + self.toolbox_api.lsp_did_open( + workspace_id=self.instance.id, + project_id="main", + params={ + "language_id": self.language_id, + "path_to_project": self.path_to_project, + "uri": f"file://{path}", + }, + ) + + def did_close(self, path: str) -> None: + self.toolbox_api.lsp_did_close( + workspace_id=self.instance.id, + project_id="main", + params={ + "language_id": self.language_id, + "path_to_project": self.path_to_project, + "uri": f"file://{path}", + }, + ) + + def document_symbols(self, path: str) -> List[LspSymbol]: + return self.toolbox_api.lsp_document_symbols( + workspace_id=self.instance.id, + project_id="main", + language_id=self.language_id, + path_to_project=self.path_to_project, + uri=f"file://{path}", + ) + + def workspace_symbols(self, query: str) -> List[LspSymbol]: + return self.toolbox_api.lsp_workspace_symbols( + workspace_id=self.instance.id, + project_id="main", + language_id=self.language_id, + path_to_project=self.path_to_project, + query=query, + ) + + def completions(self, path: str, position: Position) -> CompletionList: + return self.toolbox_api.lsp_completions( + workspace_id=self.instance.id, + project_id="main", + params={ + "language_id": self.language_id, + "path_to_project": self.path_to_project, + "uri": f"file://{path}", + "position": position, + }, + ) diff --git a/packages/python/src/daytona_sdk/process.py b/packages/python/src/daytona_sdk/process.py new file mode 100644 index 0000000..8e62f58 --- /dev/null +++ b/packages/python/src/daytona_sdk/process.py @@ -0,0 +1,31 @@ +from typing import Optional +from api_client import ( + Workspace as WorkspaceInstance, + WorkspaceToolboxApi, + ExecuteResponse, +) +from .code_toolbox.workspace_python_code_toolbox import WorkspaceCodeToolbox + + +class Process: + def __init__( + self, + code_toolbox: WorkspaceCodeToolbox, + toolbox_api: WorkspaceToolboxApi, + instance: WorkspaceInstance, + ): + self.code_toolbox = code_toolbox + self.toolbox_api = toolbox_api + self.instance = instance + + def exec(self, command: str, cwd: Optional[str] = None) -> ExecuteResponse: + return self.toolbox_api.process_execute_command( + workspace_id=self.instance.id, + project_id="main", + params={"command": command, "cwd": cwd}, + ) + + def code_run(self, code: str) -> ExecuteResponse: + """Execute code in the workspace using the appropriate runner for the language""" + command = self.code_toolbox.get_run_command(code) + return self.exec(command) diff --git a/packages/python/src/daytona_sdk/types.py b/packages/python/src/daytona_sdk/types.py new file mode 100644 index 0000000..995603d --- /dev/null +++ b/packages/python/src/daytona_sdk/types.py @@ -0,0 +1,7 @@ +from typing import Protocol +from api_client import Workspace as WorkspaceInstance, WorkspaceToolboxApi + + +class WorkspaceCodeToolbox(Protocol): + def get_default_image(self) -> str: ... + def get_run_command(self, code: str) -> str: ... diff --git a/packages/python/src/daytona_sdk/workspace.py b/packages/python/src/daytona_sdk/workspace.py new file mode 100644 index 0000000..e424450 --- /dev/null +++ b/packages/python/src/daytona_sdk/workspace.py @@ -0,0 +1,37 @@ +import asyncio +from .filesystem import FileSystem +from .git import Git +from .process import Process +from .lsp_server import LspServer, LspLanguageId +from api_client import Workspace as WorkspaceInstance, WorkspaceToolboxApi +from .code_toolbox.workspace_python_code_toolbox import WorkspaceCodeToolbox + + +class Workspace: + def __init__( + self, + id: str, + instance: WorkspaceInstance, + toolbox_api: WorkspaceToolboxApi, + code_toolbox: WorkspaceCodeToolbox, + ): + self.id = id + self.instance = instance + self.toolbox_api = toolbox_api + self.code_toolbox = code_toolbox + + # Initialize components + self.fs = FileSystem(instance, self.toolbox_api) + self.git = Git(self, self.toolbox_api, instance) + self.process = Process(self.code_toolbox, self.toolbox_api, instance) + + def get_workspace_root_dir(self) -> str: + response = self.toolbox_api.get_project_dir( + workspace_id=self.instance.id, project_id="main" + ) + return response.dir + + def create_lsp_server( + self, language_id: LspLanguageId, path_to_project: str + ) -> LspServer: + return LspServer(language_id, path_to_project, self.toolbox_api, self.instance) diff --git a/packages/typescript/LICENCE b/packages/typescript/LICENCE new file mode 100644 index 0000000..c44b766 --- /dev/null +++ b/packages/typescript/LICENCE @@ -0,0 +1,43 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship \ No newline at end of file diff --git a/packages/typescript/README.md b/packages/typescript/README.md new file mode 100644 index 0000000..99eb0b7 --- /dev/null +++ b/packages/typescript/README.md @@ -0,0 +1,181 @@ +# Daytona SDK for TypeScript + +A TypeScript SDK for interacting with Daytona Server API, providing a simple interface for Daytona Workspace management, Git operations, file system operations, and language server protocol support. + +## Prerequisites + +Before using the Daytona SDK, you need to have a running Daytona server instance and proper configuration. + +### Server Installation + +For detailed instructions on installing and setting up the Daytona server, please refer to the official installation guide at: +[https://github.com/daytonaio/daytona](https://github.com/daytonaio/daytona) + +### Configuration + +To use the SDK, you'll need two essential pieces of information: + +1. **Server Address**: + + - Run `daytona server config` to get your server's configuration + - Look for the `API URL` value in the output + - For testing and development, you can use the FRP address provided + - For production environments, it's recommended to use a static address + +2. **API Key**: + - Generate a new API key by running: + ```bash + daytona api-key generate + ``` + - Save this key securely as it will be needed to authenticate with the server + +## Installation + +You can install the package using npm: + +```bash +npm install @daytona/sdk +``` + +Or using yarn: + +```bash +yarn add @daytona/sdk +``` + +## Quick Start + +Here's a simple example of using the SDK: + +```typescript +import { Daytona } from '@daytona/sdk' + +// Initialize the Daytona client +const daytona = new Daytona() + +// Create the workspace instance +const workspace = await daytona.create({ + language: 'typescript', +}) + +// Run the code securely inside the workspace +const response = await workspace.process.code_run('console.log("Hello World!")') +console.log(response.result) +``` + +## Features + +- **Workspace Management**: Create, manage and remove workspaces +- **Git Operations**: Clone repositories, manage branches, and more +- **File System Operations**: Upload, download, search and manipulate files +- **Language Server Protocol**: Interact with language servers for code intelligence +- **Process Management**: Execute code and commands in workspaces + +## Configuration + +The SDK can be configured using environment variables or by passing a configuration object: + +```typescript +import { Daytona, DaytonaConfig } from '@daytona/sdk' + +const config: DaytonaConfig = { + apiKey: 'your-api-key', + serverUrl: 'https://your-daytona-server', + target: 'your-target', +} + +const daytona = new Daytona(config) +``` + +Or using environment variables: + +- `DAYTONA_API_KEY`: Your Daytona API key +- `DAYTONA_SERVER_URL`: The Daytona server URL +- `DAYTONA_TARGET`: Your target environment + +## Examples + +### Execute command + +```typescript +const response = await workspace.process.code_run( + 'print("Sum of 3 and 4 is " + str(3 + 4))', +) +if (response.code !== 0) { + console.log(`Error: ${response.code} ${response.result}`) +} else { + console.log(response.result) +} +``` + +### File Operations + +```typescript +// Upload a file +await workspace.fs.uploadFile('/path/to/file.txt', new Blob(['Hello, World!'])) + +// Download a file +const content = await workspace.fs.downloadFile('/path/to/file.txt') + +// Search for files +const matches = await workspace.fs.findFiles(root_dir, 'search_pattern') +``` + +### Git Operations + +```typescript +// Clone a repository +await workspace.git.clone('https://github.com/example/repo', '/path/to/clone') + +// List branches +const branches = await workspace.git.branches('/path/to/repo') + +// Add files +await workspace.git.add('/path/to/repo', ['file1.txt', 'file2.txt']) +``` + +### Language Server Protocol + +```typescript +// Create and start a language server +const lsp = workspace.createLspServer('typescript', '/path/to/project') +await lsp.start() + +// Notify the lsp for the file +await lsp.didOpen('/path/to/file.ts') + +// Get document symbols +const symbols = await lsp.documentSymbols('/path/to/file.ts') + +// Get completions +const completions = await lsp.completions('/path/to/file.ts', { + line: 10, + character: 15, +}) +``` + +## Contributing + +Contributions are welcome! Please feel free to submit a Pull Request. + +## License + +This project is licensed under the Apache License, Version 2.0 - see below for details: + +``` +Copyright 2024 Daytona + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +``` + +For the full license text, please see the [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0). diff --git a/packages/typescript/jest.config.js b/packages/typescript/jest.config.js new file mode 100644 index 0000000..5d9511d --- /dev/null +++ b/packages/typescript/jest.config.js @@ -0,0 +1,10 @@ +/** @type {import('ts-jest').JestConfigWithTsJest} */ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'node', + transform: { + '^.+\\.tsx?$': 'ts-jest', + }, + moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], + testMatch: ['**/__tests__/**/*.test.ts'], +}; \ No newline at end of file diff --git a/packages/typescript/package.json b/packages/typescript/package.json new file mode 100644 index 0000000..be751f5 --- /dev/null +++ b/packages/typescript/package.json @@ -0,0 +1,38 @@ +{ + "name": "@daytona/sdk", + "version": "0.1.3", + "description": "Daytona client library for AI Agents", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "repository": { + "type": "git", + "url": "git+https://github.com/daytonaio/daytona-client.git" + }, + "author": "", + "license": "MIT", + "bugs": { + "url": "https://github.com/daytonaio/daytona-client/issues" + }, + "homepage": "https://github.com/daytonaio/daytona-client#readme", + "scripts": { + "build": "tsc", + "test": "jest", + "prepare": "npm run build" + }, + "files": [ + "dist" + ], + "keywords": [], + "devDependencies": { + "@babel/preset-env": "^7.22.0", + "@babel/preset-typescript": "^7.22.0", + "@types/jest": "^29.5.0", + "@types/node": "^22.10.0", + "jest": "^29.5.0", + "ts-jest": "^29.1.0", + "typescript": "^5.0.0" + }, + "dependencies": { + "uuid": "^11.0.3" + } +} diff --git a/packages/typescript/src/Daytona.ts b/packages/typescript/src/Daytona.ts new file mode 100644 index 0000000..47d0bcd --- /dev/null +++ b/packages/typescript/src/Daytona.ts @@ -0,0 +1,134 @@ +import { v4 as uuidv4 } from 'uuid' + +import { WorkspacePythonCodeToolbox } from './code-toolbox/WorkspacePythonCodeToolbox' +import { Workspace } from './Workspace' +import { + Configuration, + WorkspaceApi, + GitProviderApi, + WorkspaceToolboxApi, + CreateProjectDTO, +} from './client' +import { WorkspaceTsCodeToolbox } from './code-toolbox/WorkspaceTsCodeToolbox' + +interface DaytonaConfig { + apiKey: string + serverUrl: string + target: string +} + +// type CodeLanguage = 'python' | 'javascript' | 'typescript' | 'java' | 'csharp' | 'go' | 'ruby' | 'php' | 'swift' | 'kotlin' | 'rust' | 'scala' | 'r' | 'perl' | 'bash' | 'powershell' | 'sql' | 'html' | 'css' | 'json' | 'yaml' | 'xml' | 'markdown' | 'plaintext' +type CodeLanguage = 'python' | 'javascript' | 'typescript' + +type CreateWorkspaceParams = { + id?: string + image?: string + language: CodeLanguage +} + +export class Daytona { + public readonly gitProviderApi: GitProviderApi + public readonly workspaceApi: WorkspaceApi + public readonly toolboxApi: WorkspaceToolboxApi + public readonly target: string + + private readonly apiKey: string + private readonly serverUrl: string + + constructor(config?: DaytonaConfig) { + const apiKey = config?.apiKey || process.env.DAYTONA_API_KEY + if (!apiKey) { + throw new Error('API key is required') + } + const serverUrl = config?.serverUrl || process.env.DAYTONA_SERVER_URL + if (!serverUrl) { + throw new Error('Server URL is required') + } + const target = config?.target || process.env.DAYTONA_TARGET || 'local' + + this.apiKey = apiKey + this.serverUrl = serverUrl + this.target = target + + const configuration = new Configuration({ + basePath: this.serverUrl, + // apiKey: this.apiKey, + headers: { + Authorization: `Bearer ${this.apiKey}`, + }, + }) + + this.gitProviderApi = new GitProviderApi(configuration) + this.workspaceApi = new WorkspaceApi(configuration) + this.toolboxApi = new WorkspaceToolboxApi(configuration) + } + + public async create(params?: CreateWorkspaceParams): Promise { + const workspaceId = params?.id || `sandbox-${uuidv4().slice(0, 8)}` + + const codeToolbox = (() => { + if (!params) { + // use python as default language + return new WorkspacePythonCodeToolbox() + } + switch (params?.language) { + case 'javascript': + case 'typescript': + return new WorkspaceTsCodeToolbox() + case 'python': + return new WorkspacePythonCodeToolbox() + default: + throw new Error(`Unsupported language: ${params?.language}`) + } + })() + + const projects: CreateProjectDTO[] = [ + { + name: 'main', + image: params?.image || codeToolbox.getDefaultImage(), + envVars: { + DAYTONA_SKIP_CLONE: 'true', + }, + source: { + // todo: remove when repo is not required + repository: { + branch: 'main', + cloneTarget: 'branch', + id: 'python-helloworld', + name: 'python-helloworld', + owner: 'dbarnett', + path: undefined, + prNumber: undefined, + sha: '288d7ced1b971fd1b3b0c36002b96e1c3f91542e', + source: 'github.com', + url: 'https://github.com/dbarnett/python-helloworld.git', + }, + }, + }, + ] + + const workspaceInstance = await this.workspaceApi.createWorkspace({ + workspace: { + id: workspaceId, + name: workspaceId, // todo: remove this after project refactor + projects, + target: this.target, + }, + }) + + const workspace = new Workspace( + workspaceId, + workspaceInstance, + this.toolboxApi, + codeToolbox, + ) + + return workspace + } + + public remove(workspace: Workspace) { + return this.workspaceApi.removeWorkspace({ + workspaceId: workspace.id, + }) + } +} diff --git a/packages/typescript/src/FileSystem.ts b/packages/typescript/src/FileSystem.ts new file mode 100644 index 0000000..9ef5b0c --- /dev/null +++ b/packages/typescript/src/FileSystem.ts @@ -0,0 +1,134 @@ +import { + FileInfo, + Match, + ReplaceRequest, + ReplaceResult, + SearchFilesResponse, + Workspace as WorkspaceInstance, + WorkspaceToolboxApi, +} from './client' + +type FilePermissionsParams = { + group?: string + mode?: string + owner?: string +} + +export class FileSystem { + constructor( + private readonly instance: WorkspaceInstance, + private readonly toolboxApi: WorkspaceToolboxApi, + ) {} + + public createFolder(path: string, mode: string): Promise { + return this.toolboxApi.fsCreateFolder({ + workspaceId: this.instance.id, + projectId: 'main', // todo: remove this after project refactor + path, + mode, + }) + } + + public deleteFile(path: string): Promise { + return this.toolboxApi.fsDeleteFile({ + workspaceId: this.instance.id, + projectId: 'main', // todo: remove this after project refactor + path, + }) + } + + public downloadFile(path: string): Promise { + return this.toolboxApi.fsDownloadFile({ + workspaceId: this.instance.id, + projectId: 'main', // todo: remove this after project refactor + path, + }) + } + + public findFiles(path: string, pattern: string): Promise> { + return this.toolboxApi.fsFindInFiles({ + workspaceId: this.instance.id, + projectId: 'main', // todo: remove this after project refactor + path, + pattern, + }) + } + + public getFileDetails(path: string): Promise { + return this.toolboxApi.fsGetFileDetails({ + workspaceId: this.instance.id, + projectId: 'main', // todo: remove this after project refactor + path, + }) + } + + public listFiles(path: string): Promise { + return this.toolboxApi.fsListFiles({ + workspaceId: this.instance.id, + projectId: 'main', // todo: remove this after project refactor + path, + }) + } + + public moveFiles(source: string, destination: string): Promise { + return this.toolboxApi.fsMoveFile({ + workspaceId: this.instance.id, + projectId: 'main', // todo: remove this after project refactor + source, + destination, + }) + } + + public replaceInFiles( + files: string[], + pattern: string, + newValue: string, + ): Promise> { + const ReplaceRequest: ReplaceRequest = { + files, + newValue, + pattern, + } + + return this.toolboxApi.fsReplaceInFiles({ + workspaceId: this.instance.id, + projectId: 'main', // todo: remove this after project refactor + replace: ReplaceRequest, + }) + } + + public searchFiles( + path: string, + pattern: string, + ): Promise { + return this.toolboxApi.fsSearchFiles({ + workspaceId: this.instance.id, + projectId: 'main', // todo: remove this after project refactor + path, + pattern, + }) + } + + public setFilePermissions( + path: string, + permissions: FilePermissionsParams, + ): Promise { + return this.toolboxApi.fsSetFilePermissions({ + workspaceId: this.instance.id, + projectId: 'main', // todo: remove this after project refactor + path, + group: permissions.group, + mode: permissions.mode, + owner: permissions.owner, + }) + } + + public uploadFile(path: string, file: Blob): Promise { + return this.toolboxApi.fsUploadFile({ + workspaceId: this.instance.id, + projectId: 'main', // todo: remove this after project refactor + path, + file, + }) + } +} diff --git a/packages/typescript/src/Git.ts b/packages/typescript/src/Git.ts new file mode 100644 index 0000000..8910628 --- /dev/null +++ b/packages/typescript/src/Git.ts @@ -0,0 +1,114 @@ +import { + GitStatus, + ListBranchResponse, + Match, + Workspace as WorkspaceInstance, + WorkspaceToolboxApi, +} from './client' +import { Workspace } from './Workspace' + +export class Git { + constructor( + private readonly workspace: Workspace, + private readonly toolboxApi: WorkspaceToolboxApi, + private readonly instance: WorkspaceInstance, + ) {} + public async add(path: string, files: string[]): Promise { + await this.toolboxApi.gitAddFiles({ + workspaceId: this.instance.id, + projectId: 'main', // todo: remove this after project refactor + params: { + path, + files, + }, + }) + } + + public async branches(path: string): Promise { + return await this.toolboxApi.gitBranchList({ + workspaceId: this.instance.id, + projectId: 'main', // todo: remove this after project refactor + path, + }) + } + + public async clone( + url: string, + path: string, + branch?: string, + commitId?: string, + username?: string, + password?: string, + ): Promise { + await this.toolboxApi.gitCloneRepository({ + workspaceId: this.instance.id, + projectId: 'main', // todo: remove this after project refactor + params: { + url: url, + branch: branch, + path, + username, + password, + commitId, + }, + }) + } + + public async commit( + path: string, + message: string, + author: string, + email: string, + ): Promise { + await this.toolboxApi.gitCommitChanges({ + workspaceId: this.instance.id, + projectId: 'main', // todo: remove this after project refactor + params: { + path, + message, + author, + email, + }, + }) + } + + public async push( + path: string, + username?: string, + password?: string, + ): Promise { + await this.toolboxApi.gitPushChanges({ + workspaceId: this.instance.id, + projectId: 'main', // todo: remove this after project refactor + params: { + path, + username, + password, + }, + }) + } + + public async pull( + path: string, + username?: string, + password?: string, + ): Promise { + await this.toolboxApi.gitPullChanges({ + workspaceId: this.instance.id, + projectId: 'main', // todo: remove this after project refactor + params: { + path, + username, + password, + }, + }) + } + + public async status(path: string): Promise { + return await this.toolboxApi.gitGitStatus({ + workspaceId: this.instance.id, + projectId: 'main', // todo: remove this after project refactor + path, + }) + } +} diff --git a/packages/typescript/src/LspServer.ts b/packages/typescript/src/LspServer.ts new file mode 100644 index 0000000..9b8b273 --- /dev/null +++ b/packages/typescript/src/LspServer.ts @@ -0,0 +1,103 @@ +import { + CompletionList, + LspSymbol, + Workspace as WorkspaceInstance, + WorkspaceToolboxApi, +} from './client' + +export type LspLanguageId = 'typescript' +export type Position = { + line: number + character: number +} + +export class LspServer { + constructor( + private readonly languageId: LspLanguageId, + private readonly pathToProject: string, + private readonly toolboxApi: WorkspaceToolboxApi, + private readonly instance: WorkspaceInstance, + ) {} + + public async start(): Promise { + return this.toolboxApi.lspStart({ + workspaceId: this.instance.id, + projectId: 'main', // todo: remove this after project refactor + params: { + languageId: this.languageId, + pathToProject: this.pathToProject, + }, + }) + } + + public async stop(): Promise { + return this.toolboxApi.lspStop({ + workspaceId: this.instance.id, + projectId: 'main', // todo: remove this after project refactor + params: { + languageId: this.languageId, + pathToProject: this.pathToProject, + }, + }) + } + + public async didOpen(path: string): Promise { + return this.toolboxApi.lspDidOpen({ + workspaceId: this.instance.id, + projectId: 'main', // todo: remove this after project refactor + params: { + languageId: this.languageId, + pathToProject: this.pathToProject, + uri: 'file://' + path, + }, + }) + } + + public async didClose(path: string): Promise { + return this.toolboxApi.lspDidClose({ + workspaceId: this.instance.id, + projectId: 'main', // todo: remove this after project refactor + params: { + languageId: this.languageId, + pathToProject: this.pathToProject, + uri: 'file://' + path, + }, + }) + } + + public async documentSymbols(path: string): Promise { + return this.toolboxApi.lspDocumentSymbols({ + workspaceId: this.instance.id, + projectId: 'main', // todo: remove this after project refactor + languageId: this.languageId, + pathToProject: this.pathToProject, + uri: 'file://' + path, + }) + } + + public async workspaceSymbols(query: string): Promise { + return this.toolboxApi.lspWorkspaceSymbols({ + workspaceId: this.instance.id, + projectId: 'main', // todo: remove this after project refactor + languageId: this.languageId, + pathToProject: this.pathToProject, + query, + }) + } + + public async completions( + path: string, + position: Position, + ): Promise { + return this.toolboxApi.lspCompletions({ + workspaceId: this.instance.id, + projectId: 'main', // todo: remove this after project refactor + params: { + languageId: this.languageId, + pathToProject: this.pathToProject, + uri: 'file://' + path, + position, + }, + }) + } +} diff --git a/packages/typescript/src/Process.ts b/packages/typescript/src/Process.ts new file mode 100644 index 0000000..7fda63e --- /dev/null +++ b/packages/typescript/src/Process.ts @@ -0,0 +1,38 @@ +import { + ExecuteResponse, + Workspace as WorkspaceInstance, + WorkspaceToolboxApi, +} from './client' +import { WorkspaceCodeToolbox } from './Workspace' + +export class Process { + constructor( + private readonly codeToolbox: WorkspaceCodeToolbox, + private readonly toolboxApi: WorkspaceToolboxApi, + private readonly instance: WorkspaceInstance, + ) {} + + public async processExecuteCommand( + command: string, + ): Promise { + return this.toolboxApi.processExecuteCommand({ + workspaceId: this.instance.id, + projectId: 'main', // todo: remove this after project refactor + params: { + command, + }, + }) + } + + public codeRun(code: string): Promise { + const runCommand = this.codeToolbox.getRunCommand(code) + + return this.toolboxApi.processExecuteCommand({ + workspaceId: this.instance.id, + projectId: 'main', // todo: remove this after project refactor + params: { + command: runCommand, + }, + }) + } +} diff --git a/packages/typescript/src/Workspace.ts b/packages/typescript/src/Workspace.ts new file mode 100644 index 0000000..a319386 --- /dev/null +++ b/packages/typescript/src/Workspace.ts @@ -0,0 +1,47 @@ +import { Workspace as WorkspaceInstance, WorkspaceToolboxApi } from './client' +import { FileSystem } from './FileSystem' +import { Git } from './Git' +import { LspLanguageId, LspServer } from './LspServer' +import { Process } from './Process' + +export interface WorkspaceCodeToolbox { + getDefaultImage(): string + getRunCommand(code: string): string +} + +export class Workspace { + public readonly fs: FileSystem + public readonly git: Git + public readonly process: Process + + constructor( + public readonly id: string, + private readonly instance: WorkspaceInstance, + public readonly toolboxApi: WorkspaceToolboxApi, + private readonly codeToolbox: WorkspaceCodeToolbox, + ) { + this.fs = new FileSystem(instance, this.toolboxApi) + this.git = new Git(this, this.toolboxApi, instance) + this.process = new Process(this.codeToolbox, this.toolboxApi, instance) + } + + public async getWorkspaceRootDir(): Promise { + const response = await this.toolboxApi.getProjectDir({ + workspaceId: this.instance.id, + projectId: 'main', // todo: remove this after project refactor + }) + return response.dir! + } + + public createLspServer( + languageId: LspLanguageId, + pathToProject: string, + ): LspServer { + return new LspServer( + languageId, + pathToProject, + this.toolboxApi, + this.instance, + ) + } +} diff --git a/packages/typescript/src/__tests__/index.test.ts b/packages/typescript/src/__tests__/index.test.ts new file mode 100644 index 0000000..109499a --- /dev/null +++ b/packages/typescript/src/__tests__/index.test.ts @@ -0,0 +1,31 @@ +import { Daytona } from '../index' + +describe('Daytona', () => { + const validConfig = { + apiKey: 'test-api-key', + serverUrl: 'https://api.example.com', + } + + it('should create an instance with valid config', () => { + const client = new Daytona(validConfig) + expect(client).toBeInstanceOf(Daytona) + }) + + it('should throw error when apiKey is missing', () => { + expect(() => { + new Daytona({ + ...validConfig, + apiKey: '', + }) + }).toThrow('API key is required') + }) + + it('should throw error when serverUrl is missing', () => { + expect(() => { + new Daytona({ + ...validConfig, + serverUrl: '', + }) + }).toThrow('Server URL is required') + }) +}) diff --git a/packages/typescript/src/client/.openapi-generator-ignore b/packages/typescript/src/client/.openapi-generator-ignore new file mode 100644 index 0000000..97a5567 --- /dev/null +++ b/packages/typescript/src/client/.openapi-generator-ignore @@ -0,0 +1,28 @@ +# 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 +git_push.sh +.travis.yml +go.mod +go.sum +test/* diff --git a/packages/typescript/src/client/.openapi-generator/FILES b/packages/typescript/src/client/.openapi-generator/FILES new file mode 100644 index 0000000..a8c4f31 --- /dev/null +++ b/packages/typescript/src/client/.openapi-generator/FILES @@ -0,0 +1,97 @@ +apis/ApiKeyApi.ts +apis/BuildApi.ts +apis/ContainerRegistryApi.ts +apis/DefaultApi.ts +apis/GitProviderApi.ts +apis/PrebuildApi.ts +apis/ProfileApi.ts +apis/ProjectConfigApi.ts +apis/ProviderApi.ts +apis/SampleApi.ts +apis/ServerApi.ts +apis/TargetApi.ts +apis/WorkspaceApi.ts +apis/WorkspaceToolboxApi.ts +apis/index.ts +index.ts +models/ApiKey.ts +models/ApikeyApiKeyType.ts +models/Build.ts +models/BuildBuildState.ts +models/BuildConfig.ts +models/CachedBuild.ts +models/CloneTarget.ts +models/CompletionContext.ts +models/CompletionItem.ts +models/CompletionList.ts +models/ContainerConfig.ts +models/ContainerRegistry.ts +models/CreateBuildDTO.ts +models/CreatePrebuildDTO.ts +models/CreateProjectConfigDTO.ts +models/CreateProjectDTO.ts +models/CreateProjectSourceDTO.ts +models/CreateProviderTargetDTO.ts +models/CreateWorkspaceDTO.ts +models/DevcontainerConfig.ts +models/ExecuteRequest.ts +models/ExecuteResponse.ts +models/FRPSConfig.ts +models/FileInfo.ts +models/FileStatus.ts +models/GetRepositoryContext.ts +models/GitAddRequest.ts +models/GitBranch.ts +models/GitBranchRequest.ts +models/GitCloneRequest.ts +models/GitCommitInfo.ts +models/GitCommitRequest.ts +models/GitCommitResponse.ts +models/GitNamespace.ts +models/GitProvider.ts +models/GitPullRequest.ts +models/GitRepoRequest.ts +models/GitRepository.ts +models/GitStatus.ts +models/GitUser.ts +models/InstallProviderRequest.ts +models/ListBranchResponse.ts +models/LogFileConfig.ts +models/LspCompletionParams.ts +models/LspDocumentRequest.ts +models/LspLocation.ts +models/LspPosition.ts +models/LspRange.ts +models/LspServerRequest.ts +models/LspSymbol.ts +models/Match.ts +models/NetworkKey.ts +models/Position.ts +models/PrebuildConfig.ts +models/PrebuildDTO.ts +models/ProfileData.ts +models/Project.ts +models/ProjectConfig.ts +models/ProjectDirResponse.ts +models/ProjectInfo.ts +models/ProjectState.ts +models/Provider.ts +models/ProviderProviderInfo.ts +models/ProviderProviderTargetProperty.ts +models/ProviderProviderTargetPropertyType.ts +models/ProviderTarget.ts +models/ReplaceRequest.ts +models/ReplaceResult.ts +models/RepositoryUrl.ts +models/Sample.ts +models/SearchFilesResponse.ts +models/ServerConfig.ts +models/SetGitProviderConfig.ts +models/SetProjectState.ts +models/SigningMethod.ts +models/Status.ts +models/Workspace.ts +models/WorkspaceDTO.ts +models/WorkspaceInfo.ts +models/index.ts +runtime.ts diff --git a/packages/typescript/src/client/.openapi-generator/VERSION b/packages/typescript/src/client/.openapi-generator/VERSION new file mode 100644 index 0000000..758bb9c --- /dev/null +++ b/packages/typescript/src/client/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.10.0 diff --git a/packages/typescript/src/client/apis/ApiKeyApi.ts b/packages/typescript/src/client/apis/ApiKeyApi.ts new file mode 100644 index 0000000..7a818d5 --- /dev/null +++ b/packages/typescript/src/client/apis/ApiKeyApi.ts @@ -0,0 +1,185 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime' +import type { ApiKey } from '../models/index' +import { ApiKeyFromJSON, ApiKeyToJSON } from '../models/index' + +export interface GenerateApiKeyRequest { + apiKeyName: string +} + +export interface RevokeApiKeyRequest { + apiKeyName: string +} + +/** + * + */ +export class ApiKeyApi extends runtime.BaseAPI { + /** + * Generate an API key + * Generate an API key + */ + async generateApiKeyRaw( + requestParameters: GenerateApiKeyRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['apiKeyName'] == null) { + throw new runtime.RequiredError( + 'apiKeyName', + 'Required parameter "apiKeyName" was null or undefined when calling generateApiKey().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/apikey/{apiKeyName}`.replace( + `{${'apiKeyName'}}`, + encodeURIComponent(String(requestParameters['apiKeyName'])), + ), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response) + } else { + return new runtime.TextApiResponse(response) as any + } + } + + /** + * Generate an API key + * Generate an API key + */ + async generateApiKey( + requestParameters: GenerateApiKeyRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.generateApiKeyRaw( + requestParameters, + initOverrides, + ) + return await response.value() + } + + /** + * List API keys + * List API keys + */ + async listClientApiKeysRaw( + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise>> { + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/apikey`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + jsonValue.map(ApiKeyFromJSON), + ) + } + + /** + * List API keys + * List API keys + */ + async listClientApiKeys( + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const response = await this.listClientApiKeysRaw(initOverrides) + return await response.value() + } + + /** + * Revoke API key + * Revoke API key + */ + async revokeApiKeyRaw( + requestParameters: RevokeApiKeyRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['apiKeyName'] == null) { + throw new runtime.RequiredError( + 'apiKeyName', + 'Required parameter "apiKeyName" was null or undefined when calling revokeApiKey().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/apikey/{apiKeyName}`.replace( + `{${'apiKeyName'}}`, + encodeURIComponent(String(requestParameters['apiKeyName'])), + ), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Revoke API key + * Revoke API key + */ + async revokeApiKey( + requestParameters: RevokeApiKeyRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.revokeApiKeyRaw(requestParameters, initOverrides) + } +} diff --git a/packages/typescript/src/client/apis/BuildApi.ts b/packages/typescript/src/client/apis/BuildApi.ts new file mode 100644 index 0000000..cd64de3 --- /dev/null +++ b/packages/typescript/src/client/apis/BuildApi.ts @@ -0,0 +1,362 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime' +import type { Build, CreateBuildDTO } from '../models/index' +import { + BuildFromJSON, + BuildToJSON, + CreateBuildDTOFromJSON, + CreateBuildDTOToJSON, +} from '../models/index' + +export interface CreateBuildRequest { + createBuildDto: CreateBuildDTO +} + +export interface DeleteAllBuildsRequest { + force?: boolean +} + +export interface DeleteBuildRequest { + buildId: string + force?: boolean +} + +export interface DeleteBuildsFromPrebuildRequest { + prebuildId: string + force?: boolean +} + +export interface GetBuildRequest { + buildId: string +} + +/** + * + */ +export class BuildApi extends runtime.BaseAPI { + /** + * Create a build + * Create a build + */ + async createBuildRaw( + requestParameters: CreateBuildRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['createBuildDto'] == null) { + throw new runtime.RequiredError( + 'createBuildDto', + 'Required parameter "createBuildDto" was null or undefined when calling createBuild().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + headerParameters['Content-Type'] = 'application/json' + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/build`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CreateBuildDTOToJSON(requestParameters['createBuildDto']), + }, + initOverrides, + ) + + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response) + } else { + return new runtime.TextApiResponse(response) as any + } + } + + /** + * Create a build + * Create a build + */ + async createBuild( + requestParameters: CreateBuildRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.createBuildRaw(requestParameters, initOverrides) + return await response.value() + } + + /** + * Delete ALL builds + * Delete ALL builds + */ + async deleteAllBuildsRaw( + requestParameters: DeleteAllBuildsRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const queryParameters: any = {} + + if (requestParameters['force'] != null) { + queryParameters['force'] = requestParameters['force'] + } + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/build`, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Delete ALL builds + * Delete ALL builds + */ + async deleteAllBuilds( + requestParameters: DeleteAllBuildsRequest = {}, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.deleteAllBuildsRaw(requestParameters, initOverrides) + } + + /** + * Delete build + * Delete build + */ + async deleteBuildRaw( + requestParameters: DeleteBuildRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['buildId'] == null) { + throw new runtime.RequiredError( + 'buildId', + 'Required parameter "buildId" was null or undefined when calling deleteBuild().', + ) + } + + const queryParameters: any = {} + + if (requestParameters['force'] != null) { + queryParameters['force'] = requestParameters['force'] + } + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/build/{buildId}`.replace( + `{${'buildId'}}`, + encodeURIComponent(String(requestParameters['buildId'])), + ), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Delete build + * Delete build + */ + async deleteBuild( + requestParameters: DeleteBuildRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.deleteBuildRaw(requestParameters, initOverrides) + } + + /** + * Delete builds + * Delete builds + */ + async deleteBuildsFromPrebuildRaw( + requestParameters: DeleteBuildsFromPrebuildRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['prebuildId'] == null) { + throw new runtime.RequiredError( + 'prebuildId', + 'Required parameter "prebuildId" was null or undefined when calling deleteBuildsFromPrebuild().', + ) + } + + const queryParameters: any = {} + + if (requestParameters['force'] != null) { + queryParameters['force'] = requestParameters['force'] + } + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/build/prebuild/{prebuildId}`.replace( + `{${'prebuildId'}}`, + encodeURIComponent(String(requestParameters['prebuildId'])), + ), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Delete builds + * Delete builds + */ + async deleteBuildsFromPrebuild( + requestParameters: DeleteBuildsFromPrebuildRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.deleteBuildsFromPrebuildRaw(requestParameters, initOverrides) + } + + /** + * Get build data + * Get build data + */ + async getBuildRaw( + requestParameters: GetBuildRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['buildId'] == null) { + throw new runtime.RequiredError( + 'buildId', + 'Required parameter "buildId" was null or undefined when calling getBuild().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/build/{buildId}`.replace( + `{${'buildId'}}`, + encodeURIComponent(String(requestParameters['buildId'])), + ), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + BuildFromJSON(jsonValue), + ) + } + + /** + * Get build data + * Get build data + */ + async getBuild( + requestParameters: GetBuildRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.getBuildRaw(requestParameters, initOverrides) + return await response.value() + } + + /** + * List builds + * List builds + */ + async listBuildsRaw( + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise>> { + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/build`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + jsonValue.map(BuildFromJSON), + ) + } + + /** + * List builds + * List builds + */ + async listBuilds( + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const response = await this.listBuildsRaw(initOverrides) + return await response.value() + } +} diff --git a/packages/typescript/src/client/apis/ContainerRegistryApi.ts b/packages/typescript/src/client/apis/ContainerRegistryApi.ts new file mode 100644 index 0000000..198b4c5 --- /dev/null +++ b/packages/typescript/src/client/apis/ContainerRegistryApi.ts @@ -0,0 +1,253 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime' +import type { ContainerRegistry } from '../models/index' +import { + ContainerRegistryFromJSON, + ContainerRegistryToJSON, +} from '../models/index' + +export interface GetContainerRegistryRequest { + server: string +} + +export interface RemoveContainerRegistryRequest { + server: string +} + +export interface SetContainerRegistryRequest { + server: string + containerRegistry: ContainerRegistry +} + +/** + * + */ +export class ContainerRegistryApi extends runtime.BaseAPI { + /** + * Get container registry credentials + * Get container registry credentials + */ + async getContainerRegistryRaw( + requestParameters: GetContainerRegistryRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['server'] == null) { + throw new runtime.RequiredError( + 'server', + 'Required parameter "server" was null or undefined when calling getContainerRegistry().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/container-registry/{server}`.replace( + `{${'server'}}`, + encodeURIComponent(String(requestParameters['server'])), + ), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + ContainerRegistryFromJSON(jsonValue), + ) + } + + /** + * Get container registry credentials + * Get container registry credentials + */ + async getContainerRegistry( + requestParameters: GetContainerRegistryRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.getContainerRegistryRaw( + requestParameters, + initOverrides, + ) + return await response.value() + } + + /** + * List container registries + * List container registries + */ + async listContainerRegistriesRaw( + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise>> { + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/container-registry`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + jsonValue.map(ContainerRegistryFromJSON), + ) + } + + /** + * List container registries + * List container registries + */ + async listContainerRegistries( + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const response = await this.listContainerRegistriesRaw(initOverrides) + return await response.value() + } + + /** + * Remove a container registry credentials + * Remove a container registry credentials + */ + async removeContainerRegistryRaw( + requestParameters: RemoveContainerRegistryRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['server'] == null) { + throw new runtime.RequiredError( + 'server', + 'Required parameter "server" was null or undefined when calling removeContainerRegistry().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/container-registry/{server}`.replace( + `{${'server'}}`, + encodeURIComponent(String(requestParameters['server'])), + ), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Remove a container registry credentials + * Remove a container registry credentials + */ + async removeContainerRegistry( + requestParameters: RemoveContainerRegistryRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.removeContainerRegistryRaw(requestParameters, initOverrides) + } + + /** + * Set container registry credentials + * Set container registry credentials + */ + async setContainerRegistryRaw( + requestParameters: SetContainerRegistryRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['server'] == null) { + throw new runtime.RequiredError( + 'server', + 'Required parameter "server" was null or undefined when calling setContainerRegistry().', + ) + } + + if (requestParameters['containerRegistry'] == null) { + throw new runtime.RequiredError( + 'containerRegistry', + 'Required parameter "containerRegistry" was null or undefined when calling setContainerRegistry().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + headerParameters['Content-Type'] = 'application/json' + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/container-registry/{server}`.replace( + `{${'server'}}`, + encodeURIComponent(String(requestParameters['server'])), + ), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: ContainerRegistryToJSON(requestParameters['containerRegistry']), + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Set container registry credentials + * Set container registry credentials + */ + async setContainerRegistry( + requestParameters: SetContainerRegistryRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.setContainerRegistryRaw(requestParameters, initOverrides) + } +} diff --git a/packages/typescript/src/client/apis/DefaultApi.ts b/packages/typescript/src/client/apis/DefaultApi.ts new file mode 100644 index 0000000..7b2fcb4 --- /dev/null +++ b/packages/typescript/src/client/apis/DefaultApi.ts @@ -0,0 +1,61 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime' + +/** + * + */ +export class DefaultApi extends runtime.BaseAPI { + /** + * Health check + * Health check + */ + async healthCheckRaw( + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/health`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response) + } + + /** + * Health check + * Health check + */ + async healthCheck( + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise<{ [key: string]: string }> { + const response = await this.healthCheckRaw(initOverrides) + return await response.value() + } +} diff --git a/packages/typescript/src/client/apis/GitProviderApi.ts b/packages/typescript/src/client/apis/GitProviderApi.ts new file mode 100644 index 0000000..1171daf --- /dev/null +++ b/packages/typescript/src/client/apis/GitProviderApi.ts @@ -0,0 +1,927 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime' +import type { + GetRepositoryContext, + GitBranch, + GitNamespace, + GitProvider, + GitPullRequest, + GitRepository, + GitUser, + RepositoryUrl, + SetGitProviderConfig, +} from '../models/index' +import { + GetRepositoryContextFromJSON, + GetRepositoryContextToJSON, + GitBranchFromJSON, + GitBranchToJSON, + GitNamespaceFromJSON, + GitNamespaceToJSON, + GitProviderFromJSON, + GitProviderToJSON, + GitPullRequestFromJSON, + GitPullRequestToJSON, + GitRepositoryFromJSON, + GitRepositoryToJSON, + GitUserFromJSON, + GitUserToJSON, + RepositoryUrlFromJSON, + RepositoryUrlToJSON, + SetGitProviderConfigFromJSON, + SetGitProviderConfigToJSON, +} from '../models/index' + +export interface GetGitContextRequest { + repository: GetRepositoryContext +} + +export interface GetGitProviderRequest { + gitProviderId: string +} + +export interface GetGitProviderIdForUrlRequest { + url: string +} + +export interface GetGitUserRequest { + gitProviderId: string +} + +export interface GetNamespacesRequest { + gitProviderId: string + page?: number + perPage?: number +} + +export interface GetRepoBranchesRequest { + gitProviderId: string + namespaceId: string + repositoryId: string + page?: number + perPage?: number +} + +export interface GetRepoPRsRequest { + gitProviderId: string + namespaceId: string + repositoryId: string + page?: number + perPage?: number +} + +export interface GetRepositoriesRequest { + gitProviderId: string + namespaceId: string + page?: number + perPage?: number +} + +export interface GetUrlFromRepositoryRequest { + repository: GitRepository +} + +export interface ListGitProvidersForUrlRequest { + url: string +} + +export interface RemoveGitProviderRequest { + gitProviderId: string +} + +export interface SetGitProviderRequest { + gitProviderConfig: SetGitProviderConfig +} + +/** + * + */ +export class GitProviderApi extends runtime.BaseAPI { + /** + * Get Git context + * Get Git context + */ + async getGitContextRaw( + requestParameters: GetGitContextRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['repository'] == null) { + throw new runtime.RequiredError( + 'repository', + 'Required parameter "repository" was null or undefined when calling getGitContext().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + headerParameters['Content-Type'] = 'application/json' + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/gitprovider/context`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: GetRepositoryContextToJSON(requestParameters['repository']), + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + GitRepositoryFromJSON(jsonValue), + ) + } + + /** + * Get Git context + * Get Git context + */ + async getGitContext( + requestParameters: GetGitContextRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.getGitContextRaw( + requestParameters, + initOverrides, + ) + return await response.value() + } + + /** + * Get Git provider + * Get Git provider + */ + async getGitProviderRaw( + requestParameters: GetGitProviderRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['gitProviderId'] == null) { + throw new runtime.RequiredError( + 'gitProviderId', + 'Required parameter "gitProviderId" was null or undefined when calling getGitProvider().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/gitprovider/{gitProviderId}`.replace( + `{${'gitProviderId'}}`, + encodeURIComponent(String(requestParameters['gitProviderId'])), + ), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + GitProviderFromJSON(jsonValue), + ) + } + + /** + * Get Git provider + * Get Git provider + */ + async getGitProvider( + requestParameters: GetGitProviderRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.getGitProviderRaw( + requestParameters, + initOverrides, + ) + return await response.value() + } + + /** + * Get Git provider ID + * Get Git provider ID + */ + async getGitProviderIdForUrlRaw( + requestParameters: GetGitProviderIdForUrlRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['url'] == null) { + throw new runtime.RequiredError( + 'url', + 'Required parameter "url" was null or undefined when calling getGitProviderIdForUrl().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/gitprovider/id-for-url/{url}`.replace( + `{${'url'}}`, + encodeURIComponent(String(requestParameters['url'])), + ), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response) + } else { + return new runtime.TextApiResponse(response) as any + } + } + + /** + * Get Git provider ID + * Get Git provider ID + */ + async getGitProviderIdForUrl( + requestParameters: GetGitProviderIdForUrlRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.getGitProviderIdForUrlRaw( + requestParameters, + initOverrides, + ) + return await response.value() + } + + /** + * Get Git context + * Get Git context + */ + async getGitUserRaw( + requestParameters: GetGitUserRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['gitProviderId'] == null) { + throw new runtime.RequiredError( + 'gitProviderId', + 'Required parameter "gitProviderId" was null or undefined when calling getGitUser().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/gitprovider/{gitProviderId}/user`.replace( + `{${'gitProviderId'}}`, + encodeURIComponent(String(requestParameters['gitProviderId'])), + ), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + GitUserFromJSON(jsonValue), + ) + } + + /** + * Get Git context + * Get Git context + */ + async getGitUser( + requestParameters: GetGitUserRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.getGitUserRaw(requestParameters, initOverrides) + return await response.value() + } + + /** + * Get Git namespaces + * Get Git namespaces + */ + async getNamespacesRaw( + requestParameters: GetNamespacesRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise>> { + if (requestParameters['gitProviderId'] == null) { + throw new runtime.RequiredError( + 'gitProviderId', + 'Required parameter "gitProviderId" was null or undefined when calling getNamespaces().', + ) + } + + const queryParameters: any = {} + + if (requestParameters['page'] != null) { + queryParameters['page'] = requestParameters['page'] + } + + if (requestParameters['perPage'] != null) { + queryParameters['per_page'] = requestParameters['perPage'] + } + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/gitprovider/{gitProviderId}/namespaces`.replace( + `{${'gitProviderId'}}`, + encodeURIComponent(String(requestParameters['gitProviderId'])), + ), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + jsonValue.map(GitNamespaceFromJSON), + ) + } + + /** + * Get Git namespaces + * Get Git namespaces + */ + async getNamespaces( + requestParameters: GetNamespacesRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const response = await this.getNamespacesRaw( + requestParameters, + initOverrides, + ) + return await response.value() + } + + /** + * Get Git repository branches + * Get Git repository branches + */ + async getRepoBranchesRaw( + requestParameters: GetRepoBranchesRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise>> { + if (requestParameters['gitProviderId'] == null) { + throw new runtime.RequiredError( + 'gitProviderId', + 'Required parameter "gitProviderId" was null or undefined when calling getRepoBranches().', + ) + } + + if (requestParameters['namespaceId'] == null) { + throw new runtime.RequiredError( + 'namespaceId', + 'Required parameter "namespaceId" was null or undefined when calling getRepoBranches().', + ) + } + + if (requestParameters['repositoryId'] == null) { + throw new runtime.RequiredError( + 'repositoryId', + 'Required parameter "repositoryId" was null or undefined when calling getRepoBranches().', + ) + } + + const queryParameters: any = {} + + if (requestParameters['page'] != null) { + queryParameters['page'] = requestParameters['page'] + } + + if (requestParameters['perPage'] != null) { + queryParameters['per_page'] = requestParameters['perPage'] + } + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/gitprovider/{gitProviderId}/{namespaceId}/{repositoryId}/branches` + .replace( + `{${'gitProviderId'}}`, + encodeURIComponent(String(requestParameters['gitProviderId'])), + ) + .replace( + `{${'namespaceId'}}`, + encodeURIComponent(String(requestParameters['namespaceId'])), + ) + .replace( + `{${'repositoryId'}}`, + encodeURIComponent(String(requestParameters['repositoryId'])), + ), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + jsonValue.map(GitBranchFromJSON), + ) + } + + /** + * Get Git repository branches + * Get Git repository branches + */ + async getRepoBranches( + requestParameters: GetRepoBranchesRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const response = await this.getRepoBranchesRaw( + requestParameters, + initOverrides, + ) + return await response.value() + } + + /** + * Get Git repository PRs + * Get Git repository PRs + */ + async getRepoPRsRaw( + requestParameters: GetRepoPRsRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise>> { + if (requestParameters['gitProviderId'] == null) { + throw new runtime.RequiredError( + 'gitProviderId', + 'Required parameter "gitProviderId" was null or undefined when calling getRepoPRs().', + ) + } + + if (requestParameters['namespaceId'] == null) { + throw new runtime.RequiredError( + 'namespaceId', + 'Required parameter "namespaceId" was null or undefined when calling getRepoPRs().', + ) + } + + if (requestParameters['repositoryId'] == null) { + throw new runtime.RequiredError( + 'repositoryId', + 'Required parameter "repositoryId" was null or undefined when calling getRepoPRs().', + ) + } + + const queryParameters: any = {} + + if (requestParameters['page'] != null) { + queryParameters['page'] = requestParameters['page'] + } + + if (requestParameters['perPage'] != null) { + queryParameters['per_page'] = requestParameters['perPage'] + } + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/gitprovider/{gitProviderId}/{namespaceId}/{repositoryId}/pull-requests` + .replace( + `{${'gitProviderId'}}`, + encodeURIComponent(String(requestParameters['gitProviderId'])), + ) + .replace( + `{${'namespaceId'}}`, + encodeURIComponent(String(requestParameters['namespaceId'])), + ) + .replace( + `{${'repositoryId'}}`, + encodeURIComponent(String(requestParameters['repositoryId'])), + ), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + jsonValue.map(GitPullRequestFromJSON), + ) + } + + /** + * Get Git repository PRs + * Get Git repository PRs + */ + async getRepoPRs( + requestParameters: GetRepoPRsRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const response = await this.getRepoPRsRaw(requestParameters, initOverrides) + return await response.value() + } + + /** + * Get Git repositories + * Get Git repositories + */ + async getRepositoriesRaw( + requestParameters: GetRepositoriesRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise>> { + if (requestParameters['gitProviderId'] == null) { + throw new runtime.RequiredError( + 'gitProviderId', + 'Required parameter "gitProviderId" was null or undefined when calling getRepositories().', + ) + } + + if (requestParameters['namespaceId'] == null) { + throw new runtime.RequiredError( + 'namespaceId', + 'Required parameter "namespaceId" was null or undefined when calling getRepositories().', + ) + } + + const queryParameters: any = {} + + if (requestParameters['page'] != null) { + queryParameters['page'] = requestParameters['page'] + } + + if (requestParameters['perPage'] != null) { + queryParameters['per_page'] = requestParameters['perPage'] + } + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/gitprovider/{gitProviderId}/{namespaceId}/repositories` + .replace( + `{${'gitProviderId'}}`, + encodeURIComponent(String(requestParameters['gitProviderId'])), + ) + .replace( + `{${'namespaceId'}}`, + encodeURIComponent(String(requestParameters['namespaceId'])), + ), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + jsonValue.map(GitRepositoryFromJSON), + ) + } + + /** + * Get Git repositories + * Get Git repositories + */ + async getRepositories( + requestParameters: GetRepositoriesRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const response = await this.getRepositoriesRaw( + requestParameters, + initOverrides, + ) + return await response.value() + } + + /** + * Get URL from Git repository + * Get URL from Git repository + */ + async getUrlFromRepositoryRaw( + requestParameters: GetUrlFromRepositoryRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['repository'] == null) { + throw new runtime.RequiredError( + 'repository', + 'Required parameter "repository" was null or undefined when calling getUrlFromRepository().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + headerParameters['Content-Type'] = 'application/json' + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/gitprovider/context/url`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: GitRepositoryToJSON(requestParameters['repository']), + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + RepositoryUrlFromJSON(jsonValue), + ) + } + + /** + * Get URL from Git repository + * Get URL from Git repository + */ + async getUrlFromRepository( + requestParameters: GetUrlFromRepositoryRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.getUrlFromRepositoryRaw( + requestParameters, + initOverrides, + ) + return await response.value() + } + + /** + * List Git providers + * List Git providers + */ + async listGitProvidersRaw( + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise>> { + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/gitprovider`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + jsonValue.map(GitProviderFromJSON), + ) + } + + /** + * List Git providers + * List Git providers + */ + async listGitProviders( + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const response = await this.listGitProvidersRaw(initOverrides) + return await response.value() + } + + /** + * List Git providers for url + * List Git providers for url + */ + async listGitProvidersForUrlRaw( + requestParameters: ListGitProvidersForUrlRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise>> { + if (requestParameters['url'] == null) { + throw new runtime.RequiredError( + 'url', + 'Required parameter "url" was null or undefined when calling listGitProvidersForUrl().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/gitprovider/for-url/{url}`.replace( + `{${'url'}}`, + encodeURIComponent(String(requestParameters['url'])), + ), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + jsonValue.map(GitProviderFromJSON), + ) + } + + /** + * List Git providers for url + * List Git providers for url + */ + async listGitProvidersForUrl( + requestParameters: ListGitProvidersForUrlRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const response = await this.listGitProvidersForUrlRaw( + requestParameters, + initOverrides, + ) + return await response.value() + } + + /** + * Remove Git provider + * Remove Git provider + */ + async removeGitProviderRaw( + requestParameters: RemoveGitProviderRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['gitProviderId'] == null) { + throw new runtime.RequiredError( + 'gitProviderId', + 'Required parameter "gitProviderId" was null or undefined when calling removeGitProvider().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/gitprovider/{gitProviderId}`.replace( + `{${'gitProviderId'}}`, + encodeURIComponent(String(requestParameters['gitProviderId'])), + ), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Remove Git provider + * Remove Git provider + */ + async removeGitProvider( + requestParameters: RemoveGitProviderRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.removeGitProviderRaw(requestParameters, initOverrides) + } + + /** + * Set Git provider + * Set Git provider + */ + async setGitProviderRaw( + requestParameters: SetGitProviderRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['gitProviderConfig'] == null) { + throw new runtime.RequiredError( + 'gitProviderConfig', + 'Required parameter "gitProviderConfig" was null or undefined when calling setGitProvider().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + headerParameters['Content-Type'] = 'application/json' + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/gitprovider`, + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: SetGitProviderConfigToJSON( + requestParameters['gitProviderConfig'], + ), + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Set Git provider + * Set Git provider + */ + async setGitProvider( + requestParameters: SetGitProviderRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.setGitProviderRaw(requestParameters, initOverrides) + } +} diff --git a/packages/typescript/src/client/apis/PrebuildApi.ts b/packages/typescript/src/client/apis/PrebuildApi.ts new file mode 100644 index 0000000..917b82c --- /dev/null +++ b/packages/typescript/src/client/apis/PrebuildApi.ts @@ -0,0 +1,406 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime' +import type { CreatePrebuildDTO, PrebuildDTO } from '../models/index' +import { + CreatePrebuildDTOFromJSON, + CreatePrebuildDTOToJSON, + PrebuildDTOFromJSON, + PrebuildDTOToJSON, +} from '../models/index' + +export interface DeletePrebuildRequest { + configName: string + prebuildId: string + force?: boolean +} + +export interface GetPrebuildRequest { + configName: string + prebuildId: string +} + +export interface ListPrebuildsForProjectConfigRequest { + configName: string +} + +export interface ProcessGitEventRequest { + workspace: object +} + +export interface SetPrebuildRequest { + configName: string + prebuild: CreatePrebuildDTO +} + +/** + * + */ +export class PrebuildApi extends runtime.BaseAPI { + /** + * Delete prebuild + * Delete prebuild + */ + async deletePrebuildRaw( + requestParameters: DeletePrebuildRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['configName'] == null) { + throw new runtime.RequiredError( + 'configName', + 'Required parameter "configName" was null or undefined when calling deletePrebuild().', + ) + } + + if (requestParameters['prebuildId'] == null) { + throw new runtime.RequiredError( + 'prebuildId', + 'Required parameter "prebuildId" was null or undefined when calling deletePrebuild().', + ) + } + + const queryParameters: any = {} + + if (requestParameters['force'] != null) { + queryParameters['force'] = requestParameters['force'] + } + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/project-config/{configName}/prebuild/{prebuildId}` + .replace( + `{${'configName'}}`, + encodeURIComponent(String(requestParameters['configName'])), + ) + .replace( + `{${'prebuildId'}}`, + encodeURIComponent(String(requestParameters['prebuildId'])), + ), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Delete prebuild + * Delete prebuild + */ + async deletePrebuild( + requestParameters: DeletePrebuildRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.deletePrebuildRaw(requestParameters, initOverrides) + } + + /** + * Get prebuild + * Get prebuild + */ + async getPrebuildRaw( + requestParameters: GetPrebuildRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['configName'] == null) { + throw new runtime.RequiredError( + 'configName', + 'Required parameter "configName" was null or undefined when calling getPrebuild().', + ) + } + + if (requestParameters['prebuildId'] == null) { + throw new runtime.RequiredError( + 'prebuildId', + 'Required parameter "prebuildId" was null or undefined when calling getPrebuild().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/project-config/{configName}/prebuild/{prebuildId}` + .replace( + `{${'configName'}}`, + encodeURIComponent(String(requestParameters['configName'])), + ) + .replace( + `{${'prebuildId'}}`, + encodeURIComponent(String(requestParameters['prebuildId'])), + ), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + PrebuildDTOFromJSON(jsonValue), + ) + } + + /** + * Get prebuild + * Get prebuild + */ + async getPrebuild( + requestParameters: GetPrebuildRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.getPrebuildRaw(requestParameters, initOverrides) + return await response.value() + } + + /** + * List prebuilds + * List prebuilds + */ + async listPrebuildsRaw( + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise>> { + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/project-config/prebuild`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + jsonValue.map(PrebuildDTOFromJSON), + ) + } + + /** + * List prebuilds + * List prebuilds + */ + async listPrebuilds( + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const response = await this.listPrebuildsRaw(initOverrides) + return await response.value() + } + + /** + * List prebuilds for project config + * List prebuilds for project config + */ + async listPrebuildsForProjectConfigRaw( + requestParameters: ListPrebuildsForProjectConfigRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise>> { + if (requestParameters['configName'] == null) { + throw new runtime.RequiredError( + 'configName', + 'Required parameter "configName" was null or undefined when calling listPrebuildsForProjectConfig().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/project-config/{configName}/prebuild`.replace( + `{${'configName'}}`, + encodeURIComponent(String(requestParameters['configName'])), + ), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + jsonValue.map(PrebuildDTOFromJSON), + ) + } + + /** + * List prebuilds for project config + * List prebuilds for project config + */ + async listPrebuildsForProjectConfig( + requestParameters: ListPrebuildsForProjectConfigRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const response = await this.listPrebuildsForProjectConfigRaw( + requestParameters, + initOverrides, + ) + return await response.value() + } + + /** + * ProcessGitEvent + * ProcessGitEvent + */ + async processGitEventRaw( + requestParameters: ProcessGitEventRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['workspace'] == null) { + throw new runtime.RequiredError( + 'workspace', + 'Required parameter "workspace" was null or undefined when calling processGitEvent().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + headerParameters['Content-Type'] = 'application/json' + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/project-config/prebuild/process-git-event`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters['workspace'] as any, + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * ProcessGitEvent + * ProcessGitEvent + */ + async processGitEvent( + requestParameters: ProcessGitEventRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.processGitEventRaw(requestParameters, initOverrides) + } + + /** + * Set prebuild + * Set prebuild + */ + async setPrebuildRaw( + requestParameters: SetPrebuildRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['configName'] == null) { + throw new runtime.RequiredError( + 'configName', + 'Required parameter "configName" was null or undefined when calling setPrebuild().', + ) + } + + if (requestParameters['prebuild'] == null) { + throw new runtime.RequiredError( + 'prebuild', + 'Required parameter "prebuild" was null or undefined when calling setPrebuild().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + headerParameters['Content-Type'] = 'application/json' + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/project-config/{configName}/prebuild`.replace( + `{${'configName'}}`, + encodeURIComponent(String(requestParameters['configName'])), + ), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: CreatePrebuildDTOToJSON(requestParameters['prebuild']), + }, + initOverrides, + ) + + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response) + } else { + return new runtime.TextApiResponse(response) as any + } + } + + /** + * Set prebuild + * Set prebuild + */ + async setPrebuild( + requestParameters: SetPrebuildRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.setPrebuildRaw(requestParameters, initOverrides) + return await response.value() + } +} diff --git a/packages/typescript/src/client/apis/ProfileApi.ts b/packages/typescript/src/client/apis/ProfileApi.ts new file mode 100644 index 0000000..07535f2 --- /dev/null +++ b/packages/typescript/src/client/apis/ProfileApi.ts @@ -0,0 +1,161 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime' +import type { ProfileData } from '../models/index' +import { ProfileDataFromJSON, ProfileDataToJSON } from '../models/index' + +export interface SetProfileDataRequest { + profileData: ProfileData +} + +/** + * + */ +export class ProfileApi extends runtime.BaseAPI { + /** + * Delete profile data + * Delete profile data + */ + async deleteProfileDataRaw( + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/profile`, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Delete profile data + * Delete profile data + */ + async deleteProfileData( + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.deleteProfileDataRaw(initOverrides) + } + + /** + * Get profile data + * Get profile data + */ + async getProfileDataRaw( + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/profile`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + ProfileDataFromJSON(jsonValue), + ) + } + + /** + * Get profile data + * Get profile data + */ + async getProfileData( + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.getProfileDataRaw(initOverrides) + return await response.value() + } + + /** + * Set profile data + * Set profile data + */ + async setProfileDataRaw( + requestParameters: SetProfileDataRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['profileData'] == null) { + throw new runtime.RequiredError( + 'profileData', + 'Required parameter "profileData" was null or undefined when calling setProfileData().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + headerParameters['Content-Type'] = 'application/json' + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/profile`, + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: ProfileDataToJSON(requestParameters['profileData']), + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Set profile data + * Set profile data + */ + async setProfileData( + requestParameters: SetProfileDataRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.setProfileDataRaw(requestParameters, initOverrides) + } +} diff --git a/packages/typescript/src/client/apis/ProjectConfigApi.ts b/packages/typescript/src/client/apis/ProjectConfigApi.ts new file mode 100644 index 0000000..ff5fe35 --- /dev/null +++ b/packages/typescript/src/client/apis/ProjectConfigApi.ts @@ -0,0 +1,367 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime' +import type { CreateProjectConfigDTO, ProjectConfig } from '../models/index' +import { + CreateProjectConfigDTOFromJSON, + CreateProjectConfigDTOToJSON, + ProjectConfigFromJSON, + ProjectConfigToJSON, +} from '../models/index' + +export interface DeleteProjectConfigRequest { + configName: string + force?: boolean +} + +export interface GetDefaultProjectConfigRequest { + gitUrl: string +} + +export interface GetProjectConfigRequest { + configName: string +} + +export interface SetDefaultProjectConfigRequest { + configName: string +} + +export interface SetProjectConfigRequest { + projectConfig: CreateProjectConfigDTO +} + +/** + * + */ +export class ProjectConfigApi extends runtime.BaseAPI { + /** + * Delete project config data + * Delete project config data + */ + async deleteProjectConfigRaw( + requestParameters: DeleteProjectConfigRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['configName'] == null) { + throw new runtime.RequiredError( + 'configName', + 'Required parameter "configName" was null or undefined when calling deleteProjectConfig().', + ) + } + + const queryParameters: any = {} + + if (requestParameters['force'] != null) { + queryParameters['force'] = requestParameters['force'] + } + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/project-config/{configName}`.replace( + `{${'configName'}}`, + encodeURIComponent(String(requestParameters['configName'])), + ), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Delete project config data + * Delete project config data + */ + async deleteProjectConfig( + requestParameters: DeleteProjectConfigRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.deleteProjectConfigRaw(requestParameters, initOverrides) + } + + /** + * Get project configs by git url + * Get project configs by git url + */ + async getDefaultProjectConfigRaw( + requestParameters: GetDefaultProjectConfigRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['gitUrl'] == null) { + throw new runtime.RequiredError( + 'gitUrl', + 'Required parameter "gitUrl" was null or undefined when calling getDefaultProjectConfig().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/project-config/default/{gitUrl}`.replace( + `{${'gitUrl'}}`, + encodeURIComponent(String(requestParameters['gitUrl'])), + ), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + ProjectConfigFromJSON(jsonValue), + ) + } + + /** + * Get project configs by git url + * Get project configs by git url + */ + async getDefaultProjectConfig( + requestParameters: GetDefaultProjectConfigRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.getDefaultProjectConfigRaw( + requestParameters, + initOverrides, + ) + return await response.value() + } + + /** + * Get project config data + * Get project config data + */ + async getProjectConfigRaw( + requestParameters: GetProjectConfigRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['configName'] == null) { + throw new runtime.RequiredError( + 'configName', + 'Required parameter "configName" was null or undefined when calling getProjectConfig().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/project-config/{configName}`.replace( + `{${'configName'}}`, + encodeURIComponent(String(requestParameters['configName'])), + ), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + ProjectConfigFromJSON(jsonValue), + ) + } + + /** + * Get project config data + * Get project config data + */ + async getProjectConfig( + requestParameters: GetProjectConfigRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.getProjectConfigRaw( + requestParameters, + initOverrides, + ) + return await response.value() + } + + /** + * List project configs + * List project configs + */ + async listProjectConfigsRaw( + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise>> { + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/project-config`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + jsonValue.map(ProjectConfigFromJSON), + ) + } + + /** + * List project configs + * List project configs + */ + async listProjectConfigs( + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const response = await this.listProjectConfigsRaw(initOverrides) + return await response.value() + } + + /** + * Set project config to default + * Set project config to default + */ + async setDefaultProjectConfigRaw( + requestParameters: SetDefaultProjectConfigRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['configName'] == null) { + throw new runtime.RequiredError( + 'configName', + 'Required parameter "configName" was null or undefined when calling setDefaultProjectConfig().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/project-config/{configName}/set-default`.replace( + `{${'configName'}}`, + encodeURIComponent(String(requestParameters['configName'])), + ), + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Set project config to default + * Set project config to default + */ + async setDefaultProjectConfig( + requestParameters: SetDefaultProjectConfigRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.setDefaultProjectConfigRaw(requestParameters, initOverrides) + } + + /** + * Set project config data + * Set project config data + */ + async setProjectConfigRaw( + requestParameters: SetProjectConfigRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['projectConfig'] == null) { + throw new runtime.RequiredError( + 'projectConfig', + 'Required parameter "projectConfig" was null or undefined when calling setProjectConfig().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + headerParameters['Content-Type'] = 'application/json' + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/project-config`, + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: CreateProjectConfigDTOToJSON(requestParameters['projectConfig']), + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Set project config data + * Set project config data + */ + async setProjectConfig( + requestParameters: SetProjectConfigRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.setProjectConfigRaw(requestParameters, initOverrides) + } +} diff --git a/packages/typescript/src/client/apis/ProviderApi.ts b/packages/typescript/src/client/apis/ProviderApi.ts new file mode 100644 index 0000000..35934c9 --- /dev/null +++ b/packages/typescript/src/client/apis/ProviderApi.ts @@ -0,0 +1,252 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime' +import type { + InstallProviderRequest, + Provider, + ProviderProviderTargetProperty, +} from '../models/index' +import { + InstallProviderRequestFromJSON, + InstallProviderRequestToJSON, + ProviderFromJSON, + ProviderToJSON, + ProviderProviderTargetPropertyFromJSON, + ProviderProviderTargetPropertyToJSON, +} from '../models/index' + +export interface GetTargetManifestRequest { + provider: string +} + +export interface InstallProviderOperationRequest { + provider: InstallProviderRequest +} + +export interface UninstallProviderRequest { + provider: string +} + +/** + * + */ +export class ProviderApi extends runtime.BaseAPI { + /** + * Get provider target manifest + * Get provider target manifest + */ + async getTargetManifestRaw( + requestParameters: GetTargetManifestRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise< + runtime.ApiResponse<{ [key: string]: ProviderProviderTargetProperty }> + > { + if (requestParameters['provider'] == null) { + throw new runtime.RequiredError( + 'provider', + 'Required parameter "provider" was null or undefined when calling getTargetManifest().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/provider/{provider}/target-manifest`.replace( + `{${'provider'}}`, + encodeURIComponent(String(requestParameters['provider'])), + ), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + runtime.mapValues(jsonValue, ProviderProviderTargetPropertyFromJSON), + ) + } + + /** + * Get provider target manifest + * Get provider target manifest + */ + async getTargetManifest( + requestParameters: GetTargetManifestRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise<{ [key: string]: ProviderProviderTargetProperty }> { + const response = await this.getTargetManifestRaw( + requestParameters, + initOverrides, + ) + return await response.value() + } + + /** + * Install a provider + * Install a provider + */ + async installProviderRaw( + requestParameters: InstallProviderOperationRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['provider'] == null) { + throw new runtime.RequiredError( + 'provider', + 'Required parameter "provider" was null or undefined when calling installProvider().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + headerParameters['Content-Type'] = 'application/json' + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/provider/install`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: InstallProviderRequestToJSON(requestParameters['provider']), + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Install a provider + * Install a provider + */ + async installProvider( + requestParameters: InstallProviderOperationRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.installProviderRaw(requestParameters, initOverrides) + } + + /** + * List providers + * List providers + */ + async listProvidersRaw( + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise>> { + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/provider`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + jsonValue.map(ProviderFromJSON), + ) + } + + /** + * List providers + * List providers + */ + async listProviders( + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const response = await this.listProvidersRaw(initOverrides) + return await response.value() + } + + /** + * Uninstall a provider + * Uninstall a provider + */ + async uninstallProviderRaw( + requestParameters: UninstallProviderRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['provider'] == null) { + throw new runtime.RequiredError( + 'provider', + 'Required parameter "provider" was null or undefined when calling uninstallProvider().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/provider/{provider}/uninstall`.replace( + `{${'provider'}}`, + encodeURIComponent(String(requestParameters['provider'])), + ), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Uninstall a provider + * Uninstall a provider + */ + async uninstallProvider( + requestParameters: UninstallProviderRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.uninstallProviderRaw(requestParameters, initOverrides) + } +} diff --git a/packages/typescript/src/client/apis/SampleApi.ts b/packages/typescript/src/client/apis/SampleApi.ts new file mode 100644 index 0000000..8ee6b3b --- /dev/null +++ b/packages/typescript/src/client/apis/SampleApi.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime' +import type { Sample } from '../models/index' +import { SampleFromJSON, SampleToJSON } from '../models/index' + +/** + * + */ +export class SampleApi extends runtime.BaseAPI { + /** + * List samples + * List samples + */ + async listSamplesRaw( + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise>> { + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/sample`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + jsonValue.map(SampleFromJSON), + ) + } + + /** + * List samples + * List samples + */ + async listSamples( + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const response = await this.listSamplesRaw(initOverrides) + return await response.value() + } +} diff --git a/packages/typescript/src/client/apis/ServerApi.ts b/packages/typescript/src/client/apis/ServerApi.ts new file mode 100644 index 0000000..1f3f853 --- /dev/null +++ b/packages/typescript/src/client/apis/ServerApi.ts @@ -0,0 +1,213 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime' +import type { NetworkKey, ServerConfig } from '../models/index' +import { + NetworkKeyFromJSON, + NetworkKeyToJSON, + ServerConfigFromJSON, + ServerConfigToJSON, +} from '../models/index' + +export interface SetConfigRequest { + config: ServerConfig +} + +/** + * + */ +export class ServerApi extends runtime.BaseAPI { + /** + * Generate a new authentication key + * Generate a new authentication key + */ + async generateNetworkKeyRaw( + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/server/network-key`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + NetworkKeyFromJSON(jsonValue), + ) + } + + /** + * Generate a new authentication key + * Generate a new authentication key + */ + async generateNetworkKey( + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.generateNetworkKeyRaw(initOverrides) + return await response.value() + } + + /** + * Get the server configuration + * Get the server configuration + */ + async getConfigRaw( + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/server/config`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + ServerConfigFromJSON(jsonValue), + ) + } + + /** + * Get the server configuration + * Get the server configuration + */ + async getConfig( + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.getConfigRaw(initOverrides) + return await response.value() + } + + /** + * List server log files + * List server log files + */ + async getServerLogFilesRaw( + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise>> { + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/server/logs`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response) + } + + /** + * List server log files + * List server log files + */ + async getServerLogFiles( + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const response = await this.getServerLogFilesRaw(initOverrides) + return await response.value() + } + + /** + * Set the server configuration + * Set the server configuration + */ + async setConfigRaw( + requestParameters: SetConfigRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['config'] == null) { + throw new runtime.RequiredError( + 'config', + 'Required parameter "config" was null or undefined when calling setConfig().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + headerParameters['Content-Type'] = 'application/json' + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/server/config`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: ServerConfigToJSON(requestParameters['config']), + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + ServerConfigFromJSON(jsonValue), + ) + } + + /** + * Set the server configuration + * Set the server configuration + */ + async setConfig( + requestParameters: SetConfigRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.setConfigRaw(requestParameters, initOverrides) + return await response.value() + } +} diff --git a/packages/typescript/src/client/apis/TargetApi.ts b/packages/typescript/src/client/apis/TargetApi.ts new file mode 100644 index 0000000..55de00c --- /dev/null +++ b/packages/typescript/src/client/apis/TargetApi.ts @@ -0,0 +1,238 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime' +import type { CreateProviderTargetDTO, ProviderTarget } from '../models/index' +import { + CreateProviderTargetDTOFromJSON, + CreateProviderTargetDTOToJSON, + ProviderTargetFromJSON, + ProviderTargetToJSON, +} from '../models/index' + +export interface RemoveTargetRequest { + target: string +} + +export interface SetDefaultTargetRequest { + target: string +} + +export interface SetTargetRequest { + target: CreateProviderTargetDTO +} + +/** + * + */ +export class TargetApi extends runtime.BaseAPI { + /** + * List targets + * List targets + */ + async listTargetsRaw( + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise>> { + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/target`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + jsonValue.map(ProviderTargetFromJSON), + ) + } + + /** + * List targets + * List targets + */ + async listTargets( + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const response = await this.listTargetsRaw(initOverrides) + return await response.value() + } + + /** + * Remove a target + * Remove a target + */ + async removeTargetRaw( + requestParameters: RemoveTargetRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['target'] == null) { + throw new runtime.RequiredError( + 'target', + 'Required parameter "target" was null or undefined when calling removeTarget().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/target/{target}`.replace( + `{${'target'}}`, + encodeURIComponent(String(requestParameters['target'])), + ), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Remove a target + * Remove a target + */ + async removeTarget( + requestParameters: RemoveTargetRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.removeTargetRaw(requestParameters, initOverrides) + } + + /** + * Set target to default + * Set target to default + */ + async setDefaultTargetRaw( + requestParameters: SetDefaultTargetRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['target'] == null) { + throw new runtime.RequiredError( + 'target', + 'Required parameter "target" was null or undefined when calling setDefaultTarget().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/target/{target}/set-default`.replace( + `{${'target'}}`, + encodeURIComponent(String(requestParameters['target'])), + ), + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Set target to default + * Set target to default + */ + async setDefaultTarget( + requestParameters: SetDefaultTargetRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.setDefaultTargetRaw(requestParameters, initOverrides) + } + + /** + * Set a target + * Set a target + */ + async setTargetRaw( + requestParameters: SetTargetRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['target'] == null) { + throw new runtime.RequiredError( + 'target', + 'Required parameter "target" was null or undefined when calling setTarget().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + headerParameters['Content-Type'] = 'application/json' + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/target`, + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: CreateProviderTargetDTOToJSON(requestParameters['target']), + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Set a target + * Set a target + */ + async setTarget( + requestParameters: SetTargetRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.setTargetRaw(requestParameters, initOverrides) + } +} diff --git a/packages/typescript/src/client/apis/WorkspaceApi.ts b/packages/typescript/src/client/apis/WorkspaceApi.ts new file mode 100644 index 0000000..03ff7f3 --- /dev/null +++ b/packages/typescript/src/client/apis/WorkspaceApi.ts @@ -0,0 +1,612 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime' +import type { + CreateWorkspaceDTO, + SetProjectState, + Workspace, + WorkspaceDTO, +} from '../models/index' +import { + CreateWorkspaceDTOFromJSON, + CreateWorkspaceDTOToJSON, + SetProjectStateFromJSON, + SetProjectStateToJSON, + WorkspaceFromJSON, + WorkspaceToJSON, + WorkspaceDTOFromJSON, + WorkspaceDTOToJSON, +} from '../models/index' + +export interface CreateWorkspaceRequest { + workspace: CreateWorkspaceDTO +} + +export interface GetWorkspaceRequest { + workspaceId: string + verbose?: boolean +} + +export interface ListWorkspacesRequest { + verbose?: boolean +} + +export interface RemoveWorkspaceRequest { + workspaceId: string + force?: boolean +} + +export interface SetProjectStateRequest { + workspaceId: string + projectId: string + setState: SetProjectState +} + +export interface StartProjectRequest { + workspaceId: string + projectId: string +} + +export interface StartWorkspaceRequest { + workspaceId: string +} + +export interface StopProjectRequest { + workspaceId: string + projectId: string +} + +export interface StopWorkspaceRequest { + workspaceId: string +} + +/** + * + */ +export class WorkspaceApi extends runtime.BaseAPI { + /** + * Create a workspace + * Create a workspace + */ + async createWorkspaceRaw( + requestParameters: CreateWorkspaceRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['workspace'] == null) { + throw new runtime.RequiredError( + 'workspace', + 'Required parameter "workspace" was null or undefined when calling createWorkspace().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + headerParameters['Content-Type'] = 'application/json' + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CreateWorkspaceDTOToJSON(requestParameters['workspace']), + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + WorkspaceFromJSON(jsonValue), + ) + } + + /** + * Create a workspace + * Create a workspace + */ + async createWorkspace( + requestParameters: CreateWorkspaceRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.createWorkspaceRaw( + requestParameters, + initOverrides, + ) + return await response.value() + } + + /** + * Get workspace info + * Get workspace info + */ + async getWorkspaceRaw( + requestParameters: GetWorkspaceRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling getWorkspace().', + ) + } + + const queryParameters: any = {} + + if (requestParameters['verbose'] != null) { + queryParameters['verbose'] = requestParameters['verbose'] + } + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}`.replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + WorkspaceDTOFromJSON(jsonValue), + ) + } + + /** + * Get workspace info + * Get workspace info + */ + async getWorkspace( + requestParameters: GetWorkspaceRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.getWorkspaceRaw( + requestParameters, + initOverrides, + ) + return await response.value() + } + + /** + * List workspaces + * List workspaces + */ + async listWorkspacesRaw( + requestParameters: ListWorkspacesRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise>> { + const queryParameters: any = {} + + if (requestParameters['verbose'] != null) { + queryParameters['verbose'] = requestParameters['verbose'] + } + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + jsonValue.map(WorkspaceDTOFromJSON), + ) + } + + /** + * List workspaces + * List workspaces + */ + async listWorkspaces( + requestParameters: ListWorkspacesRequest = {}, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const response = await this.listWorkspacesRaw( + requestParameters, + initOverrides, + ) + return await response.value() + } + + /** + * Remove workspace + * Remove workspace + */ + async removeWorkspaceRaw( + requestParameters: RemoveWorkspaceRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling removeWorkspace().', + ) + } + + const queryParameters: any = {} + + if (requestParameters['force'] != null) { + queryParameters['force'] = requestParameters['force'] + } + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}`.replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Remove workspace + * Remove workspace + */ + async removeWorkspace( + requestParameters: RemoveWorkspaceRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.removeWorkspaceRaw(requestParameters, initOverrides) + } + + /** + * Set project state + * Set project state + */ + async setProjectStateRaw( + requestParameters: SetProjectStateRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling setProjectState().', + ) + } + + if (requestParameters['projectId'] == null) { + throw new runtime.RequiredError( + 'projectId', + 'Required parameter "projectId" was null or undefined when calling setProjectState().', + ) + } + + if (requestParameters['setState'] == null) { + throw new runtime.RequiredError( + 'setState', + 'Required parameter "setState" was null or undefined when calling setProjectState().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + headerParameters['Content-Type'] = 'application/json' + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/{projectId}/state` + .replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ) + .replace( + `{${'projectId'}}`, + encodeURIComponent(String(requestParameters['projectId'])), + ), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: SetProjectStateToJSON(requestParameters['setState']), + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Set project state + * Set project state + */ + async setProjectState( + requestParameters: SetProjectStateRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.setProjectStateRaw(requestParameters, initOverrides) + } + + /** + * Start project + * Start project + */ + async startProjectRaw( + requestParameters: StartProjectRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling startProject().', + ) + } + + if (requestParameters['projectId'] == null) { + throw new runtime.RequiredError( + 'projectId', + 'Required parameter "projectId" was null or undefined when calling startProject().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/{projectId}/start` + .replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ) + .replace( + `{${'projectId'}}`, + encodeURIComponent(String(requestParameters['projectId'])), + ), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Start project + * Start project + */ + async startProject( + requestParameters: StartProjectRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.startProjectRaw(requestParameters, initOverrides) + } + + /** + * Start workspace + * Start workspace + */ + async startWorkspaceRaw( + requestParameters: StartWorkspaceRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling startWorkspace().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/start`.replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Start workspace + * Start workspace + */ + async startWorkspace( + requestParameters: StartWorkspaceRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.startWorkspaceRaw(requestParameters, initOverrides) + } + + /** + * Stop project + * Stop project + */ + async stopProjectRaw( + requestParameters: StopProjectRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling stopProject().', + ) + } + + if (requestParameters['projectId'] == null) { + throw new runtime.RequiredError( + 'projectId', + 'Required parameter "projectId" was null or undefined when calling stopProject().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/{projectId}/stop` + .replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ) + .replace( + `{${'projectId'}}`, + encodeURIComponent(String(requestParameters['projectId'])), + ), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Stop project + * Stop project + */ + async stopProject( + requestParameters: StopProjectRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.stopProjectRaw(requestParameters, initOverrides) + } + + /** + * Stop workspace + * Stop workspace + */ + async stopWorkspaceRaw( + requestParameters: StopWorkspaceRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling stopWorkspace().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/stop`.replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Stop workspace + * Stop workspace + */ + async stopWorkspace( + requestParameters: StopWorkspaceRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.stopWorkspaceRaw(requestParameters, initOverrides) + } +} diff --git a/packages/typescript/src/client/apis/WorkspaceToolboxApi.ts b/packages/typescript/src/client/apis/WorkspaceToolboxApi.ts new file mode 100644 index 0000000..0de4db2 --- /dev/null +++ b/packages/typescript/src/client/apis/WorkspaceToolboxApi.ts @@ -0,0 +1,2630 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from '../runtime' +import type { + CompletionList, + ExecuteRequest, + ExecuteResponse, + FileInfo, + GitAddRequest, + GitBranchRequest, + GitCloneRequest, + GitCommitInfo, + GitCommitRequest, + GitCommitResponse, + GitRepoRequest, + GitStatus, + ListBranchResponse, + LspCompletionParams, + LspDocumentRequest, + LspServerRequest, + LspSymbol, + Match, + ProjectDirResponse, + ReplaceRequest, + ReplaceResult, + SearchFilesResponse, +} from '../models/index' +import { + CompletionListFromJSON, + CompletionListToJSON, + ExecuteRequestFromJSON, + ExecuteRequestToJSON, + ExecuteResponseFromJSON, + ExecuteResponseToJSON, + FileInfoFromJSON, + FileInfoToJSON, + GitAddRequestFromJSON, + GitAddRequestToJSON, + GitBranchRequestFromJSON, + GitBranchRequestToJSON, + GitCloneRequestFromJSON, + GitCloneRequestToJSON, + GitCommitInfoFromJSON, + GitCommitInfoToJSON, + GitCommitRequestFromJSON, + GitCommitRequestToJSON, + GitCommitResponseFromJSON, + GitCommitResponseToJSON, + GitRepoRequestFromJSON, + GitRepoRequestToJSON, + GitStatusFromJSON, + GitStatusToJSON, + ListBranchResponseFromJSON, + ListBranchResponseToJSON, + LspCompletionParamsFromJSON, + LspCompletionParamsToJSON, + LspDocumentRequestFromJSON, + LspDocumentRequestToJSON, + LspServerRequestFromJSON, + LspServerRequestToJSON, + LspSymbolFromJSON, + LspSymbolToJSON, + MatchFromJSON, + MatchToJSON, + ProjectDirResponseFromJSON, + ProjectDirResponseToJSON, + ReplaceRequestFromJSON, + ReplaceRequestToJSON, + ReplaceResultFromJSON, + ReplaceResultToJSON, + SearchFilesResponseFromJSON, + SearchFilesResponseToJSON, +} from '../models/index' + +export interface FsCreateFolderRequest { + workspaceId: string + projectId: string + path: string + mode: string +} + +export interface FsDeleteFileRequest { + workspaceId: string + projectId: string + path: string +} + +export interface FsDownloadFileRequest { + workspaceId: string + projectId: string + path: string +} + +export interface FsFindInFilesRequest { + workspaceId: string + projectId: string + path: string + pattern: string +} + +export interface FsGetFileDetailsRequest { + workspaceId: string + projectId: string + path: string +} + +export interface FsListFilesRequest { + workspaceId: string + projectId: string + path?: string +} + +export interface FsMoveFileRequest { + workspaceId: string + projectId: string + source: string + destination: string +} + +export interface FsReplaceInFilesRequest { + workspaceId: string + projectId: string + replace: ReplaceRequest +} + +export interface FsSearchFilesRequest { + workspaceId: string + projectId: string + path: string + pattern: string +} + +export interface FsSetFilePermissionsRequest { + workspaceId: string + projectId: string + path: string + owner?: string + group?: string + mode?: string +} + +export interface FsUploadFileRequest { + workspaceId: string + projectId: string + path: string + file: Blob +} + +export interface GetProjectDirRequest { + workspaceId: string + projectId: string +} + +export interface GitAddFilesRequest { + workspaceId: string + projectId: string + params: GitAddRequest +} + +export interface GitBranchListRequest { + workspaceId: string + projectId: string + path: string +} + +export interface GitCloneRepositoryRequest { + workspaceId: string + projectId: string + params: GitCloneRequest +} + +export interface GitCommitChangesRequest { + workspaceId: string + projectId: string + params: GitCommitRequest +} + +export interface GitCommitHistoryRequest { + workspaceId: string + projectId: string + path: string +} + +export interface GitCreateBranchRequest { + workspaceId: string + projectId: string + params: GitBranchRequest +} + +export interface GitGitStatusRequest { + workspaceId: string + projectId: string + path: string +} + +export interface GitPullChangesRequest { + workspaceId: string + projectId: string + params: GitRepoRequest +} + +export interface GitPushChangesRequest { + workspaceId: string + projectId: string + params: GitRepoRequest +} + +export interface LspCompletionsRequest { + workspaceId: string + projectId: string + params: LspCompletionParams +} + +export interface LspDidCloseRequest { + workspaceId: string + projectId: string + params: LspDocumentRequest +} + +export interface LspDidOpenRequest { + workspaceId: string + projectId: string + params: LspDocumentRequest +} + +export interface LspDocumentSymbolsRequest { + workspaceId: string + projectId: string + languageId: string + pathToProject: string + uri: string +} + +export interface LspStartRequest { + workspaceId: string + projectId: string + params: LspServerRequest +} + +export interface LspStopRequest { + workspaceId: string + projectId: string + params: LspServerRequest +} + +export interface LspWorkspaceSymbolsRequest { + workspaceId: string + projectId: string + languageId: string + pathToProject: string + query: string +} + +export interface ProcessExecuteCommandRequest { + workspaceId: string + projectId: string + params: ExecuteRequest +} + +/** + * + */ +export class WorkspaceToolboxApi extends runtime.BaseAPI { + /** + * Create folder inside workspace project + * Create folder + */ + async fsCreateFolderRaw( + requestParameters: FsCreateFolderRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling fsCreateFolder().', + ) + } + + if (requestParameters['projectId'] == null) { + throw new runtime.RequiredError( + 'projectId', + 'Required parameter "projectId" was null or undefined when calling fsCreateFolder().', + ) + } + + if (requestParameters['path'] == null) { + throw new runtime.RequiredError( + 'path', + 'Required parameter "path" was null or undefined when calling fsCreateFolder().', + ) + } + + if (requestParameters['mode'] == null) { + throw new runtime.RequiredError( + 'mode', + 'Required parameter "mode" was null or undefined when calling fsCreateFolder().', + ) + } + + const queryParameters: any = {} + + if (requestParameters['path'] != null) { + queryParameters['path'] = requestParameters['path'] + } + + if (requestParameters['mode'] != null) { + queryParameters['mode'] = requestParameters['mode'] + } + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/{projectId}/toolbox/files/folder` + .replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ) + .replace( + `{${'projectId'}}`, + encodeURIComponent(String(requestParameters['projectId'])), + ), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Create folder inside workspace project + * Create folder + */ + async fsCreateFolder( + requestParameters: FsCreateFolderRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.fsCreateFolderRaw(requestParameters, initOverrides) + } + + /** + * Delete file inside workspace project + * Delete file + */ + async fsDeleteFileRaw( + requestParameters: FsDeleteFileRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling fsDeleteFile().', + ) + } + + if (requestParameters['projectId'] == null) { + throw new runtime.RequiredError( + 'projectId', + 'Required parameter "projectId" was null or undefined when calling fsDeleteFile().', + ) + } + + if (requestParameters['path'] == null) { + throw new runtime.RequiredError( + 'path', + 'Required parameter "path" was null or undefined when calling fsDeleteFile().', + ) + } + + const queryParameters: any = {} + + if (requestParameters['path'] != null) { + queryParameters['path'] = requestParameters['path'] + } + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/{projectId}/toolbox/files` + .replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ) + .replace( + `{${'projectId'}}`, + encodeURIComponent(String(requestParameters['projectId'])), + ), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Delete file inside workspace project + * Delete file + */ + async fsDeleteFile( + requestParameters: FsDeleteFileRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.fsDeleteFileRaw(requestParameters, initOverrides) + } + + /** + * Download file from workspace project + * Download file + */ + async fsDownloadFileRaw( + requestParameters: FsDownloadFileRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling fsDownloadFile().', + ) + } + + if (requestParameters['projectId'] == null) { + throw new runtime.RequiredError( + 'projectId', + 'Required parameter "projectId" was null or undefined when calling fsDownloadFile().', + ) + } + + if (requestParameters['path'] == null) { + throw new runtime.RequiredError( + 'path', + 'Required parameter "path" was null or undefined when calling fsDownloadFile().', + ) + } + + const queryParameters: any = {} + + if (requestParameters['path'] != null) { + queryParameters['path'] = requestParameters['path'] + } + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/{projectId}/toolbox/files/download` + .replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ) + .replace( + `{${'projectId'}}`, + encodeURIComponent(String(requestParameters['projectId'])), + ), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.BlobApiResponse(response) + } + + /** + * Download file from workspace project + * Download file + */ + async fsDownloadFile( + requestParameters: FsDownloadFileRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.fsDownloadFileRaw( + requestParameters, + initOverrides, + ) + return await response.value() + } + + /** + * Search for text/pattern inside workspace project files + * Search for text/pattern in files + */ + async fsFindInFilesRaw( + requestParameters: FsFindInFilesRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise>> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling fsFindInFiles().', + ) + } + + if (requestParameters['projectId'] == null) { + throw new runtime.RequiredError( + 'projectId', + 'Required parameter "projectId" was null or undefined when calling fsFindInFiles().', + ) + } + + if (requestParameters['path'] == null) { + throw new runtime.RequiredError( + 'path', + 'Required parameter "path" was null or undefined when calling fsFindInFiles().', + ) + } + + if (requestParameters['pattern'] == null) { + throw new runtime.RequiredError( + 'pattern', + 'Required parameter "pattern" was null or undefined when calling fsFindInFiles().', + ) + } + + const queryParameters: any = {} + + if (requestParameters['path'] != null) { + queryParameters['path'] = requestParameters['path'] + } + + if (requestParameters['pattern'] != null) { + queryParameters['pattern'] = requestParameters['pattern'] + } + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/{projectId}/toolbox/files/find` + .replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ) + .replace( + `{${'projectId'}}`, + encodeURIComponent(String(requestParameters['projectId'])), + ), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + jsonValue.map(MatchFromJSON), + ) + } + + /** + * Search for text/pattern inside workspace project files + * Search for text/pattern in files + */ + async fsFindInFiles( + requestParameters: FsFindInFilesRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const response = await this.fsFindInFilesRaw( + requestParameters, + initOverrides, + ) + return await response.value() + } + + /** + * Get file info inside workspace project + * Get file info + */ + async fsGetFileDetailsRaw( + requestParameters: FsGetFileDetailsRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling fsGetFileDetails().', + ) + } + + if (requestParameters['projectId'] == null) { + throw new runtime.RequiredError( + 'projectId', + 'Required parameter "projectId" was null or undefined when calling fsGetFileDetails().', + ) + } + + if (requestParameters['path'] == null) { + throw new runtime.RequiredError( + 'path', + 'Required parameter "path" was null or undefined when calling fsGetFileDetails().', + ) + } + + const queryParameters: any = {} + + if (requestParameters['path'] != null) { + queryParameters['path'] = requestParameters['path'] + } + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/{projectId}/toolbox/files/info` + .replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ) + .replace( + `{${'projectId'}}`, + encodeURIComponent(String(requestParameters['projectId'])), + ), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + FileInfoFromJSON(jsonValue), + ) + } + + /** + * Get file info inside workspace project + * Get file info + */ + async fsGetFileDetails( + requestParameters: FsGetFileDetailsRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.fsGetFileDetailsRaw( + requestParameters, + initOverrides, + ) + return await response.value() + } + + /** + * List files inside workspace project + * List files + */ + async fsListFilesRaw( + requestParameters: FsListFilesRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise>> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling fsListFiles().', + ) + } + + if (requestParameters['projectId'] == null) { + throw new runtime.RequiredError( + 'projectId', + 'Required parameter "projectId" was null or undefined when calling fsListFiles().', + ) + } + + const queryParameters: any = {} + + if (requestParameters['path'] != null) { + queryParameters['path'] = requestParameters['path'] + } + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/{projectId}/toolbox/files` + .replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ) + .replace( + `{${'projectId'}}`, + encodeURIComponent(String(requestParameters['projectId'])), + ), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + jsonValue.map(FileInfoFromJSON), + ) + } + + /** + * List files inside workspace project + * List files + */ + async fsListFiles( + requestParameters: FsListFilesRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const response = await this.fsListFilesRaw(requestParameters, initOverrides) + return await response.value() + } + + /** + * Create folder inside workspace project + * Create folder + */ + async fsMoveFileRaw( + requestParameters: FsMoveFileRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling fsMoveFile().', + ) + } + + if (requestParameters['projectId'] == null) { + throw new runtime.RequiredError( + 'projectId', + 'Required parameter "projectId" was null or undefined when calling fsMoveFile().', + ) + } + + if (requestParameters['source'] == null) { + throw new runtime.RequiredError( + 'source', + 'Required parameter "source" was null or undefined when calling fsMoveFile().', + ) + } + + if (requestParameters['destination'] == null) { + throw new runtime.RequiredError( + 'destination', + 'Required parameter "destination" was null or undefined when calling fsMoveFile().', + ) + } + + const queryParameters: any = {} + + if (requestParameters['source'] != null) { + queryParameters['source'] = requestParameters['source'] + } + + if (requestParameters['destination'] != null) { + queryParameters['destination'] = requestParameters['destination'] + } + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/{projectId}/toolbox/files/move` + .replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ) + .replace( + `{${'projectId'}}`, + encodeURIComponent(String(requestParameters['projectId'])), + ), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Create folder inside workspace project + * Create folder + */ + async fsMoveFile( + requestParameters: FsMoveFileRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.fsMoveFileRaw(requestParameters, initOverrides) + } + + /** + * Repleace text/pattern in mutilple files inside workspace project + * Repleace text/pattern in files + */ + async fsReplaceInFilesRaw( + requestParameters: FsReplaceInFilesRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise>> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling fsReplaceInFiles().', + ) + } + + if (requestParameters['projectId'] == null) { + throw new runtime.RequiredError( + 'projectId', + 'Required parameter "projectId" was null or undefined when calling fsReplaceInFiles().', + ) + } + + if (requestParameters['replace'] == null) { + throw new runtime.RequiredError( + 'replace', + 'Required parameter "replace" was null or undefined when calling fsReplaceInFiles().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + headerParameters['Content-Type'] = 'application/json' + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/{projectId}/toolbox/files/replace` + .replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ) + .replace( + `{${'projectId'}}`, + encodeURIComponent(String(requestParameters['projectId'])), + ), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: ReplaceRequestToJSON(requestParameters['replace']), + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + jsonValue.map(ReplaceResultFromJSON), + ) + } + + /** + * Repleace text/pattern in mutilple files inside workspace project + * Repleace text/pattern in files + */ + async fsReplaceInFiles( + requestParameters: FsReplaceInFilesRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const response = await this.fsReplaceInFilesRaw( + requestParameters, + initOverrides, + ) + return await response.value() + } + + /** + * Search for files inside workspace project + * Search for files + */ + async fsSearchFilesRaw( + requestParameters: FsSearchFilesRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling fsSearchFiles().', + ) + } + + if (requestParameters['projectId'] == null) { + throw new runtime.RequiredError( + 'projectId', + 'Required parameter "projectId" was null or undefined when calling fsSearchFiles().', + ) + } + + if (requestParameters['path'] == null) { + throw new runtime.RequiredError( + 'path', + 'Required parameter "path" was null or undefined when calling fsSearchFiles().', + ) + } + + if (requestParameters['pattern'] == null) { + throw new runtime.RequiredError( + 'pattern', + 'Required parameter "pattern" was null or undefined when calling fsSearchFiles().', + ) + } + + const queryParameters: any = {} + + if (requestParameters['path'] != null) { + queryParameters['path'] = requestParameters['path'] + } + + if (requestParameters['pattern'] != null) { + queryParameters['pattern'] = requestParameters['pattern'] + } + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/{projectId}/toolbox/files/search` + .replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ) + .replace( + `{${'projectId'}}`, + encodeURIComponent(String(requestParameters['projectId'])), + ), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + SearchFilesResponseFromJSON(jsonValue), + ) + } + + /** + * Search for files inside workspace project + * Search for files + */ + async fsSearchFiles( + requestParameters: FsSearchFilesRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.fsSearchFilesRaw( + requestParameters, + initOverrides, + ) + return await response.value() + } + + /** + * Set file owner/group/permissions inside workspace project + * Set file owner/group/permissions + */ + async fsSetFilePermissionsRaw( + requestParameters: FsSetFilePermissionsRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling fsSetFilePermissions().', + ) + } + + if (requestParameters['projectId'] == null) { + throw new runtime.RequiredError( + 'projectId', + 'Required parameter "projectId" was null or undefined when calling fsSetFilePermissions().', + ) + } + + if (requestParameters['path'] == null) { + throw new runtime.RequiredError( + 'path', + 'Required parameter "path" was null or undefined when calling fsSetFilePermissions().', + ) + } + + const queryParameters: any = {} + + if (requestParameters['path'] != null) { + queryParameters['path'] = requestParameters['path'] + } + + if (requestParameters['owner'] != null) { + queryParameters['owner'] = requestParameters['owner'] + } + + if (requestParameters['group'] != null) { + queryParameters['group'] = requestParameters['group'] + } + + if (requestParameters['mode'] != null) { + queryParameters['mode'] = requestParameters['mode'] + } + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/{projectId}/toolbox/files/permissions` + .replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ) + .replace( + `{${'projectId'}}`, + encodeURIComponent(String(requestParameters['projectId'])), + ), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Set file owner/group/permissions inside workspace project + * Set file owner/group/permissions + */ + async fsSetFilePermissions( + requestParameters: FsSetFilePermissionsRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.fsSetFilePermissionsRaw(requestParameters, initOverrides) + } + + /** + * Upload file inside workspace project + * Upload file + */ + async fsUploadFileRaw( + requestParameters: FsUploadFileRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling fsUploadFile().', + ) + } + + if (requestParameters['projectId'] == null) { + throw new runtime.RequiredError( + 'projectId', + 'Required parameter "projectId" was null or undefined when calling fsUploadFile().', + ) + } + + if (requestParameters['path'] == null) { + throw new runtime.RequiredError( + 'path', + 'Required parameter "path" was null or undefined when calling fsUploadFile().', + ) + } + + if (requestParameters['file'] == null) { + throw new runtime.RequiredError( + 'file', + 'Required parameter "file" was null or undefined when calling fsUploadFile().', + ) + } + + const queryParameters: any = {} + + if (requestParameters['path'] != null) { + queryParameters['path'] = requestParameters['path'] + } + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const consumes: runtime.Consume[] = [{ contentType: 'multipart/form-data' }] + // @ts-ignore: canConsumeForm may be unused + const canConsumeForm = runtime.canConsumeForm(consumes) + + let formParams: { append(param: string, value: any): any } + let useForm = false + // use FormData to transmit files using content-type "multipart/form-data" + useForm = canConsumeForm + if (useForm) { + formParams = new FormData() + } else { + formParams = new URLSearchParams() + } + + if (requestParameters['file'] != null) { + formParams.append('file', requestParameters['file'] as any) + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/{projectId}/toolbox/files/upload` + .replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ) + .replace( + `{${'projectId'}}`, + encodeURIComponent(String(requestParameters['projectId'])), + ), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: formParams, + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Upload file inside workspace project + * Upload file + */ + async fsUploadFile( + requestParameters: FsUploadFileRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.fsUploadFileRaw(requestParameters, initOverrides) + } + + /** + * Get project directory + * Get project dir + */ + async getProjectDirRaw( + requestParameters: GetProjectDirRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling getProjectDir().', + ) + } + + if (requestParameters['projectId'] == null) { + throw new runtime.RequiredError( + 'projectId', + 'Required parameter "projectId" was null or undefined when calling getProjectDir().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/{projectId}/toolbox/project-dir` + .replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ) + .replace( + `{${'projectId'}}`, + encodeURIComponent(String(requestParameters['projectId'])), + ), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + ProjectDirResponseFromJSON(jsonValue), + ) + } + + /** + * Get project directory + * Get project dir + */ + async getProjectDir( + requestParameters: GetProjectDirRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.getProjectDirRaw( + requestParameters, + initOverrides, + ) + return await response.value() + } + + /** + * Add files to git commit + * Add files + */ + async gitAddFilesRaw( + requestParameters: GitAddFilesRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling gitAddFiles().', + ) + } + + if (requestParameters['projectId'] == null) { + throw new runtime.RequiredError( + 'projectId', + 'Required parameter "projectId" was null or undefined when calling gitAddFiles().', + ) + } + + if (requestParameters['params'] == null) { + throw new runtime.RequiredError( + 'params', + 'Required parameter "params" was null or undefined when calling gitAddFiles().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + headerParameters['Content-Type'] = 'application/json' + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/{projectId}/toolbox/git/add` + .replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ) + .replace( + `{${'projectId'}}`, + encodeURIComponent(String(requestParameters['projectId'])), + ), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: GitAddRequestToJSON(requestParameters['params']), + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Add files to git commit + * Add files + */ + async gitAddFiles( + requestParameters: GitAddFilesRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.gitAddFilesRaw(requestParameters, initOverrides) + } + + /** + * Get branch list from git repository inside workspace project + * Get branch list + */ + async gitBranchListRaw( + requestParameters: GitBranchListRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling gitBranchList().', + ) + } + + if (requestParameters['projectId'] == null) { + throw new runtime.RequiredError( + 'projectId', + 'Required parameter "projectId" was null or undefined when calling gitBranchList().', + ) + } + + if (requestParameters['path'] == null) { + throw new runtime.RequiredError( + 'path', + 'Required parameter "path" was null or undefined when calling gitBranchList().', + ) + } + + const queryParameters: any = {} + + if (requestParameters['path'] != null) { + queryParameters['path'] = requestParameters['path'] + } + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/{projectId}/toolbox/git/branches` + .replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ) + .replace( + `{${'projectId'}}`, + encodeURIComponent(String(requestParameters['projectId'])), + ), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + ListBranchResponseFromJSON(jsonValue), + ) + } + + /** + * Get branch list from git repository inside workspace project + * Get branch list + */ + async gitBranchList( + requestParameters: GitBranchListRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.gitBranchListRaw( + requestParameters, + initOverrides, + ) + return await response.value() + } + + /** + * Clone git repository inside workspace project + * Clone git repository + */ + async gitCloneRepositoryRaw( + requestParameters: GitCloneRepositoryRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling gitCloneRepository().', + ) + } + + if (requestParameters['projectId'] == null) { + throw new runtime.RequiredError( + 'projectId', + 'Required parameter "projectId" was null or undefined when calling gitCloneRepository().', + ) + } + + if (requestParameters['params'] == null) { + throw new runtime.RequiredError( + 'params', + 'Required parameter "params" was null or undefined when calling gitCloneRepository().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + headerParameters['Content-Type'] = 'application/json' + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/{projectId}/toolbox/git/clone` + .replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ) + .replace( + `{${'projectId'}}`, + encodeURIComponent(String(requestParameters['projectId'])), + ), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: GitCloneRequestToJSON(requestParameters['params']), + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Clone git repository inside workspace project + * Clone git repository + */ + async gitCloneRepository( + requestParameters: GitCloneRepositoryRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.gitCloneRepositoryRaw(requestParameters, initOverrides) + } + + /** + * Commit changes to git repository inside workspace project + * Commit changes + */ + async gitCommitChangesRaw( + requestParameters: GitCommitChangesRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling gitCommitChanges().', + ) + } + + if (requestParameters['projectId'] == null) { + throw new runtime.RequiredError( + 'projectId', + 'Required parameter "projectId" was null or undefined when calling gitCommitChanges().', + ) + } + + if (requestParameters['params'] == null) { + throw new runtime.RequiredError( + 'params', + 'Required parameter "params" was null or undefined when calling gitCommitChanges().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + headerParameters['Content-Type'] = 'application/json' + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/{projectId}/toolbox/git/commit` + .replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ) + .replace( + `{${'projectId'}}`, + encodeURIComponent(String(requestParameters['projectId'])), + ), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: GitCommitRequestToJSON(requestParameters['params']), + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + GitCommitResponseFromJSON(jsonValue), + ) + } + + /** + * Commit changes to git repository inside workspace project + * Commit changes + */ + async gitCommitChanges( + requestParameters: GitCommitChangesRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.gitCommitChangesRaw( + requestParameters, + initOverrides, + ) + return await response.value() + } + + /** + * Get commit history from git repository inside workspace project + * Get commit history + */ + async gitCommitHistoryRaw( + requestParameters: GitCommitHistoryRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise>> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling gitCommitHistory().', + ) + } + + if (requestParameters['projectId'] == null) { + throw new runtime.RequiredError( + 'projectId', + 'Required parameter "projectId" was null or undefined when calling gitCommitHistory().', + ) + } + + if (requestParameters['path'] == null) { + throw new runtime.RequiredError( + 'path', + 'Required parameter "path" was null or undefined when calling gitCommitHistory().', + ) + } + + const queryParameters: any = {} + + if (requestParameters['path'] != null) { + queryParameters['path'] = requestParameters['path'] + } + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/{projectId}/toolbox/git/history` + .replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ) + .replace( + `{${'projectId'}}`, + encodeURIComponent(String(requestParameters['projectId'])), + ), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + jsonValue.map(GitCommitInfoFromJSON), + ) + } + + /** + * Get commit history from git repository inside workspace project + * Get commit history + */ + async gitCommitHistory( + requestParameters: GitCommitHistoryRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const response = await this.gitCommitHistoryRaw( + requestParameters, + initOverrides, + ) + return await response.value() + } + + /** + * Create branch on git repository inside workspace project + * Create branch + */ + async gitCreateBranchRaw( + requestParameters: GitCreateBranchRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling gitCreateBranch().', + ) + } + + if (requestParameters['projectId'] == null) { + throw new runtime.RequiredError( + 'projectId', + 'Required parameter "projectId" was null or undefined when calling gitCreateBranch().', + ) + } + + if (requestParameters['params'] == null) { + throw new runtime.RequiredError( + 'params', + 'Required parameter "params" was null or undefined when calling gitCreateBranch().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + headerParameters['Content-Type'] = 'application/json' + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/{projectId}/toolbox/git/branches` + .replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ) + .replace( + `{${'projectId'}}`, + encodeURIComponent(String(requestParameters['projectId'])), + ), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: GitBranchRequestToJSON(requestParameters['params']), + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Create branch on git repository inside workspace project + * Create branch + */ + async gitCreateBranch( + requestParameters: GitCreateBranchRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.gitCreateBranchRaw(requestParameters, initOverrides) + } + + /** + * Get status from git repository inside workspace project + * Get git status + */ + async gitGitStatusRaw( + requestParameters: GitGitStatusRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling gitGitStatus().', + ) + } + + if (requestParameters['projectId'] == null) { + throw new runtime.RequiredError( + 'projectId', + 'Required parameter "projectId" was null or undefined when calling gitGitStatus().', + ) + } + + if (requestParameters['path'] == null) { + throw new runtime.RequiredError( + 'path', + 'Required parameter "path" was null or undefined when calling gitGitStatus().', + ) + } + + const queryParameters: any = {} + + if (requestParameters['path'] != null) { + queryParameters['path'] = requestParameters['path'] + } + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/{projectId}/toolbox/git/status` + .replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ) + .replace( + `{${'projectId'}}`, + encodeURIComponent(String(requestParameters['projectId'])), + ), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + GitStatusFromJSON(jsonValue), + ) + } + + /** + * Get status from git repository inside workspace project + * Get git status + */ + async gitGitStatus( + requestParameters: GitGitStatusRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.gitGitStatusRaw( + requestParameters, + initOverrides, + ) + return await response.value() + } + + /** + * Pull changes from remote to git repository inside workspace project + * Pull changes + */ + async gitPullChangesRaw( + requestParameters: GitPullChangesRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling gitPullChanges().', + ) + } + + if (requestParameters['projectId'] == null) { + throw new runtime.RequiredError( + 'projectId', + 'Required parameter "projectId" was null or undefined when calling gitPullChanges().', + ) + } + + if (requestParameters['params'] == null) { + throw new runtime.RequiredError( + 'params', + 'Required parameter "params" was null or undefined when calling gitPullChanges().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + headerParameters['Content-Type'] = 'application/json' + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/{projectId}/toolbox/git/pull` + .replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ) + .replace( + `{${'projectId'}}`, + encodeURIComponent(String(requestParameters['projectId'])), + ), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: GitRepoRequestToJSON(requestParameters['params']), + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Pull changes from remote to git repository inside workspace project + * Pull changes + */ + async gitPullChanges( + requestParameters: GitPullChangesRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.gitPullChangesRaw(requestParameters, initOverrides) + } + + /** + * Push changes to remote from git repository inside workspace project + * Push changes + */ + async gitPushChangesRaw( + requestParameters: GitPushChangesRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling gitPushChanges().', + ) + } + + if (requestParameters['projectId'] == null) { + throw new runtime.RequiredError( + 'projectId', + 'Required parameter "projectId" was null or undefined when calling gitPushChanges().', + ) + } + + if (requestParameters['params'] == null) { + throw new runtime.RequiredError( + 'params', + 'Required parameter "params" was null or undefined when calling gitPushChanges().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + headerParameters['Content-Type'] = 'application/json' + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/{projectId}/toolbox/git/push` + .replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ) + .replace( + `{${'projectId'}}`, + encodeURIComponent(String(requestParameters['projectId'])), + ), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: GitRepoRequestToJSON(requestParameters['params']), + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Push changes to remote from git repository inside workspace project + * Push changes + */ + async gitPushChanges( + requestParameters: GitPushChangesRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.gitPushChangesRaw(requestParameters, initOverrides) + } + + /** + * The Completion request is sent from the client to the server to compute completion items at a given cursor position. + * Get Lsp Completions + */ + async lspCompletionsRaw( + requestParameters: LspCompletionsRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling lspCompletions().', + ) + } + + if (requestParameters['projectId'] == null) { + throw new runtime.RequiredError( + 'projectId', + 'Required parameter "projectId" was null or undefined when calling lspCompletions().', + ) + } + + if (requestParameters['params'] == null) { + throw new runtime.RequiredError( + 'params', + 'Required parameter "params" was null or undefined when calling lspCompletions().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + headerParameters['Content-Type'] = 'application/json' + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/{projectId}/toolbox/lsp/completions` + .replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ) + .replace( + `{${'projectId'}}`, + encodeURIComponent(String(requestParameters['projectId'])), + ), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: LspCompletionParamsToJSON(requestParameters['params']), + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + CompletionListFromJSON(jsonValue), + ) + } + + /** + * The Completion request is sent from the client to the server to compute completion items at a given cursor position. + * Get Lsp Completions + */ + async lspCompletions( + requestParameters: LspCompletionsRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.lspCompletionsRaw( + requestParameters, + initOverrides, + ) + return await response.value() + } + + /** + * The document close notification is sent from the client to the server when the document got closed in the client. + * Call Lsp DidClose + */ + async lspDidCloseRaw( + requestParameters: LspDidCloseRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling lspDidClose().', + ) + } + + if (requestParameters['projectId'] == null) { + throw new runtime.RequiredError( + 'projectId', + 'Required parameter "projectId" was null or undefined when calling lspDidClose().', + ) + } + + if (requestParameters['params'] == null) { + throw new runtime.RequiredError( + 'params', + 'Required parameter "params" was null or undefined when calling lspDidClose().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + headerParameters['Content-Type'] = 'application/json' + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/{projectId}/toolbox/lsp/did-close` + .replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ) + .replace( + `{${'projectId'}}`, + encodeURIComponent(String(requestParameters['projectId'])), + ), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: LspDocumentRequestToJSON(requestParameters['params']), + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * The document close notification is sent from the client to the server when the document got closed in the client. + * Call Lsp DidClose + */ + async lspDidClose( + requestParameters: LspDidCloseRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.lspDidCloseRaw(requestParameters, initOverrides) + } + + /** + * The document open notification is sent from the client to the server to signal newly opened text documents. + * Call Lsp DidOpen + */ + async lspDidOpenRaw( + requestParameters: LspDidOpenRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling lspDidOpen().', + ) + } + + if (requestParameters['projectId'] == null) { + throw new runtime.RequiredError( + 'projectId', + 'Required parameter "projectId" was null or undefined when calling lspDidOpen().', + ) + } + + if (requestParameters['params'] == null) { + throw new runtime.RequiredError( + 'params', + 'Required parameter "params" was null or undefined when calling lspDidOpen().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + headerParameters['Content-Type'] = 'application/json' + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/{projectId}/toolbox/lsp/did-open` + .replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ) + .replace( + `{${'projectId'}}`, + encodeURIComponent(String(requestParameters['projectId'])), + ), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: LspDocumentRequestToJSON(requestParameters['params']), + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * The document open notification is sent from the client to the server to signal newly opened text documents. + * Call Lsp DidOpen + */ + async lspDidOpen( + requestParameters: LspDidOpenRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.lspDidOpenRaw(requestParameters, initOverrides) + } + + /** + * The document symbol request is sent from the client to the server. + * Call Lsp DocumentSymbols + */ + async lspDocumentSymbolsRaw( + requestParameters: LspDocumentSymbolsRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise>> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling lspDocumentSymbols().', + ) + } + + if (requestParameters['projectId'] == null) { + throw new runtime.RequiredError( + 'projectId', + 'Required parameter "projectId" was null or undefined when calling lspDocumentSymbols().', + ) + } + + if (requestParameters['languageId'] == null) { + throw new runtime.RequiredError( + 'languageId', + 'Required parameter "languageId" was null or undefined when calling lspDocumentSymbols().', + ) + } + + if (requestParameters['pathToProject'] == null) { + throw new runtime.RequiredError( + 'pathToProject', + 'Required parameter "pathToProject" was null or undefined when calling lspDocumentSymbols().', + ) + } + + if (requestParameters['uri'] == null) { + throw new runtime.RequiredError( + 'uri', + 'Required parameter "uri" was null or undefined when calling lspDocumentSymbols().', + ) + } + + const queryParameters: any = {} + + if (requestParameters['languageId'] != null) { + queryParameters['languageId'] = requestParameters['languageId'] + } + + if (requestParameters['pathToProject'] != null) { + queryParameters['pathToProject'] = requestParameters['pathToProject'] + } + + if (requestParameters['uri'] != null) { + queryParameters['uri'] = requestParameters['uri'] + } + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/{projectId}/toolbox/lsp/document-symbols` + .replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ) + .replace( + `{${'projectId'}}`, + encodeURIComponent(String(requestParameters['projectId'])), + ), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + jsonValue.map(LspSymbolFromJSON), + ) + } + + /** + * The document symbol request is sent from the client to the server. + * Call Lsp DocumentSymbols + */ + async lspDocumentSymbols( + requestParameters: LspDocumentSymbolsRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const response = await this.lspDocumentSymbolsRaw( + requestParameters, + initOverrides, + ) + return await response.value() + } + + /** + * Start Lsp server process inside workspace project + * Start Lsp server + */ + async lspStartRaw( + requestParameters: LspStartRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling lspStart().', + ) + } + + if (requestParameters['projectId'] == null) { + throw new runtime.RequiredError( + 'projectId', + 'Required parameter "projectId" was null or undefined when calling lspStart().', + ) + } + + if (requestParameters['params'] == null) { + throw new runtime.RequiredError( + 'params', + 'Required parameter "params" was null or undefined when calling lspStart().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + headerParameters['Content-Type'] = 'application/json' + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/{projectId}/toolbox/lsp/start` + .replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ) + .replace( + `{${'projectId'}}`, + encodeURIComponent(String(requestParameters['projectId'])), + ), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: LspServerRequestToJSON(requestParameters['params']), + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Start Lsp server process inside workspace project + * Start Lsp server + */ + async lspStart( + requestParameters: LspStartRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.lspStartRaw(requestParameters, initOverrides) + } + + /** + * Stop Lsp server process inside workspace project + * Stop Lsp server + */ + async lspStopRaw( + requestParameters: LspStopRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling lspStop().', + ) + } + + if (requestParameters['projectId'] == null) { + throw new runtime.RequiredError( + 'projectId', + 'Required parameter "projectId" was null or undefined when calling lspStop().', + ) + } + + if (requestParameters['params'] == null) { + throw new runtime.RequiredError( + 'params', + 'Required parameter "params" was null or undefined when calling lspStop().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + headerParameters['Content-Type'] = 'application/json' + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/{projectId}/toolbox/lsp/stop` + .replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ) + .replace( + `{${'projectId'}}`, + encodeURIComponent(String(requestParameters['projectId'])), + ), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: LspServerRequestToJSON(requestParameters['params']), + }, + initOverrides, + ) + + return new runtime.VoidApiResponse(response) + } + + /** + * Stop Lsp server process inside workspace project + * Stop Lsp server + */ + async lspStop( + requestParameters: LspStopRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + await this.lspStopRaw(requestParameters, initOverrides) + } + + /** + * The workspace symbol request is sent from the client to the server to list project-wide symbols matching the query string. + * Call Lsp WorkspaceSymbols + */ + async lspWorkspaceSymbolsRaw( + requestParameters: LspWorkspaceSymbolsRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise>> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling lspWorkspaceSymbols().', + ) + } + + if (requestParameters['projectId'] == null) { + throw new runtime.RequiredError( + 'projectId', + 'Required parameter "projectId" was null or undefined when calling lspWorkspaceSymbols().', + ) + } + + if (requestParameters['languageId'] == null) { + throw new runtime.RequiredError( + 'languageId', + 'Required parameter "languageId" was null or undefined when calling lspWorkspaceSymbols().', + ) + } + + if (requestParameters['pathToProject'] == null) { + throw new runtime.RequiredError( + 'pathToProject', + 'Required parameter "pathToProject" was null or undefined when calling lspWorkspaceSymbols().', + ) + } + + if (requestParameters['query'] == null) { + throw new runtime.RequiredError( + 'query', + 'Required parameter "query" was null or undefined when calling lspWorkspaceSymbols().', + ) + } + + const queryParameters: any = {} + + if (requestParameters['languageId'] != null) { + queryParameters['languageId'] = requestParameters['languageId'] + } + + if (requestParameters['pathToProject'] != null) { + queryParameters['pathToProject'] = requestParameters['pathToProject'] + } + + if (requestParameters['query'] != null) { + queryParameters['query'] = requestParameters['query'] + } + + const headerParameters: runtime.HTTPHeaders = {} + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/{projectId}/toolbox/lsp/workspace-symbols` + .replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ) + .replace( + `{${'projectId'}}`, + encodeURIComponent(String(requestParameters['projectId'])), + ), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + jsonValue.map(LspSymbolFromJSON), + ) + } + + /** + * The workspace symbol request is sent from the client to the server to list project-wide symbols matching the query string. + * Call Lsp WorkspaceSymbols + */ + async lspWorkspaceSymbols( + requestParameters: LspWorkspaceSymbolsRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const response = await this.lspWorkspaceSymbolsRaw( + requestParameters, + initOverrides, + ) + return await response.value() + } + + /** + * Execute command synchronously inside workspace project + * Execute command + */ + async processExecuteCommandRaw( + requestParameters: ProcessExecuteCommandRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters['workspaceId'] == null) { + throw new runtime.RequiredError( + 'workspaceId', + 'Required parameter "workspaceId" was null or undefined when calling processExecuteCommand().', + ) + } + + if (requestParameters['projectId'] == null) { + throw new runtime.RequiredError( + 'projectId', + 'Required parameter "projectId" was null or undefined when calling processExecuteCommand().', + ) + } + + if (requestParameters['params'] == null) { + throw new runtime.RequiredError( + 'params', + 'Required parameter "params" was null or undefined when calling processExecuteCommand().', + ) + } + + const queryParameters: any = {} + + const headerParameters: runtime.HTTPHeaders = {} + + headerParameters['Content-Type'] = 'application/json' + + if (this.configuration && this.configuration.apiKey) { + headerParameters['Authorization'] = await this.configuration.apiKey( + 'Authorization', + ) // Bearer authentication + } + + const response = await this.request( + { + path: `/workspace/{workspaceId}/{projectId}/toolbox/process/execute` + .replace( + `{${'workspaceId'}}`, + encodeURIComponent(String(requestParameters['workspaceId'])), + ) + .replace( + `{${'projectId'}}`, + encodeURIComponent(String(requestParameters['projectId'])), + ), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: ExecuteRequestToJSON(requestParameters['params']), + }, + initOverrides, + ) + + return new runtime.JSONApiResponse(response, (jsonValue) => + ExecuteResponseFromJSON(jsonValue), + ) + } + + /** + * Execute command synchronously inside workspace project + * Execute command + */ + async processExecuteCommand( + requestParameters: ProcessExecuteCommandRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.processExecuteCommandRaw( + requestParameters, + initOverrides, + ) + return await response.value() + } +} diff --git a/packages/typescript/src/client/apis/index.ts b/packages/typescript/src/client/apis/index.ts new file mode 100644 index 0000000..38020e2 --- /dev/null +++ b/packages/typescript/src/client/apis/index.ts @@ -0,0 +1,16 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './ApiKeyApi' +export * from './BuildApi' +export * from './ContainerRegistryApi' +export * from './DefaultApi' +export * from './GitProviderApi' +export * from './PrebuildApi' +export * from './ProfileApi' +export * from './ProjectConfigApi' +export * from './ProviderApi' +export * from './SampleApi' +export * from './ServerApi' +export * from './TargetApi' +export * from './WorkspaceApi' +export * from './WorkspaceToolboxApi' diff --git a/packages/typescript/src/client/index.ts b/packages/typescript/src/client/index.ts new file mode 100644 index 0000000..b9d51b2 --- /dev/null +++ b/packages/typescript/src/client/index.ts @@ -0,0 +1,5 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './runtime' +export * from './apis/index' +export * from './models/index' diff --git a/packages/typescript/src/client/models/ApiKey.ts b/packages/typescript/src/client/models/ApiKey.ts new file mode 100644 index 0000000..f067496 --- /dev/null +++ b/packages/typescript/src/client/models/ApiKey.ts @@ -0,0 +1,95 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +import type { ApikeyApiKeyType } from './ApikeyApiKeyType' +import { + ApikeyApiKeyTypeFromJSON, + ApikeyApiKeyTypeFromJSONTyped, + ApikeyApiKeyTypeToJSON, + ApikeyApiKeyTypeToJSONTyped, +} from './ApikeyApiKeyType' + +/** + * + * @export + * @interface ApiKey + */ +export interface ApiKey { + /** + * + * @type {string} + * @memberof ApiKey + */ + keyHash: string + /** + * Project or client name + * @type {string} + * @memberof ApiKey + */ + name: string + /** + * + * @type {ApikeyApiKeyType} + * @memberof ApiKey + */ + type: ApikeyApiKeyType +} + +/** + * Check if a given object implements the ApiKey interface. + */ +export function instanceOfApiKey(value: object): value is ApiKey { + if (!('keyHash' in value) || value['keyHash'] === undefined) return false + if (!('name' in value) || value['name'] === undefined) return false + if (!('type' in value) || value['type'] === undefined) return false + return true +} + +export function ApiKeyFromJSON(json: any): ApiKey { + return ApiKeyFromJSONTyped(json, false) +} + +export function ApiKeyFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): ApiKey { + if (json == null) { + return json + } + return { + keyHash: json['keyHash'], + name: json['name'], + type: ApikeyApiKeyTypeFromJSON(json['type']), + } +} + +export function ApiKeyToJSON(json: any): ApiKey { + return ApiKeyToJSONTyped(json, false) +} + +export function ApiKeyToJSONTyped( + value?: ApiKey | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + keyHash: value['keyHash'], + name: value['name'], + type: ApikeyApiKeyTypeToJSON(value['type']), + } +} diff --git a/packages/typescript/src/client/models/ApikeyApiKeyType.ts b/packages/typescript/src/client/models/ApikeyApiKeyType.ts new file mode 100644 index 0000000..5e63d0e --- /dev/null +++ b/packages/typescript/src/client/models/ApikeyApiKeyType.ts @@ -0,0 +1,58 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + */ +export const ApikeyApiKeyType = { + ApiKeyTypeClient: 'client', + ApiKeyTypeProject: 'project', + ApiKeyTypeWorkspace: 'workspace', +} as const +export type ApikeyApiKeyType = + (typeof ApikeyApiKeyType)[keyof typeof ApikeyApiKeyType] + +export function instanceOfApikeyApiKeyType(value: any): boolean { + for (const key in ApikeyApiKeyType) { + if (Object.prototype.hasOwnProperty.call(ApikeyApiKeyType, key)) { + if (ApikeyApiKeyType[key as keyof typeof ApikeyApiKeyType] === value) { + return true + } + } + } + return false +} + +export function ApikeyApiKeyTypeFromJSON(json: any): ApikeyApiKeyType { + return ApikeyApiKeyTypeFromJSONTyped(json, false) +} + +export function ApikeyApiKeyTypeFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): ApikeyApiKeyType { + return json as ApikeyApiKeyType +} + +export function ApikeyApiKeyTypeToJSON(value?: ApikeyApiKeyType | null): any { + return value as any +} + +export function ApikeyApiKeyTypeToJSONTyped( + value: any, + ignoreDiscriminator: boolean, +): ApikeyApiKeyType { + return value as ApikeyApiKeyType +} diff --git a/packages/typescript/src/client/models/Build.ts b/packages/typescript/src/client/models/Build.ts new file mode 100644 index 0000000..8a20318 --- /dev/null +++ b/packages/typescript/src/client/models/Build.ts @@ -0,0 +1,191 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +import type { ContainerConfig } from './ContainerConfig' +import { + ContainerConfigFromJSON, + ContainerConfigFromJSONTyped, + ContainerConfigToJSON, + ContainerConfigToJSONTyped, +} from './ContainerConfig' +import type { GitRepository } from './GitRepository' +import { + GitRepositoryFromJSON, + GitRepositoryFromJSONTyped, + GitRepositoryToJSON, + GitRepositoryToJSONTyped, +} from './GitRepository' +import type { BuildBuildState } from './BuildBuildState' +import { + BuildBuildStateFromJSON, + BuildBuildStateFromJSONTyped, + BuildBuildStateToJSON, + BuildBuildStateToJSONTyped, +} from './BuildBuildState' +import type { BuildConfig } from './BuildConfig' +import { + BuildConfigFromJSON, + BuildConfigFromJSONTyped, + BuildConfigToJSON, + BuildConfigToJSONTyped, +} from './BuildConfig' + +/** + * + * @export + * @interface Build + */ +export interface Build { + /** + * + * @type {BuildConfig} + * @memberof Build + */ + buildConfig?: BuildConfig + /** + * + * @type {ContainerConfig} + * @memberof Build + */ + containerConfig: ContainerConfig + /** + * + * @type {string} + * @memberof Build + */ + createdAt: string + /** + * + * @type {{ [key: string]: string; }} + * @memberof Build + */ + envVars: { [key: string]: string } + /** + * + * @type {string} + * @memberof Build + */ + id: string + /** + * + * @type {string} + * @memberof Build + */ + image?: string + /** + * + * @type {string} + * @memberof Build + */ + prebuildId: string + /** + * + * @type {GitRepository} + * @memberof Build + */ + repository: GitRepository + /** + * + * @type {BuildBuildState} + * @memberof Build + */ + state: BuildBuildState + /** + * + * @type {string} + * @memberof Build + */ + updatedAt: string + /** + * + * @type {string} + * @memberof Build + */ + user?: string +} + +/** + * Check if a given object implements the Build interface. + */ +export function instanceOfBuild(value: object): value is Build { + if (!('containerConfig' in value) || value['containerConfig'] === undefined) + return false + if (!('createdAt' in value) || value['createdAt'] === undefined) return false + if (!('envVars' in value) || value['envVars'] === undefined) return false + if (!('id' in value) || value['id'] === undefined) return false + if (!('prebuildId' in value) || value['prebuildId'] === undefined) + return false + if (!('repository' in value) || value['repository'] === undefined) + return false + if (!('state' in value) || value['state'] === undefined) return false + if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false + return true +} + +export function BuildFromJSON(json: any): Build { + return BuildFromJSONTyped(json, false) +} + +export function BuildFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): Build { + if (json == null) { + return json + } + return { + buildConfig: + json['buildConfig'] == null + ? undefined + : BuildConfigFromJSON(json['buildConfig']), + containerConfig: ContainerConfigFromJSON(json['containerConfig']), + createdAt: json['createdAt'], + envVars: json['envVars'], + id: json['id'], + image: json['image'] == null ? undefined : json['image'], + prebuildId: json['prebuildId'], + repository: GitRepositoryFromJSON(json['repository']), + state: BuildBuildStateFromJSON(json['state']), + updatedAt: json['updatedAt'], + user: json['user'] == null ? undefined : json['user'], + } +} + +export function BuildToJSON(json: any): Build { + return BuildToJSONTyped(json, false) +} + +export function BuildToJSONTyped( + value?: Build | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + buildConfig: BuildConfigToJSON(value['buildConfig']), + containerConfig: ContainerConfigToJSON(value['containerConfig']), + createdAt: value['createdAt'], + envVars: value['envVars'], + id: value['id'], + image: value['image'], + prebuildId: value['prebuildId'], + repository: GitRepositoryToJSON(value['repository']), + state: BuildBuildStateToJSON(value['state']), + updatedAt: value['updatedAt'], + user: value['user'], + } +} diff --git a/packages/typescript/src/client/models/BuildBuildState.ts b/packages/typescript/src/client/models/BuildBuildState.ts new file mode 100644 index 0000000..295ab9e --- /dev/null +++ b/packages/typescript/src/client/models/BuildBuildState.ts @@ -0,0 +1,63 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + */ +export const BuildBuildState = { + BuildStatePendingRun: 'pending-run', + BuildStateRunning: 'running', + BuildStateError: 'error', + BuildStateSuccess: 'success', + BuildStatePublished: 'published', + BuildStatePendingDelete: 'pending-delete', + BuildStatePendingForcedDelete: 'pending-forced-delete', + BuildStateDeleting: 'deleting', +} as const +export type BuildBuildState = + (typeof BuildBuildState)[keyof typeof BuildBuildState] + +export function instanceOfBuildBuildState(value: any): boolean { + for (const key in BuildBuildState) { + if (Object.prototype.hasOwnProperty.call(BuildBuildState, key)) { + if (BuildBuildState[key as keyof typeof BuildBuildState] === value) { + return true + } + } + } + return false +} + +export function BuildBuildStateFromJSON(json: any): BuildBuildState { + return BuildBuildStateFromJSONTyped(json, false) +} + +export function BuildBuildStateFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): BuildBuildState { + return json as BuildBuildState +} + +export function BuildBuildStateToJSON(value?: BuildBuildState | null): any { + return value as any +} + +export function BuildBuildStateToJSONTyped( + value: any, + ignoreDiscriminator: boolean, +): BuildBuildState { + return value as BuildBuildState +} diff --git a/packages/typescript/src/client/models/BuildConfig.ts b/packages/typescript/src/client/models/BuildConfig.ts new file mode 100644 index 0000000..290eab3 --- /dev/null +++ b/packages/typescript/src/client/models/BuildConfig.ts @@ -0,0 +1,97 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +import type { CachedBuild } from './CachedBuild' +import { + CachedBuildFromJSON, + CachedBuildFromJSONTyped, + CachedBuildToJSON, + CachedBuildToJSONTyped, +} from './CachedBuild' +import type { DevcontainerConfig } from './DevcontainerConfig' +import { + DevcontainerConfigFromJSON, + DevcontainerConfigFromJSONTyped, + DevcontainerConfigToJSON, + DevcontainerConfigToJSONTyped, +} from './DevcontainerConfig' + +/** + * + * @export + * @interface BuildConfig + */ +export interface BuildConfig { + /** + * + * @type {CachedBuild} + * @memberof BuildConfig + */ + cachedBuild?: CachedBuild + /** + * + * @type {DevcontainerConfig} + * @memberof BuildConfig + */ + devcontainer?: DevcontainerConfig +} + +/** + * Check if a given object implements the BuildConfig interface. + */ +export function instanceOfBuildConfig(value: object): value is BuildConfig { + return true +} + +export function BuildConfigFromJSON(json: any): BuildConfig { + return BuildConfigFromJSONTyped(json, false) +} + +export function BuildConfigFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): BuildConfig { + if (json == null) { + return json + } + return { + cachedBuild: + json['cachedBuild'] == null + ? undefined + : CachedBuildFromJSON(json['cachedBuild']), + devcontainer: + json['devcontainer'] == null + ? undefined + : DevcontainerConfigFromJSON(json['devcontainer']), + } +} + +export function BuildConfigToJSON(json: any): BuildConfig { + return BuildConfigToJSONTyped(json, false) +} + +export function BuildConfigToJSONTyped( + value?: BuildConfig | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + cachedBuild: CachedBuildToJSON(value['cachedBuild']), + devcontainer: DevcontainerConfigToJSON(value['devcontainer']), + } +} diff --git a/packages/typescript/src/client/models/CachedBuild.ts b/packages/typescript/src/client/models/CachedBuild.ts new file mode 100644 index 0000000..8a08630 --- /dev/null +++ b/packages/typescript/src/client/models/CachedBuild.ts @@ -0,0 +1,78 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface CachedBuild + */ +export interface CachedBuild { + /** + * + * @type {string} + * @memberof CachedBuild + */ + image: string + /** + * + * @type {string} + * @memberof CachedBuild + */ + user: string +} + +/** + * Check if a given object implements the CachedBuild interface. + */ +export function instanceOfCachedBuild(value: object): value is CachedBuild { + if (!('image' in value) || value['image'] === undefined) return false + if (!('user' in value) || value['user'] === undefined) return false + return true +} + +export function CachedBuildFromJSON(json: any): CachedBuild { + return CachedBuildFromJSONTyped(json, false) +} + +export function CachedBuildFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): CachedBuild { + if (json == null) { + return json + } + return { + image: json['image'], + user: json['user'], + } +} + +export function CachedBuildToJSON(json: any): CachedBuild { + return CachedBuildToJSONTyped(json, false) +} + +export function CachedBuildToJSONTyped( + value?: CachedBuild | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + image: value['image'], + user: value['user'], + } +} diff --git a/packages/typescript/src/client/models/CloneTarget.ts b/packages/typescript/src/client/models/CloneTarget.ts new file mode 100644 index 0000000..c56aa35 --- /dev/null +++ b/packages/typescript/src/client/models/CloneTarget.ts @@ -0,0 +1,56 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + */ +export const CloneTarget = { + CloneTargetBranch: 'branch', + CloneTargetCommit: 'commit', +} as const +export type CloneTarget = (typeof CloneTarget)[keyof typeof CloneTarget] + +export function instanceOfCloneTarget(value: any): boolean { + for (const key in CloneTarget) { + if (Object.prototype.hasOwnProperty.call(CloneTarget, key)) { + if (CloneTarget[key as keyof typeof CloneTarget] === value) { + return true + } + } + } + return false +} + +export function CloneTargetFromJSON(json: any): CloneTarget { + return CloneTargetFromJSONTyped(json, false) +} + +export function CloneTargetFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): CloneTarget { + return json as CloneTarget +} + +export function CloneTargetToJSON(value?: CloneTarget | null): any { + return value as any +} + +export function CloneTargetToJSONTyped( + value: any, + ignoreDiscriminator: boolean, +): CloneTarget { + return value as CloneTarget +} diff --git a/packages/typescript/src/client/models/CompletionContext.ts b/packages/typescript/src/client/models/CompletionContext.ts new file mode 100644 index 0000000..30ddbf4 --- /dev/null +++ b/packages/typescript/src/client/models/CompletionContext.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface CompletionContext + */ +export interface CompletionContext { + /** + * + * @type {string} + * @memberof CompletionContext + */ + triggerCharacter?: string + /** + * + * @type {number} + * @memberof CompletionContext + */ + triggerKind: number +} + +/** + * Check if a given object implements the CompletionContext interface. + */ +export function instanceOfCompletionContext( + value: object, +): value is CompletionContext { + if (!('triggerKind' in value) || value['triggerKind'] === undefined) + return false + return true +} + +export function CompletionContextFromJSON(json: any): CompletionContext { + return CompletionContextFromJSONTyped(json, false) +} + +export function CompletionContextFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): CompletionContext { + if (json == null) { + return json + } + return { + triggerCharacter: + json['triggerCharacter'] == null ? undefined : json['triggerCharacter'], + triggerKind: json['triggerKind'], + } +} + +export function CompletionContextToJSON(json: any): CompletionContext { + return CompletionContextToJSONTyped(json, false) +} + +export function CompletionContextToJSONTyped( + value?: CompletionContext | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + triggerCharacter: value['triggerCharacter'], + triggerKind: value['triggerKind'], + } +} diff --git a/packages/typescript/src/client/models/CompletionItem.ts b/packages/typescript/src/client/models/CompletionItem.ts new file mode 100644 index 0000000..077c15f --- /dev/null +++ b/packages/typescript/src/client/models/CompletionItem.ts @@ -0,0 +1,120 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface CompletionItem + */ +export interface CompletionItem { + /** + * + * @type {string} + * @memberof CompletionItem + */ + detail?: string + /** + * + * @type {object} + * @memberof CompletionItem + */ + documentation?: object + /** + * + * @type {string} + * @memberof CompletionItem + */ + filterText?: string + /** + * + * @type {string} + * @memberof CompletionItem + */ + insertText?: string + /** + * + * @type {number} + * @memberof CompletionItem + */ + kind?: number + /** + * + * @type {string} + * @memberof CompletionItem + */ + label: string + /** + * + * @type {string} + * @memberof CompletionItem + */ + sortText?: string +} + +/** + * Check if a given object implements the CompletionItem interface. + */ +export function instanceOfCompletionItem( + value: object, +): value is CompletionItem { + if (!('label' in value) || value['label'] === undefined) return false + return true +} + +export function CompletionItemFromJSON(json: any): CompletionItem { + return CompletionItemFromJSONTyped(json, false) +} + +export function CompletionItemFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): CompletionItem { + if (json == null) { + return json + } + return { + detail: json['detail'] == null ? undefined : json['detail'], + documentation: + json['documentation'] == null ? undefined : json['documentation'], + filterText: json['filterText'] == null ? undefined : json['filterText'], + insertText: json['insertText'] == null ? undefined : json['insertText'], + kind: json['kind'] == null ? undefined : json['kind'], + label: json['label'], + sortText: json['sortText'] == null ? undefined : json['sortText'], + } +} + +export function CompletionItemToJSON(json: any): CompletionItem { + return CompletionItemToJSONTyped(json, false) +} + +export function CompletionItemToJSONTyped( + value?: CompletionItem | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + detail: value['detail'], + documentation: value['documentation'], + filterText: value['filterText'], + insertText: value['insertText'], + kind: value['kind'], + label: value['label'], + sortText: value['sortText'], + } +} diff --git a/packages/typescript/src/client/models/CompletionList.ts b/packages/typescript/src/client/models/CompletionList.ts new file mode 100644 index 0000000..caa9ed2 --- /dev/null +++ b/packages/typescript/src/client/models/CompletionList.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +import type { CompletionItem } from './CompletionItem' +import { + CompletionItemFromJSON, + CompletionItemFromJSONTyped, + CompletionItemToJSON, + CompletionItemToJSONTyped, +} from './CompletionItem' + +/** + * + * @export + * @interface CompletionList + */ +export interface CompletionList { + /** + * + * @type {boolean} + * @memberof CompletionList + */ + isIncomplete: boolean + /** + * + * @type {Array} + * @memberof CompletionList + */ + items: Array +} + +/** + * Check if a given object implements the CompletionList interface. + */ +export function instanceOfCompletionList( + value: object, +): value is CompletionList { + if (!('isIncomplete' in value) || value['isIncomplete'] === undefined) + return false + if (!('items' in value) || value['items'] === undefined) return false + return true +} + +export function CompletionListFromJSON(json: any): CompletionList { + return CompletionListFromJSONTyped(json, false) +} + +export function CompletionListFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): CompletionList { + if (json == null) { + return json + } + return { + isIncomplete: json['isIncomplete'], + items: (json['items'] as Array).map(CompletionItemFromJSON), + } +} + +export function CompletionListToJSON(json: any): CompletionList { + return CompletionListToJSONTyped(json, false) +} + +export function CompletionListToJSONTyped( + value?: CompletionList | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + isIncomplete: value['isIncomplete'], + items: (value['items'] as Array).map(CompletionItemToJSON), + } +} diff --git a/packages/typescript/src/client/models/ContainerConfig.ts b/packages/typescript/src/client/models/ContainerConfig.ts new file mode 100644 index 0000000..0a99986 --- /dev/null +++ b/packages/typescript/src/client/models/ContainerConfig.ts @@ -0,0 +1,80 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface ContainerConfig + */ +export interface ContainerConfig { + /** + * + * @type {string} + * @memberof ContainerConfig + */ + image: string + /** + * + * @type {string} + * @memberof ContainerConfig + */ + user: string +} + +/** + * Check if a given object implements the ContainerConfig interface. + */ +export function instanceOfContainerConfig( + value: object, +): value is ContainerConfig { + if (!('image' in value) || value['image'] === undefined) return false + if (!('user' in value) || value['user'] === undefined) return false + return true +} + +export function ContainerConfigFromJSON(json: any): ContainerConfig { + return ContainerConfigFromJSONTyped(json, false) +} + +export function ContainerConfigFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): ContainerConfig { + if (json == null) { + return json + } + return { + image: json['image'], + user: json['user'], + } +} + +export function ContainerConfigToJSON(json: any): ContainerConfig { + return ContainerConfigToJSONTyped(json, false) +} + +export function ContainerConfigToJSONTyped( + value?: ContainerConfig | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + image: value['image'], + user: value['user'], + } +} diff --git a/packages/typescript/src/client/models/ContainerRegistry.ts b/packages/typescript/src/client/models/ContainerRegistry.ts new file mode 100644 index 0000000..4095e8d --- /dev/null +++ b/packages/typescript/src/client/models/ContainerRegistry.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface ContainerRegistry + */ +export interface ContainerRegistry { + /** + * + * @type {string} + * @memberof ContainerRegistry + */ + password: string + /** + * + * @type {string} + * @memberof ContainerRegistry + */ + server: string + /** + * + * @type {string} + * @memberof ContainerRegistry + */ + username: string +} + +/** + * Check if a given object implements the ContainerRegistry interface. + */ +export function instanceOfContainerRegistry( + value: object, +): value is ContainerRegistry { + if (!('password' in value) || value['password'] === undefined) return false + if (!('server' in value) || value['server'] === undefined) return false + if (!('username' in value) || value['username'] === undefined) return false + return true +} + +export function ContainerRegistryFromJSON(json: any): ContainerRegistry { + return ContainerRegistryFromJSONTyped(json, false) +} + +export function ContainerRegistryFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): ContainerRegistry { + if (json == null) { + return json + } + return { + password: json['password'], + server: json['server'], + username: json['username'], + } +} + +export function ContainerRegistryToJSON(json: any): ContainerRegistry { + return ContainerRegistryToJSONTyped(json, false) +} + +export function ContainerRegistryToJSONTyped( + value?: ContainerRegistry | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + password: value['password'], + server: value['server'], + username: value['username'], + } +} diff --git a/packages/typescript/src/client/models/CreateBuildDTO.ts b/packages/typescript/src/client/models/CreateBuildDTO.ts new file mode 100644 index 0000000..1e68be5 --- /dev/null +++ b/packages/typescript/src/client/models/CreateBuildDTO.ts @@ -0,0 +1,101 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface CreateBuildDTO + */ +export interface CreateBuildDTO { + /** + * + * @type {string} + * @memberof CreateBuildDTO + */ + branch: string + /** + * + * @type {{ [key: string]: string; }} + * @memberof CreateBuildDTO + */ + envVars: { [key: string]: string } + /** + * + * @type {string} + * @memberof CreateBuildDTO + */ + prebuildId?: string + /** + * + * @type {string} + * @memberof CreateBuildDTO + */ + projectConfigName: string +} + +/** + * Check if a given object implements the CreateBuildDTO interface. + */ +export function instanceOfCreateBuildDTO( + value: object, +): value is CreateBuildDTO { + if (!('branch' in value) || value['branch'] === undefined) return false + if (!('envVars' in value) || value['envVars'] === undefined) return false + if ( + !('projectConfigName' in value) || + value['projectConfigName'] === undefined + ) + return false + return true +} + +export function CreateBuildDTOFromJSON(json: any): CreateBuildDTO { + return CreateBuildDTOFromJSONTyped(json, false) +} + +export function CreateBuildDTOFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): CreateBuildDTO { + if (json == null) { + return json + } + return { + branch: json['branch'], + envVars: json['envVars'], + prebuildId: json['prebuildId'] == null ? undefined : json['prebuildId'], + projectConfigName: json['projectConfigName'], + } +} + +export function CreateBuildDTOToJSON(json: any): CreateBuildDTO { + return CreateBuildDTOToJSONTyped(json, false) +} + +export function CreateBuildDTOToJSONTyped( + value?: CreateBuildDTO | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + branch: value['branch'], + envVars: value['envVars'], + prebuildId: value['prebuildId'], + projectConfigName: value['projectConfigName'], + } +} diff --git a/packages/typescript/src/client/models/CreatePrebuildDTO.ts b/packages/typescript/src/client/models/CreatePrebuildDTO.ts new file mode 100644 index 0000000..9be4401 --- /dev/null +++ b/packages/typescript/src/client/models/CreatePrebuildDTO.ts @@ -0,0 +1,105 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface CreatePrebuildDTO + */ +export interface CreatePrebuildDTO { + /** + * + * @type {string} + * @memberof CreatePrebuildDTO + */ + branch?: string + /** + * + * @type {number} + * @memberof CreatePrebuildDTO + */ + commitInterval?: number + /** + * + * @type {string} + * @memberof CreatePrebuildDTO + */ + id?: string + /** + * + * @type {number} + * @memberof CreatePrebuildDTO + */ + retention: number + /** + * + * @type {Array} + * @memberof CreatePrebuildDTO + */ + triggerFiles?: Array +} + +/** + * Check if a given object implements the CreatePrebuildDTO interface. + */ +export function instanceOfCreatePrebuildDTO( + value: object, +): value is CreatePrebuildDTO { + if (!('retention' in value) || value['retention'] === undefined) return false + return true +} + +export function CreatePrebuildDTOFromJSON(json: any): CreatePrebuildDTO { + return CreatePrebuildDTOFromJSONTyped(json, false) +} + +export function CreatePrebuildDTOFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): CreatePrebuildDTO { + if (json == null) { + return json + } + return { + branch: json['branch'] == null ? undefined : json['branch'], + commitInterval: + json['commitInterval'] == null ? undefined : json['commitInterval'], + id: json['id'] == null ? undefined : json['id'], + retention: json['retention'], + triggerFiles: + json['triggerFiles'] == null ? undefined : json['triggerFiles'], + } +} + +export function CreatePrebuildDTOToJSON(json: any): CreatePrebuildDTO { + return CreatePrebuildDTOToJSONTyped(json, false) +} + +export function CreatePrebuildDTOToJSONTyped( + value?: CreatePrebuildDTO | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + branch: value['branch'], + commitInterval: value['commitInterval'], + id: value['id'], + retention: value['retention'], + triggerFiles: value['triggerFiles'], + } +} diff --git a/packages/typescript/src/client/models/CreateProjectConfigDTO.ts b/packages/typescript/src/client/models/CreateProjectConfigDTO.ts new file mode 100644 index 0000000..a8d4c1e --- /dev/null +++ b/packages/typescript/src/client/models/CreateProjectConfigDTO.ts @@ -0,0 +1,140 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +import type { BuildConfig } from './BuildConfig' +import { + BuildConfigFromJSON, + BuildConfigFromJSONTyped, + BuildConfigToJSON, + BuildConfigToJSONTyped, +} from './BuildConfig' + +/** + * + * @export + * @interface CreateProjectConfigDTO + */ +export interface CreateProjectConfigDTO { + /** + * + * @type {BuildConfig} + * @memberof CreateProjectConfigDTO + */ + buildConfig?: BuildConfig + /** + * + * @type {{ [key: string]: string; }} + * @memberof CreateProjectConfigDTO + */ + envVars: { [key: string]: string } + /** + * + * @type {string} + * @memberof CreateProjectConfigDTO + */ + gitProviderConfigId?: string + /** + * + * @type {string} + * @memberof CreateProjectConfigDTO + */ + image?: string + /** + * + * @type {string} + * @memberof CreateProjectConfigDTO + */ + name: string + /** + * + * @type {string} + * @memberof CreateProjectConfigDTO + */ + repositoryUrl: string + /** + * + * @type {string} + * @memberof CreateProjectConfigDTO + */ + user?: string +} + +/** + * Check if a given object implements the CreateProjectConfigDTO interface. + */ +export function instanceOfCreateProjectConfigDTO( + value: object, +): value is CreateProjectConfigDTO { + if (!('envVars' in value) || value['envVars'] === undefined) return false + if (!('name' in value) || value['name'] === undefined) return false + if (!('repositoryUrl' in value) || value['repositoryUrl'] === undefined) + return false + return true +} + +export function CreateProjectConfigDTOFromJSON( + json: any, +): CreateProjectConfigDTO { + return CreateProjectConfigDTOFromJSONTyped(json, false) +} + +export function CreateProjectConfigDTOFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): CreateProjectConfigDTO { + if (json == null) { + return json + } + return { + buildConfig: + json['buildConfig'] == null + ? undefined + : BuildConfigFromJSON(json['buildConfig']), + envVars: json['envVars'], + gitProviderConfigId: + json['gitProviderConfigId'] == null + ? undefined + : json['gitProviderConfigId'], + image: json['image'] == null ? undefined : json['image'], + name: json['name'], + repositoryUrl: json['repositoryUrl'], + user: json['user'] == null ? undefined : json['user'], + } +} + +export function CreateProjectConfigDTOToJSON( + json: any, +): CreateProjectConfigDTO { + return CreateProjectConfigDTOToJSONTyped(json, false) +} + +export function CreateProjectConfigDTOToJSONTyped( + value?: CreateProjectConfigDTO | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + buildConfig: BuildConfigToJSON(value['buildConfig']), + envVars: value['envVars'], + gitProviderConfigId: value['gitProviderConfigId'], + image: value['image'], + name: value['name'], + repositoryUrl: value['repositoryUrl'], + user: value['user'], + } +} diff --git a/packages/typescript/src/client/models/CreateProjectDTO.ts b/packages/typescript/src/client/models/CreateProjectDTO.ts new file mode 100644 index 0000000..5b7a491 --- /dev/null +++ b/packages/typescript/src/client/models/CreateProjectDTO.ts @@ -0,0 +1,142 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +import type { CreateProjectSourceDTO } from './CreateProjectSourceDTO' +import { + CreateProjectSourceDTOFromJSON, + CreateProjectSourceDTOFromJSONTyped, + CreateProjectSourceDTOToJSON, + CreateProjectSourceDTOToJSONTyped, +} from './CreateProjectSourceDTO' +import type { BuildConfig } from './BuildConfig' +import { + BuildConfigFromJSON, + BuildConfigFromJSONTyped, + BuildConfigToJSON, + BuildConfigToJSONTyped, +} from './BuildConfig' + +/** + * + * @export + * @interface CreateProjectDTO + */ +export interface CreateProjectDTO { + /** + * + * @type {BuildConfig} + * @memberof CreateProjectDTO + */ + buildConfig?: BuildConfig + /** + * + * @type {{ [key: string]: string; }} + * @memberof CreateProjectDTO + */ + envVars: { [key: string]: string } + /** + * + * @type {string} + * @memberof CreateProjectDTO + */ + gitProviderConfigId?: string + /** + * + * @type {string} + * @memberof CreateProjectDTO + */ + image?: string + /** + * + * @type {string} + * @memberof CreateProjectDTO + */ + name: string + /** + * + * @type {CreateProjectSourceDTO} + * @memberof CreateProjectDTO + */ + source: CreateProjectSourceDTO + /** + * + * @type {string} + * @memberof CreateProjectDTO + */ + user?: string +} + +/** + * Check if a given object implements the CreateProjectDTO interface. + */ +export function instanceOfCreateProjectDTO( + value: object, +): value is CreateProjectDTO { + if (!('envVars' in value) || value['envVars'] === undefined) return false + if (!('name' in value) || value['name'] === undefined) return false + if (!('source' in value) || value['source'] === undefined) return false + return true +} + +export function CreateProjectDTOFromJSON(json: any): CreateProjectDTO { + return CreateProjectDTOFromJSONTyped(json, false) +} + +export function CreateProjectDTOFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): CreateProjectDTO { + if (json == null) { + return json + } + return { + buildConfig: + json['buildConfig'] == null + ? undefined + : BuildConfigFromJSON(json['buildConfig']), + envVars: json['envVars'], + gitProviderConfigId: + json['gitProviderConfigId'] == null + ? undefined + : json['gitProviderConfigId'], + image: json['image'] == null ? undefined : json['image'], + name: json['name'], + source: CreateProjectSourceDTOFromJSON(json['source']), + user: json['user'] == null ? undefined : json['user'], + } +} + +export function CreateProjectDTOToJSON(json: any): CreateProjectDTO { + return CreateProjectDTOToJSONTyped(json, false) +} + +export function CreateProjectDTOToJSONTyped( + value?: CreateProjectDTO | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + buildConfig: BuildConfigToJSON(value['buildConfig']), + envVars: value['envVars'], + gitProviderConfigId: value['gitProviderConfigId'], + image: value['image'], + name: value['name'], + source: CreateProjectSourceDTOToJSON(value['source']), + user: value['user'], + } +} diff --git a/packages/typescript/src/client/models/CreateProjectSourceDTO.ts b/packages/typescript/src/client/models/CreateProjectSourceDTO.ts new file mode 100644 index 0000000..4e7720f --- /dev/null +++ b/packages/typescript/src/client/models/CreateProjectSourceDTO.ts @@ -0,0 +1,84 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +import type { GitRepository } from './GitRepository' +import { + GitRepositoryFromJSON, + GitRepositoryFromJSONTyped, + GitRepositoryToJSON, + GitRepositoryToJSONTyped, +} from './GitRepository' + +/** + * + * @export + * @interface CreateProjectSourceDTO + */ +export interface CreateProjectSourceDTO { + /** + * + * @type {GitRepository} + * @memberof CreateProjectSourceDTO + */ + repository: GitRepository +} + +/** + * Check if a given object implements the CreateProjectSourceDTO interface. + */ +export function instanceOfCreateProjectSourceDTO( + value: object, +): value is CreateProjectSourceDTO { + if (!('repository' in value) || value['repository'] === undefined) + return false + return true +} + +export function CreateProjectSourceDTOFromJSON( + json: any, +): CreateProjectSourceDTO { + return CreateProjectSourceDTOFromJSONTyped(json, false) +} + +export function CreateProjectSourceDTOFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): CreateProjectSourceDTO { + if (json == null) { + return json + } + return { + repository: GitRepositoryFromJSON(json['repository']), + } +} + +export function CreateProjectSourceDTOToJSON( + json: any, +): CreateProjectSourceDTO { + return CreateProjectSourceDTOToJSONTyped(json, false) +} + +export function CreateProjectSourceDTOToJSONTyped( + value?: CreateProjectSourceDTO | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + repository: GitRepositoryToJSON(value['repository']), + } +} diff --git a/packages/typescript/src/client/models/CreateProviderTargetDTO.ts b/packages/typescript/src/client/models/CreateProviderTargetDTO.ts new file mode 100644 index 0000000..178af2f --- /dev/null +++ b/packages/typescript/src/client/models/CreateProviderTargetDTO.ts @@ -0,0 +1,102 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +import type { ProviderProviderInfo } from './ProviderProviderInfo' +import { + ProviderProviderInfoFromJSON, + ProviderProviderInfoFromJSONTyped, + ProviderProviderInfoToJSON, + ProviderProviderInfoToJSONTyped, +} from './ProviderProviderInfo' + +/** + * + * @export + * @interface CreateProviderTargetDTO + */ +export interface CreateProviderTargetDTO { + /** + * + * @type {string} + * @memberof CreateProviderTargetDTO + */ + name: string + /** + * + * @type {string} + * @memberof CreateProviderTargetDTO + */ + options: string + /** + * + * @type {ProviderProviderInfo} + * @memberof CreateProviderTargetDTO + */ + providerInfo: ProviderProviderInfo +} + +/** + * Check if a given object implements the CreateProviderTargetDTO interface. + */ +export function instanceOfCreateProviderTargetDTO( + value: object, +): value is CreateProviderTargetDTO { + if (!('name' in value) || value['name'] === undefined) return false + if (!('options' in value) || value['options'] === undefined) return false + if (!('providerInfo' in value) || value['providerInfo'] === undefined) + return false + return true +} + +export function CreateProviderTargetDTOFromJSON( + json: any, +): CreateProviderTargetDTO { + return CreateProviderTargetDTOFromJSONTyped(json, false) +} + +export function CreateProviderTargetDTOFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): CreateProviderTargetDTO { + if (json == null) { + return json + } + return { + name: json['name'], + options: json['options'], + providerInfo: ProviderProviderInfoFromJSON(json['providerInfo']), + } +} + +export function CreateProviderTargetDTOToJSON( + json: any, +): CreateProviderTargetDTO { + return CreateProviderTargetDTOToJSONTyped(json, false) +} + +export function CreateProviderTargetDTOToJSONTyped( + value?: CreateProviderTargetDTO | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + name: value['name'], + options: value['options'], + providerInfo: ProviderProviderInfoToJSON(value['providerInfo']), + } +} diff --git a/packages/typescript/src/client/models/CreateWorkspaceDTO.ts b/packages/typescript/src/client/models/CreateWorkspaceDTO.ts new file mode 100644 index 0000000..e55cdde --- /dev/null +++ b/packages/typescript/src/client/models/CreateWorkspaceDTO.ts @@ -0,0 +1,106 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +import type { CreateProjectDTO } from './CreateProjectDTO' +import { + CreateProjectDTOFromJSON, + CreateProjectDTOFromJSONTyped, + CreateProjectDTOToJSON, + CreateProjectDTOToJSONTyped, +} from './CreateProjectDTO' + +/** + * + * @export + * @interface CreateWorkspaceDTO + */ +export interface CreateWorkspaceDTO { + /** + * + * @type {string} + * @memberof CreateWorkspaceDTO + */ + id: string + /** + * + * @type {string} + * @memberof CreateWorkspaceDTO + */ + name: string + /** + * + * @type {Array} + * @memberof CreateWorkspaceDTO + */ + projects: Array + /** + * + * @type {string} + * @memberof CreateWorkspaceDTO + */ + target: string +} + +/** + * Check if a given object implements the CreateWorkspaceDTO interface. + */ +export function instanceOfCreateWorkspaceDTO( + value: object, +): value is CreateWorkspaceDTO { + if (!('id' in value) || value['id'] === undefined) return false + if (!('name' in value) || value['name'] === undefined) return false + if (!('projects' in value) || value['projects'] === undefined) return false + if (!('target' in value) || value['target'] === undefined) return false + return true +} + +export function CreateWorkspaceDTOFromJSON(json: any): CreateWorkspaceDTO { + return CreateWorkspaceDTOFromJSONTyped(json, false) +} + +export function CreateWorkspaceDTOFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): CreateWorkspaceDTO { + if (json == null) { + return json + } + return { + id: json['id'], + name: json['name'], + projects: (json['projects'] as Array).map(CreateProjectDTOFromJSON), + target: json['target'], + } +} + +export function CreateWorkspaceDTOToJSON(json: any): CreateWorkspaceDTO { + return CreateWorkspaceDTOToJSONTyped(json, false) +} + +export function CreateWorkspaceDTOToJSONTyped( + value?: CreateWorkspaceDTO | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + id: value['id'], + name: value['name'], + projects: (value['projects'] as Array).map(CreateProjectDTOToJSON), + target: value['target'], + } +} diff --git a/packages/typescript/src/client/models/DevcontainerConfig.ts b/packages/typescript/src/client/models/DevcontainerConfig.ts new file mode 100644 index 0000000..8bd9680 --- /dev/null +++ b/packages/typescript/src/client/models/DevcontainerConfig.ts @@ -0,0 +1,71 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface DevcontainerConfig + */ +export interface DevcontainerConfig { + /** + * + * @type {string} + * @memberof DevcontainerConfig + */ + filePath: string +} + +/** + * Check if a given object implements the DevcontainerConfig interface. + */ +export function instanceOfDevcontainerConfig( + value: object, +): value is DevcontainerConfig { + if (!('filePath' in value) || value['filePath'] === undefined) return false + return true +} + +export function DevcontainerConfigFromJSON(json: any): DevcontainerConfig { + return DevcontainerConfigFromJSONTyped(json, false) +} + +export function DevcontainerConfigFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): DevcontainerConfig { + if (json == null) { + return json + } + return { + filePath: json['filePath'], + } +} + +export function DevcontainerConfigToJSON(json: any): DevcontainerConfig { + return DevcontainerConfigToJSONTyped(json, false) +} + +export function DevcontainerConfigToJSONTyped( + value?: DevcontainerConfig | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + filePath: value['filePath'], + } +} diff --git a/packages/typescript/src/client/models/ExecuteRequest.ts b/packages/typescript/src/client/models/ExecuteRequest.ts new file mode 100644 index 0000000..6492a24 --- /dev/null +++ b/packages/typescript/src/client/models/ExecuteRequest.ts @@ -0,0 +1,79 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface ExecuteRequest + */ +export interface ExecuteRequest { + /** + * + * @type {string} + * @memberof ExecuteRequest + */ + command: string + /** + * Timeout in seconds, defaults to 10 seconds + * @type {number} + * @memberof ExecuteRequest + */ + timeout?: number +} + +/** + * Check if a given object implements the ExecuteRequest interface. + */ +export function instanceOfExecuteRequest( + value: object, +): value is ExecuteRequest { + if (!('command' in value) || value['command'] === undefined) return false + return true +} + +export function ExecuteRequestFromJSON(json: any): ExecuteRequest { + return ExecuteRequestFromJSONTyped(json, false) +} + +export function ExecuteRequestFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): ExecuteRequest { + if (json == null) { + return json + } + return { + command: json['command'], + timeout: json['timeout'] == null ? undefined : json['timeout'], + } +} + +export function ExecuteRequestToJSON(json: any): ExecuteRequest { + return ExecuteRequestToJSONTyped(json, false) +} + +export function ExecuteRequestToJSONTyped( + value?: ExecuteRequest | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + command: value['command'], + timeout: value['timeout'], + } +} diff --git a/packages/typescript/src/client/models/ExecuteResponse.ts b/packages/typescript/src/client/models/ExecuteResponse.ts new file mode 100644 index 0000000..696eea0 --- /dev/null +++ b/packages/typescript/src/client/models/ExecuteResponse.ts @@ -0,0 +1,80 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface ExecuteResponse + */ +export interface ExecuteResponse { + /** + * + * @type {number} + * @memberof ExecuteResponse + */ + code: number + /** + * + * @type {string} + * @memberof ExecuteResponse + */ + result: string +} + +/** + * Check if a given object implements the ExecuteResponse interface. + */ +export function instanceOfExecuteResponse( + value: object, +): value is ExecuteResponse { + if (!('code' in value) || value['code'] === undefined) return false + if (!('result' in value) || value['result'] === undefined) return false + return true +} + +export function ExecuteResponseFromJSON(json: any): ExecuteResponse { + return ExecuteResponseFromJSONTyped(json, false) +} + +export function ExecuteResponseFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): ExecuteResponse { + if (json == null) { + return json + } + return { + code: json['code'], + result: json['result'], + } +} + +export function ExecuteResponseToJSON(json: any): ExecuteResponse { + return ExecuteResponseToJSONTyped(json, false) +} + +export function ExecuteResponseToJSONTyped( + value?: ExecuteResponse | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + code: value['code'], + result: value['result'], + } +} diff --git a/packages/typescript/src/client/models/FRPSConfig.ts b/packages/typescript/src/client/models/FRPSConfig.ts new file mode 100644 index 0000000..c371a1a --- /dev/null +++ b/packages/typescript/src/client/models/FRPSConfig.ts @@ -0,0 +1,87 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface FRPSConfig + */ +export interface FRPSConfig { + /** + * + * @type {string} + * @memberof FRPSConfig + */ + domain: string + /** + * + * @type {number} + * @memberof FRPSConfig + */ + port: number + /** + * + * @type {string} + * @memberof FRPSConfig + */ + protocol: string +} + +/** + * Check if a given object implements the FRPSConfig interface. + */ +export function instanceOfFRPSConfig(value: object): value is FRPSConfig { + if (!('domain' in value) || value['domain'] === undefined) return false + if (!('port' in value) || value['port'] === undefined) return false + if (!('protocol' in value) || value['protocol'] === undefined) return false + return true +} + +export function FRPSConfigFromJSON(json: any): FRPSConfig { + return FRPSConfigFromJSONTyped(json, false) +} + +export function FRPSConfigFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): FRPSConfig { + if (json == null) { + return json + } + return { + domain: json['domain'], + port: json['port'], + protocol: json['protocol'], + } +} + +export function FRPSConfigToJSON(json: any): FRPSConfig { + return FRPSConfigToJSONTyped(json, false) +} + +export function FRPSConfigToJSONTyped( + value?: FRPSConfig | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + domain: value['domain'], + port: value['port'], + protocol: value['protocol'], + } +} diff --git a/packages/typescript/src/client/models/FileInfo.ts b/packages/typescript/src/client/models/FileInfo.ts new file mode 100644 index 0000000..ffd50fc --- /dev/null +++ b/packages/typescript/src/client/models/FileInfo.ts @@ -0,0 +1,133 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface FileInfo + */ +export interface FileInfo { + /** + * + * @type {string} + * @memberof FileInfo + */ + group: string + /** + * + * @type {boolean} + * @memberof FileInfo + */ + isDir: boolean + /** + * + * @type {string} + * @memberof FileInfo + */ + modTime: string + /** + * + * @type {string} + * @memberof FileInfo + */ + mode: string + /** + * + * @type {string} + * @memberof FileInfo + */ + name: string + /** + * + * @type {string} + * @memberof FileInfo + */ + owner: string + /** + * + * @type {string} + * @memberof FileInfo + */ + permissions: string + /** + * + * @type {number} + * @memberof FileInfo + */ + size: number +} + +/** + * Check if a given object implements the FileInfo interface. + */ +export function instanceOfFileInfo(value: object): value is FileInfo { + if (!('group' in value) || value['group'] === undefined) return false + if (!('isDir' in value) || value['isDir'] === undefined) return false + if (!('modTime' in value) || value['modTime'] === undefined) return false + if (!('mode' in value) || value['mode'] === undefined) return false + if (!('name' in value) || value['name'] === undefined) return false + if (!('owner' in value) || value['owner'] === undefined) return false + if (!('permissions' in value) || value['permissions'] === undefined) + return false + if (!('size' in value) || value['size'] === undefined) return false + return true +} + +export function FileInfoFromJSON(json: any): FileInfo { + return FileInfoFromJSONTyped(json, false) +} + +export function FileInfoFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): FileInfo { + if (json == null) { + return json + } + return { + group: json['group'], + isDir: json['isDir'], + modTime: json['modTime'], + mode: json['mode'], + name: json['name'], + owner: json['owner'], + permissions: json['permissions'], + size: json['size'], + } +} + +export function FileInfoToJSON(json: any): FileInfo { + return FileInfoToJSONTyped(json, false) +} + +export function FileInfoToJSONTyped( + value?: FileInfo | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + group: value['group'], + isDir: value['isDir'], + modTime: value['modTime'], + mode: value['mode'], + name: value['name'], + owner: value['owner'], + permissions: value['permissions'], + size: value['size'], + } +} diff --git a/packages/typescript/src/client/models/FileStatus.ts b/packages/typescript/src/client/models/FileStatus.ts new file mode 100644 index 0000000..d7de3d3 --- /dev/null +++ b/packages/typescript/src/client/models/FileStatus.ts @@ -0,0 +1,104 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +import type { Status } from './Status' +import { + StatusFromJSON, + StatusFromJSONTyped, + StatusToJSON, + StatusToJSONTyped, +} from './Status' + +/** + * + * @export + * @interface FileStatus + */ +export interface FileStatus { + /** + * + * @type {string} + * @memberof FileStatus + */ + extra: string + /** + * + * @type {string} + * @memberof FileStatus + */ + name: string + /** + * + * @type {Status} + * @memberof FileStatus + */ + staging: Status + /** + * + * @type {Status} + * @memberof FileStatus + */ + worktree: Status +} + +/** + * Check if a given object implements the FileStatus interface. + */ +export function instanceOfFileStatus(value: object): value is FileStatus { + if (!('extra' in value) || value['extra'] === undefined) return false + if (!('name' in value) || value['name'] === undefined) return false + if (!('staging' in value) || value['staging'] === undefined) return false + if (!('worktree' in value) || value['worktree'] === undefined) return false + return true +} + +export function FileStatusFromJSON(json: any): FileStatus { + return FileStatusFromJSONTyped(json, false) +} + +export function FileStatusFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): FileStatus { + if (json == null) { + return json + } + return { + extra: json['extra'], + name: json['name'], + staging: StatusFromJSON(json['staging']), + worktree: StatusFromJSON(json['worktree']), + } +} + +export function FileStatusToJSON(json: any): FileStatus { + return FileStatusToJSONTyped(json, false) +} + +export function FileStatusToJSONTyped( + value?: FileStatus | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + extra: value['extra'], + name: value['name'], + staging: StatusToJSON(value['staging']), + worktree: StatusToJSON(value['worktree']), + } +} diff --git a/packages/typescript/src/client/models/GetRepositoryContext.ts b/packages/typescript/src/client/models/GetRepositoryContext.ts new file mode 100644 index 0000000..64cfae5 --- /dev/null +++ b/packages/typescript/src/client/models/GetRepositoryContext.ts @@ -0,0 +1,135 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface GetRepositoryContext + */ +export interface GetRepositoryContext { + /** + * + * @type {string} + * @memberof GetRepositoryContext + */ + branch?: string + /** + * + * @type {string} + * @memberof GetRepositoryContext + */ + id?: string + /** + * + * @type {string} + * @memberof GetRepositoryContext + */ + name?: string + /** + * + * @type {string} + * @memberof GetRepositoryContext + */ + owner?: string + /** + * + * @type {string} + * @memberof GetRepositoryContext + */ + path?: string + /** + * + * @type {number} + * @memberof GetRepositoryContext + */ + prNumber?: number + /** + * + * @type {string} + * @memberof GetRepositoryContext + */ + sha?: string + /** + * + * @type {string} + * @memberof GetRepositoryContext + */ + source?: string + /** + * + * @type {string} + * @memberof GetRepositoryContext + */ + url: string +} + +/** + * Check if a given object implements the GetRepositoryContext interface. + */ +export function instanceOfGetRepositoryContext( + value: object, +): value is GetRepositoryContext { + if (!('url' in value) || value['url'] === undefined) return false + return true +} + +export function GetRepositoryContextFromJSON(json: any): GetRepositoryContext { + return GetRepositoryContextFromJSONTyped(json, false) +} + +export function GetRepositoryContextFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): GetRepositoryContext { + if (json == null) { + return json + } + return { + branch: json['branch'] == null ? undefined : json['branch'], + id: json['id'] == null ? undefined : json['id'], + name: json['name'] == null ? undefined : json['name'], + owner: json['owner'] == null ? undefined : json['owner'], + path: json['path'] == null ? undefined : json['path'], + prNumber: json['prNumber'] == null ? undefined : json['prNumber'], + sha: json['sha'] == null ? undefined : json['sha'], + source: json['source'] == null ? undefined : json['source'], + url: json['url'], + } +} + +export function GetRepositoryContextToJSON(json: any): GetRepositoryContext { + return GetRepositoryContextToJSONTyped(json, false) +} + +export function GetRepositoryContextToJSONTyped( + value?: GetRepositoryContext | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + branch: value['branch'], + id: value['id'], + name: value['name'], + owner: value['owner'], + path: value['path'], + prNumber: value['prNumber'], + sha: value['sha'], + source: value['source'], + url: value['url'], + } +} diff --git a/packages/typescript/src/client/models/GitAddRequest.ts b/packages/typescript/src/client/models/GitAddRequest.ts new file mode 100644 index 0000000..709cc2f --- /dev/null +++ b/packages/typescript/src/client/models/GitAddRequest.ts @@ -0,0 +1,78 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface GitAddRequest + */ +export interface GitAddRequest { + /** + * files to add (use . for all files) + * @type {Array} + * @memberof GitAddRequest + */ + files: Array + /** + * + * @type {string} + * @memberof GitAddRequest + */ + path: string +} + +/** + * Check if a given object implements the GitAddRequest interface. + */ +export function instanceOfGitAddRequest(value: object): value is GitAddRequest { + if (!('files' in value) || value['files'] === undefined) return false + if (!('path' in value) || value['path'] === undefined) return false + return true +} + +export function GitAddRequestFromJSON(json: any): GitAddRequest { + return GitAddRequestFromJSONTyped(json, false) +} + +export function GitAddRequestFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): GitAddRequest { + if (json == null) { + return json + } + return { + files: json['files'], + path: json['path'], + } +} + +export function GitAddRequestToJSON(json: any): GitAddRequest { + return GitAddRequestToJSONTyped(json, false) +} + +export function GitAddRequestToJSONTyped( + value?: GitAddRequest | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + files: value['files'], + path: value['path'], + } +} diff --git a/packages/typescript/src/client/models/GitBranch.ts b/packages/typescript/src/client/models/GitBranch.ts new file mode 100644 index 0000000..37c6130 --- /dev/null +++ b/packages/typescript/src/client/models/GitBranch.ts @@ -0,0 +1,78 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface GitBranch + */ +export interface GitBranch { + /** + * + * @type {string} + * @memberof GitBranch + */ + name: string + /** + * + * @type {string} + * @memberof GitBranch + */ + sha: string +} + +/** + * Check if a given object implements the GitBranch interface. + */ +export function instanceOfGitBranch(value: object): value is GitBranch { + if (!('name' in value) || value['name'] === undefined) return false + if (!('sha' in value) || value['sha'] === undefined) return false + return true +} + +export function GitBranchFromJSON(json: any): GitBranch { + return GitBranchFromJSONTyped(json, false) +} + +export function GitBranchFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): GitBranch { + if (json == null) { + return json + } + return { + name: json['name'], + sha: json['sha'], + } +} + +export function GitBranchToJSON(json: any): GitBranch { + return GitBranchToJSONTyped(json, false) +} + +export function GitBranchToJSONTyped( + value?: GitBranch | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + name: value['name'], + sha: value['sha'], + } +} diff --git a/packages/typescript/src/client/models/GitBranchRequest.ts b/packages/typescript/src/client/models/GitBranchRequest.ts new file mode 100644 index 0000000..5cbff5c --- /dev/null +++ b/packages/typescript/src/client/models/GitBranchRequest.ts @@ -0,0 +1,80 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface GitBranchRequest + */ +export interface GitBranchRequest { + /** + * + * @type {string} + * @memberof GitBranchRequest + */ + name: string + /** + * + * @type {string} + * @memberof GitBranchRequest + */ + path: string +} + +/** + * Check if a given object implements the GitBranchRequest interface. + */ +export function instanceOfGitBranchRequest( + value: object, +): value is GitBranchRequest { + if (!('name' in value) || value['name'] === undefined) return false + if (!('path' in value) || value['path'] === undefined) return false + return true +} + +export function GitBranchRequestFromJSON(json: any): GitBranchRequest { + return GitBranchRequestFromJSONTyped(json, false) +} + +export function GitBranchRequestFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): GitBranchRequest { + if (json == null) { + return json + } + return { + name: json['name'], + path: json['path'], + } +} + +export function GitBranchRequestToJSON(json: any): GitBranchRequest { + return GitBranchRequestToJSONTyped(json, false) +} + +export function GitBranchRequestToJSONTyped( + value?: GitBranchRequest | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + name: value['name'], + path: value['path'], + } +} diff --git a/packages/typescript/src/client/models/GitCloneRequest.ts b/packages/typescript/src/client/models/GitCloneRequest.ts new file mode 100644 index 0000000..0f37045 --- /dev/null +++ b/packages/typescript/src/client/models/GitCloneRequest.ts @@ -0,0 +1,112 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface GitCloneRequest + */ +export interface GitCloneRequest { + /** + * + * @type {string} + * @memberof GitCloneRequest + */ + branch?: string + /** + * + * @type {string} + * @memberof GitCloneRequest + */ + commitId?: string + /** + * + * @type {string} + * @memberof GitCloneRequest + */ + password?: string + /** + * + * @type {string} + * @memberof GitCloneRequest + */ + path: string + /** + * + * @type {string} + * @memberof GitCloneRequest + */ + url: string + /** + * + * @type {string} + * @memberof GitCloneRequest + */ + username?: string +} + +/** + * Check if a given object implements the GitCloneRequest interface. + */ +export function instanceOfGitCloneRequest( + value: object, +): value is GitCloneRequest { + if (!('path' in value) || value['path'] === undefined) return false + if (!('url' in value) || value['url'] === undefined) return false + return true +} + +export function GitCloneRequestFromJSON(json: any): GitCloneRequest { + return GitCloneRequestFromJSONTyped(json, false) +} + +export function GitCloneRequestFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): GitCloneRequest { + if (json == null) { + return json + } + return { + branch: json['branch'] == null ? undefined : json['branch'], + commitId: json['commit_id'] == null ? undefined : json['commit_id'], + password: json['password'] == null ? undefined : json['password'], + path: json['path'], + url: json['url'], + username: json['username'] == null ? undefined : json['username'], + } +} + +export function GitCloneRequestToJSON(json: any): GitCloneRequest { + return GitCloneRequestToJSONTyped(json, false) +} + +export function GitCloneRequestToJSONTyped( + value?: GitCloneRequest | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + branch: value['branch'], + commit_id: value['commitId'], + password: value['password'], + path: value['path'], + url: value['url'], + username: value['username'], + } +} diff --git a/packages/typescript/src/client/models/GitCommitInfo.ts b/packages/typescript/src/client/models/GitCommitInfo.ts new file mode 100644 index 0000000..b23e839 --- /dev/null +++ b/packages/typescript/src/client/models/GitCommitInfo.ts @@ -0,0 +1,105 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface GitCommitInfo + */ +export interface GitCommitInfo { + /** + * + * @type {string} + * @memberof GitCommitInfo + */ + author: string + /** + * + * @type {string} + * @memberof GitCommitInfo + */ + email: string + /** + * + * @type {string} + * @memberof GitCommitInfo + */ + hash: string + /** + * + * @type {string} + * @memberof GitCommitInfo + */ + message: string + /** + * + * @type {string} + * @memberof GitCommitInfo + */ + timestamp: string +} + +/** + * Check if a given object implements the GitCommitInfo interface. + */ +export function instanceOfGitCommitInfo(value: object): value is GitCommitInfo { + if (!('author' in value) || value['author'] === undefined) return false + if (!('email' in value) || value['email'] === undefined) return false + if (!('hash' in value) || value['hash'] === undefined) return false + if (!('message' in value) || value['message'] === undefined) return false + if (!('timestamp' in value) || value['timestamp'] === undefined) return false + return true +} + +export function GitCommitInfoFromJSON(json: any): GitCommitInfo { + return GitCommitInfoFromJSONTyped(json, false) +} + +export function GitCommitInfoFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): GitCommitInfo { + if (json == null) { + return json + } + return { + author: json['author'], + email: json['email'], + hash: json['hash'], + message: json['message'], + timestamp: json['timestamp'], + } +} + +export function GitCommitInfoToJSON(json: any): GitCommitInfo { + return GitCommitInfoToJSONTyped(json, false) +} + +export function GitCommitInfoToJSONTyped( + value?: GitCommitInfo | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + author: value['author'], + email: value['email'], + hash: value['hash'], + message: value['message'], + timestamp: value['timestamp'], + } +} diff --git a/packages/typescript/src/client/models/GitCommitRequest.ts b/packages/typescript/src/client/models/GitCommitRequest.ts new file mode 100644 index 0000000..0d0ccb4 --- /dev/null +++ b/packages/typescript/src/client/models/GitCommitRequest.ts @@ -0,0 +1,98 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface GitCommitRequest + */ +export interface GitCommitRequest { + /** + * + * @type {string} + * @memberof GitCommitRequest + */ + author: string + /** + * + * @type {string} + * @memberof GitCommitRequest + */ + email: string + /** + * + * @type {string} + * @memberof GitCommitRequest + */ + message: string + /** + * + * @type {string} + * @memberof GitCommitRequest + */ + path: string +} + +/** + * Check if a given object implements the GitCommitRequest interface. + */ +export function instanceOfGitCommitRequest( + value: object, +): value is GitCommitRequest { + if (!('author' in value) || value['author'] === undefined) return false + if (!('email' in value) || value['email'] === undefined) return false + if (!('message' in value) || value['message'] === undefined) return false + if (!('path' in value) || value['path'] === undefined) return false + return true +} + +export function GitCommitRequestFromJSON(json: any): GitCommitRequest { + return GitCommitRequestFromJSONTyped(json, false) +} + +export function GitCommitRequestFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): GitCommitRequest { + if (json == null) { + return json + } + return { + author: json['author'], + email: json['email'], + message: json['message'], + path: json['path'], + } +} + +export function GitCommitRequestToJSON(json: any): GitCommitRequest { + return GitCommitRequestToJSONTyped(json, false) +} + +export function GitCommitRequestToJSONTyped( + value?: GitCommitRequest | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + author: value['author'], + email: value['email'], + message: value['message'], + path: value['path'], + } +} diff --git a/packages/typescript/src/client/models/GitCommitResponse.ts b/packages/typescript/src/client/models/GitCommitResponse.ts new file mode 100644 index 0000000..ba2603c --- /dev/null +++ b/packages/typescript/src/client/models/GitCommitResponse.ts @@ -0,0 +1,71 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface GitCommitResponse + */ +export interface GitCommitResponse { + /** + * + * @type {string} + * @memberof GitCommitResponse + */ + hash: string +} + +/** + * Check if a given object implements the GitCommitResponse interface. + */ +export function instanceOfGitCommitResponse( + value: object, +): value is GitCommitResponse { + if (!('hash' in value) || value['hash'] === undefined) return false + return true +} + +export function GitCommitResponseFromJSON(json: any): GitCommitResponse { + return GitCommitResponseFromJSONTyped(json, false) +} + +export function GitCommitResponseFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): GitCommitResponse { + if (json == null) { + return json + } + return { + hash: json['hash'], + } +} + +export function GitCommitResponseToJSON(json: any): GitCommitResponse { + return GitCommitResponseToJSONTyped(json, false) +} + +export function GitCommitResponseToJSONTyped( + value?: GitCommitResponse | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + hash: value['hash'], + } +} diff --git a/packages/typescript/src/client/models/GitNamespace.ts b/packages/typescript/src/client/models/GitNamespace.ts new file mode 100644 index 0000000..8db18bc --- /dev/null +++ b/packages/typescript/src/client/models/GitNamespace.ts @@ -0,0 +1,78 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface GitNamespace + */ +export interface GitNamespace { + /** + * + * @type {string} + * @memberof GitNamespace + */ + id: string + /** + * + * @type {string} + * @memberof GitNamespace + */ + name: string +} + +/** + * Check if a given object implements the GitNamespace interface. + */ +export function instanceOfGitNamespace(value: object): value is GitNamespace { + if (!('id' in value) || value['id'] === undefined) return false + if (!('name' in value) || value['name'] === undefined) return false + return true +} + +export function GitNamespaceFromJSON(json: any): GitNamespace { + return GitNamespaceFromJSONTyped(json, false) +} + +export function GitNamespaceFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): GitNamespace { + if (json == null) { + return json + } + return { + id: json['id'], + name: json['name'], + } +} + +export function GitNamespaceToJSON(json: any): GitNamespace { + return GitNamespaceToJSONTyped(json, false) +} + +export function GitNamespaceToJSONTyped( + value?: GitNamespace | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + id: value['id'], + name: value['name'], + } +} diff --git a/packages/typescript/src/client/models/GitProvider.ts b/packages/typescript/src/client/models/GitProvider.ts new file mode 100644 index 0000000..e013cda --- /dev/null +++ b/packages/typescript/src/client/models/GitProvider.ts @@ -0,0 +1,141 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +import type { SigningMethod } from './SigningMethod' +import { + SigningMethodFromJSON, + SigningMethodFromJSONTyped, + SigningMethodToJSON, + SigningMethodToJSONTyped, +} from './SigningMethod' + +/** + * + * @export + * @interface GitProvider + */ +export interface GitProvider { + /** + * + * @type {string} + * @memberof GitProvider + */ + alias: string + /** + * + * @type {string} + * @memberof GitProvider + */ + baseApiUrl?: string + /** + * + * @type {string} + * @memberof GitProvider + */ + id: string + /** + * + * @type {string} + * @memberof GitProvider + */ + providerId: string + /** + * + * @type {string} + * @memberof GitProvider + */ + signingKey?: string + /** + * + * @type {SigningMethod} + * @memberof GitProvider + */ + signingMethod?: SigningMethod + /** + * + * @type {string} + * @memberof GitProvider + */ + token: string + /** + * + * @type {string} + * @memberof GitProvider + */ + username: string +} + +/** + * Check if a given object implements the GitProvider interface. + */ +export function instanceOfGitProvider(value: object): value is GitProvider { + if (!('alias' in value) || value['alias'] === undefined) return false + if (!('id' in value) || value['id'] === undefined) return false + if (!('providerId' in value) || value['providerId'] === undefined) + return false + if (!('token' in value) || value['token'] === undefined) return false + if (!('username' in value) || value['username'] === undefined) return false + return true +} + +export function GitProviderFromJSON(json: any): GitProvider { + return GitProviderFromJSONTyped(json, false) +} + +export function GitProviderFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): GitProvider { + if (json == null) { + return json + } + return { + alias: json['alias'], + baseApiUrl: json['baseApiUrl'] == null ? undefined : json['baseApiUrl'], + id: json['id'], + providerId: json['providerId'], + signingKey: json['signingKey'] == null ? undefined : json['signingKey'], + signingMethod: + json['signingMethod'] == null + ? undefined + : SigningMethodFromJSON(json['signingMethod']), + token: json['token'], + username: json['username'], + } +} + +export function GitProviderToJSON(json: any): GitProvider { + return GitProviderToJSONTyped(json, false) +} + +export function GitProviderToJSONTyped( + value?: GitProvider | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + alias: value['alias'], + baseApiUrl: value['baseApiUrl'], + id: value['id'], + providerId: value['providerId'], + signingKey: value['signingKey'], + signingMethod: SigningMethodToJSON(value['signingMethod']), + token: value['token'], + username: value['username'], + } +} diff --git a/packages/typescript/src/client/models/GitPullRequest.ts b/packages/typescript/src/client/models/GitPullRequest.ts new file mode 100644 index 0000000..45a12fc --- /dev/null +++ b/packages/typescript/src/client/models/GitPullRequest.ts @@ -0,0 +1,129 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface GitPullRequest + */ +export interface GitPullRequest { + /** + * + * @type {string} + * @memberof GitPullRequest + */ + branch: string + /** + * + * @type {string} + * @memberof GitPullRequest + */ + name: string + /** + * + * @type {string} + * @memberof GitPullRequest + */ + sha: string + /** + * + * @type {string} + * @memberof GitPullRequest + */ + sourceRepoId: string + /** + * + * @type {string} + * @memberof GitPullRequest + */ + sourceRepoName: string + /** + * + * @type {string} + * @memberof GitPullRequest + */ + sourceRepoOwner: string + /** + * + * @type {string} + * @memberof GitPullRequest + */ + sourceRepoUrl: string +} + +/** + * Check if a given object implements the GitPullRequest interface. + */ +export function instanceOfGitPullRequest( + value: object, +): value is GitPullRequest { + if (!('branch' in value) || value['branch'] === undefined) return false + if (!('name' in value) || value['name'] === undefined) return false + if (!('sha' in value) || value['sha'] === undefined) return false + if (!('sourceRepoId' in value) || value['sourceRepoId'] === undefined) + return false + if (!('sourceRepoName' in value) || value['sourceRepoName'] === undefined) + return false + if (!('sourceRepoOwner' in value) || value['sourceRepoOwner'] === undefined) + return false + if (!('sourceRepoUrl' in value) || value['sourceRepoUrl'] === undefined) + return false + return true +} + +export function GitPullRequestFromJSON(json: any): GitPullRequest { + return GitPullRequestFromJSONTyped(json, false) +} + +export function GitPullRequestFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): GitPullRequest { + if (json == null) { + return json + } + return { + branch: json['branch'], + name: json['name'], + sha: json['sha'], + sourceRepoId: json['sourceRepoId'], + sourceRepoName: json['sourceRepoName'], + sourceRepoOwner: json['sourceRepoOwner'], + sourceRepoUrl: json['sourceRepoUrl'], + } +} + +export function GitPullRequestToJSON(json: any): GitPullRequest { + return GitPullRequestToJSONTyped(json, false) +} + +export function GitPullRequestToJSONTyped( + value?: GitPullRequest | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + branch: value['branch'], + name: value['name'], + sha: value['sha'], + sourceRepoId: value['sourceRepoId'], + sourceRepoName: value['sourceRepoName'], + sourceRepoOwner: value['sourceRepoOwner'], + sourceRepoUrl: value['sourceRepoUrl'], + } +} diff --git a/packages/typescript/src/client/models/GitRepoRequest.ts b/packages/typescript/src/client/models/GitRepoRequest.ts new file mode 100644 index 0000000..54c0c10 --- /dev/null +++ b/packages/typescript/src/client/models/GitRepoRequest.ts @@ -0,0 +1,87 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface GitRepoRequest + */ +export interface GitRepoRequest { + /** + * + * @type {string} + * @memberof GitRepoRequest + */ + password?: string + /** + * + * @type {string} + * @memberof GitRepoRequest + */ + path: string + /** + * + * @type {string} + * @memberof GitRepoRequest + */ + username?: string +} + +/** + * Check if a given object implements the GitRepoRequest interface. + */ +export function instanceOfGitRepoRequest( + value: object, +): value is GitRepoRequest { + if (!('path' in value) || value['path'] === undefined) return false + return true +} + +export function GitRepoRequestFromJSON(json: any): GitRepoRequest { + return GitRepoRequestFromJSONTyped(json, false) +} + +export function GitRepoRequestFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): GitRepoRequest { + if (json == null) { + return json + } + return { + password: json['password'] == null ? undefined : json['password'], + path: json['path'], + username: json['username'] == null ? undefined : json['username'], + } +} + +export function GitRepoRequestToJSON(json: any): GitRepoRequest { + return GitRepoRequestToJSONTyped(json, false) +} + +export function GitRepoRequestToJSONTyped( + value?: GitRepoRequest | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + password: value['password'], + path: value['path'], + username: value['username'], + } +} diff --git a/packages/typescript/src/client/models/GitRepository.ts b/packages/typescript/src/client/models/GitRepository.ts new file mode 100644 index 0000000..0a4113d --- /dev/null +++ b/packages/typescript/src/client/models/GitRepository.ts @@ -0,0 +1,158 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +import type { CloneTarget } from './CloneTarget' +import { + CloneTargetFromJSON, + CloneTargetFromJSONTyped, + CloneTargetToJSON, + CloneTargetToJSONTyped, +} from './CloneTarget' + +/** + * + * @export + * @interface GitRepository + */ +export interface GitRepository { + /** + * + * @type {string} + * @memberof GitRepository + */ + branch: string + /** + * + * @type {CloneTarget} + * @memberof GitRepository + */ + cloneTarget?: CloneTarget + /** + * + * @type {string} + * @memberof GitRepository + */ + id: string + /** + * + * @type {string} + * @memberof GitRepository + */ + name: string + /** + * + * @type {string} + * @memberof GitRepository + */ + owner: string + /** + * + * @type {string} + * @memberof GitRepository + */ + path?: string + /** + * + * @type {number} + * @memberof GitRepository + */ + prNumber?: number + /** + * + * @type {string} + * @memberof GitRepository + */ + sha: string + /** + * + * @type {string} + * @memberof GitRepository + */ + source: string + /** + * + * @type {string} + * @memberof GitRepository + */ + url: string +} + +/** + * Check if a given object implements the GitRepository interface. + */ +export function instanceOfGitRepository(value: object): value is GitRepository { + if (!('branch' in value) || value['branch'] === undefined) return false + if (!('id' in value) || value['id'] === undefined) return false + if (!('name' in value) || value['name'] === undefined) return false + if (!('owner' in value) || value['owner'] === undefined) return false + if (!('sha' in value) || value['sha'] === undefined) return false + if (!('source' in value) || value['source'] === undefined) return false + if (!('url' in value) || value['url'] === undefined) return false + return true +} + +export function GitRepositoryFromJSON(json: any): GitRepository { + return GitRepositoryFromJSONTyped(json, false) +} + +export function GitRepositoryFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): GitRepository { + if (json == null) { + return json + } + return { + branch: json['branch'], + cloneTarget: + json['cloneTarget'] == null + ? undefined + : CloneTargetFromJSON(json['cloneTarget']), + id: json['id'], + name: json['name'], + owner: json['owner'], + path: json['path'] == null ? undefined : json['path'], + prNumber: json['prNumber'] == null ? undefined : json['prNumber'], + sha: json['sha'], + source: json['source'], + url: json['url'], + } +} + +export function GitRepositoryToJSON(json: any): GitRepository { + return GitRepositoryToJSONTyped(json, false) +} + +export function GitRepositoryToJSONTyped( + value?: GitRepository | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + branch: value['branch'], + cloneTarget: CloneTargetToJSON(value['cloneTarget']), + id: value['id'], + name: value['name'], + owner: value['owner'], + path: value['path'], + prNumber: value['prNumber'], + sha: value['sha'], + source: value['source'], + url: value['url'], + } +} diff --git a/packages/typescript/src/client/models/GitStatus.ts b/packages/typescript/src/client/models/GitStatus.ts new file mode 100644 index 0000000..2e9d53e --- /dev/null +++ b/packages/typescript/src/client/models/GitStatus.ts @@ -0,0 +1,113 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +import type { FileStatus } from './FileStatus' +import { + FileStatusFromJSON, + FileStatusFromJSONTyped, + FileStatusToJSON, + FileStatusToJSONTyped, +} from './FileStatus' + +/** + * + * @export + * @interface GitStatus + */ +export interface GitStatus { + /** + * + * @type {number} + * @memberof GitStatus + */ + ahead?: number + /** + * + * @type {number} + * @memberof GitStatus + */ + behind?: number + /** + * + * @type {boolean} + * @memberof GitStatus + */ + branchPublished?: boolean + /** + * + * @type {string} + * @memberof GitStatus + */ + currentBranch: string + /** + * + * @type {Array} + * @memberof GitStatus + */ + fileStatus: Array +} + +/** + * Check if a given object implements the GitStatus interface. + */ +export function instanceOfGitStatus(value: object): value is GitStatus { + if (!('currentBranch' in value) || value['currentBranch'] === undefined) + return false + if (!('fileStatus' in value) || value['fileStatus'] === undefined) + return false + return true +} + +export function GitStatusFromJSON(json: any): GitStatus { + return GitStatusFromJSONTyped(json, false) +} + +export function GitStatusFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): GitStatus { + if (json == null) { + return json + } + return { + ahead: json['ahead'] == null ? undefined : json['ahead'], + behind: json['behind'] == null ? undefined : json['behind'], + branchPublished: + json['branchPublished'] == null ? undefined : json['branchPublished'], + currentBranch: json['currentBranch'], + fileStatus: (json['fileStatus'] as Array).map(FileStatusFromJSON), + } +} + +export function GitStatusToJSON(json: any): GitStatus { + return GitStatusToJSONTyped(json, false) +} + +export function GitStatusToJSONTyped( + value?: GitStatus | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + ahead: value['ahead'], + behind: value['behind'], + branchPublished: value['branchPublished'], + currentBranch: value['currentBranch'], + fileStatus: (value['fileStatus'] as Array).map(FileStatusToJSON), + } +} diff --git a/packages/typescript/src/client/models/GitUser.ts b/packages/typescript/src/client/models/GitUser.ts new file mode 100644 index 0000000..53670b5 --- /dev/null +++ b/packages/typescript/src/client/models/GitUser.ts @@ -0,0 +1,96 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface GitUser + */ +export interface GitUser { + /** + * + * @type {string} + * @memberof GitUser + */ + email: string + /** + * + * @type {string} + * @memberof GitUser + */ + id: string + /** + * + * @type {string} + * @memberof GitUser + */ + name: string + /** + * + * @type {string} + * @memberof GitUser + */ + username: string +} + +/** + * Check if a given object implements the GitUser interface. + */ +export function instanceOfGitUser(value: object): value is GitUser { + if (!('email' in value) || value['email'] === undefined) return false + if (!('id' in value) || value['id'] === undefined) return false + if (!('name' in value) || value['name'] === undefined) return false + if (!('username' in value) || value['username'] === undefined) return false + return true +} + +export function GitUserFromJSON(json: any): GitUser { + return GitUserFromJSONTyped(json, false) +} + +export function GitUserFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): GitUser { + if (json == null) { + return json + } + return { + email: json['email'], + id: json['id'], + name: json['name'], + username: json['username'], + } +} + +export function GitUserToJSON(json: any): GitUser { + return GitUserToJSONTyped(json, false) +} + +export function GitUserToJSONTyped( + value?: GitUser | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + email: value['email'], + id: value['id'], + name: value['name'], + username: value['username'], + } +} diff --git a/packages/typescript/src/client/models/InstallProviderRequest.ts b/packages/typescript/src/client/models/InstallProviderRequest.ts new file mode 100644 index 0000000..4225534 --- /dev/null +++ b/packages/typescript/src/client/models/InstallProviderRequest.ts @@ -0,0 +1,85 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface InstallProviderRequest + */ +export interface InstallProviderRequest { + /** + * + * @type {{ [key: string]: string; }} + * @memberof InstallProviderRequest + */ + downloadUrls: { [key: string]: string } + /** + * + * @type {string} + * @memberof InstallProviderRequest + */ + name: string +} + +/** + * Check if a given object implements the InstallProviderRequest interface. + */ +export function instanceOfInstallProviderRequest( + value: object, +): value is InstallProviderRequest { + if (!('downloadUrls' in value) || value['downloadUrls'] === undefined) + return false + if (!('name' in value) || value['name'] === undefined) return false + return true +} + +export function InstallProviderRequestFromJSON( + json: any, +): InstallProviderRequest { + return InstallProviderRequestFromJSONTyped(json, false) +} + +export function InstallProviderRequestFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): InstallProviderRequest { + if (json == null) { + return json + } + return { + downloadUrls: json['downloadUrls'], + name: json['name'], + } +} + +export function InstallProviderRequestToJSON( + json: any, +): InstallProviderRequest { + return InstallProviderRequestToJSONTyped(json, false) +} + +export function InstallProviderRequestToJSONTyped( + value?: InstallProviderRequest | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + downloadUrls: value['downloadUrls'], + name: value['name'], + } +} diff --git a/packages/typescript/src/client/models/ListBranchResponse.ts b/packages/typescript/src/client/models/ListBranchResponse.ts new file mode 100644 index 0000000..3e0c403 --- /dev/null +++ b/packages/typescript/src/client/models/ListBranchResponse.ts @@ -0,0 +1,71 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface ListBranchResponse + */ +export interface ListBranchResponse { + /** + * + * @type {Array} + * @memberof ListBranchResponse + */ + branches: Array +} + +/** + * Check if a given object implements the ListBranchResponse interface. + */ +export function instanceOfListBranchResponse( + value: object, +): value is ListBranchResponse { + if (!('branches' in value) || value['branches'] === undefined) return false + return true +} + +export function ListBranchResponseFromJSON(json: any): ListBranchResponse { + return ListBranchResponseFromJSONTyped(json, false) +} + +export function ListBranchResponseFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): ListBranchResponse { + if (json == null) { + return json + } + return { + branches: json['branches'], + } +} + +export function ListBranchResponseToJSON(json: any): ListBranchResponse { + return ListBranchResponseToJSONTyped(json, false) +} + +export function ListBranchResponseToJSONTyped( + value?: ListBranchResponse | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + branches: value['branches'], + } +} diff --git a/packages/typescript/src/client/models/LogFileConfig.ts b/packages/typescript/src/client/models/LogFileConfig.ts new file mode 100644 index 0000000..e6c4636 --- /dev/null +++ b/packages/typescript/src/client/models/LogFileConfig.ts @@ -0,0 +1,113 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface LogFileConfig + */ +export interface LogFileConfig { + /** + * + * @type {boolean} + * @memberof LogFileConfig + */ + compress?: boolean + /** + * + * @type {boolean} + * @memberof LogFileConfig + */ + localTime?: boolean + /** + * + * @type {number} + * @memberof LogFileConfig + */ + maxAge: number + /** + * + * @type {number} + * @memberof LogFileConfig + */ + maxBackups: number + /** + * + * @type {number} + * @memberof LogFileConfig + */ + maxSize: number + /** + * + * @type {string} + * @memberof LogFileConfig + */ + path: string +} + +/** + * Check if a given object implements the LogFileConfig interface. + */ +export function instanceOfLogFileConfig(value: object): value is LogFileConfig { + if (!('maxAge' in value) || value['maxAge'] === undefined) return false + if (!('maxBackups' in value) || value['maxBackups'] === undefined) + return false + if (!('maxSize' in value) || value['maxSize'] === undefined) return false + if (!('path' in value) || value['path'] === undefined) return false + return true +} + +export function LogFileConfigFromJSON(json: any): LogFileConfig { + return LogFileConfigFromJSONTyped(json, false) +} + +export function LogFileConfigFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): LogFileConfig { + if (json == null) { + return json + } + return { + compress: json['compress'] == null ? undefined : json['compress'], + localTime: json['localTime'] == null ? undefined : json['localTime'], + maxAge: json['maxAge'], + maxBackups: json['maxBackups'], + maxSize: json['maxSize'], + path: json['path'], + } +} + +export function LogFileConfigToJSON(json: any): LogFileConfig { + return LogFileConfigToJSONTyped(json, false) +} + +export function LogFileConfigToJSONTyped( + value?: LogFileConfig | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + compress: value['compress'], + localTime: value['localTime'], + maxAge: value['maxAge'], + maxBackups: value['maxBackups'], + maxSize: value['maxSize'], + path: value['path'], + } +} diff --git a/packages/typescript/src/client/models/LspCompletionParams.ts b/packages/typescript/src/client/models/LspCompletionParams.ts new file mode 100644 index 0000000..b7e1d8b --- /dev/null +++ b/packages/typescript/src/client/models/LspCompletionParams.ts @@ -0,0 +1,126 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +import type { CompletionContext } from './CompletionContext' +import { + CompletionContextFromJSON, + CompletionContextFromJSONTyped, + CompletionContextToJSON, + CompletionContextToJSONTyped, +} from './CompletionContext' +import type { Position } from './Position' +import { + PositionFromJSON, + PositionFromJSONTyped, + PositionToJSON, + PositionToJSONTyped, +} from './Position' + +/** + * + * @export + * @interface LspCompletionParams + */ +export interface LspCompletionParams { + /** + * + * @type {CompletionContext} + * @memberof LspCompletionParams + */ + context?: CompletionContext + /** + * + * @type {string} + * @memberof LspCompletionParams + */ + languageId: string + /** + * + * @type {string} + * @memberof LspCompletionParams + */ + pathToProject: string + /** + * + * @type {Position} + * @memberof LspCompletionParams + */ + position: Position + /** + * + * @type {string} + * @memberof LspCompletionParams + */ + uri: string +} + +/** + * Check if a given object implements the LspCompletionParams interface. + */ +export function instanceOfLspCompletionParams( + value: object, +): value is LspCompletionParams { + if (!('languageId' in value) || value['languageId'] === undefined) + return false + if (!('pathToProject' in value) || value['pathToProject'] === undefined) + return false + if (!('position' in value) || value['position'] === undefined) return false + if (!('uri' in value) || value['uri'] === undefined) return false + return true +} + +export function LspCompletionParamsFromJSON(json: any): LspCompletionParams { + return LspCompletionParamsFromJSONTyped(json, false) +} + +export function LspCompletionParamsFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): LspCompletionParams { + if (json == null) { + return json + } + return { + context: + json['context'] == null + ? undefined + : CompletionContextFromJSON(json['context']), + languageId: json['languageId'], + pathToProject: json['pathToProject'], + position: PositionFromJSON(json['position']), + uri: json['uri'], + } +} + +export function LspCompletionParamsToJSON(json: any): LspCompletionParams { + return LspCompletionParamsToJSONTyped(json, false) +} + +export function LspCompletionParamsToJSONTyped( + value?: LspCompletionParams | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + context: CompletionContextToJSON(value['context']), + languageId: value['languageId'], + pathToProject: value['pathToProject'], + position: PositionToJSON(value['position']), + uri: value['uri'], + } +} diff --git a/packages/typescript/src/client/models/LspDocumentRequest.ts b/packages/typescript/src/client/models/LspDocumentRequest.ts new file mode 100644 index 0000000..35e54c8 --- /dev/null +++ b/packages/typescript/src/client/models/LspDocumentRequest.ts @@ -0,0 +1,91 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface LspDocumentRequest + */ +export interface LspDocumentRequest { + /** + * + * @type {string} + * @memberof LspDocumentRequest + */ + languageId: string + /** + * + * @type {string} + * @memberof LspDocumentRequest + */ + pathToProject: string + /** + * + * @type {string} + * @memberof LspDocumentRequest + */ + uri: string +} + +/** + * Check if a given object implements the LspDocumentRequest interface. + */ +export function instanceOfLspDocumentRequest( + value: object, +): value is LspDocumentRequest { + if (!('languageId' in value) || value['languageId'] === undefined) + return false + if (!('pathToProject' in value) || value['pathToProject'] === undefined) + return false + if (!('uri' in value) || value['uri'] === undefined) return false + return true +} + +export function LspDocumentRequestFromJSON(json: any): LspDocumentRequest { + return LspDocumentRequestFromJSONTyped(json, false) +} + +export function LspDocumentRequestFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): LspDocumentRequest { + if (json == null) { + return json + } + return { + languageId: json['languageId'], + pathToProject: json['pathToProject'], + uri: json['uri'], + } +} + +export function LspDocumentRequestToJSON(json: any): LspDocumentRequest { + return LspDocumentRequestToJSONTyped(json, false) +} + +export function LspDocumentRequestToJSONTyped( + value?: LspDocumentRequest | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + languageId: value['languageId'], + pathToProject: value['pathToProject'], + uri: value['uri'], + } +} diff --git a/packages/typescript/src/client/models/LspLocation.ts b/packages/typescript/src/client/models/LspLocation.ts new file mode 100644 index 0000000..37bac51 --- /dev/null +++ b/packages/typescript/src/client/models/LspLocation.ts @@ -0,0 +1,86 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +import type { LspRange } from './LspRange' +import { + LspRangeFromJSON, + LspRangeFromJSONTyped, + LspRangeToJSON, + LspRangeToJSONTyped, +} from './LspRange' + +/** + * + * @export + * @interface LspLocation + */ +export interface LspLocation { + /** + * + * @type {LspRange} + * @memberof LspLocation + */ + range: LspRange + /** + * + * @type {string} + * @memberof LspLocation + */ + uri: string +} + +/** + * Check if a given object implements the LspLocation interface. + */ +export function instanceOfLspLocation(value: object): value is LspLocation { + if (!('range' in value) || value['range'] === undefined) return false + if (!('uri' in value) || value['uri'] === undefined) return false + return true +} + +export function LspLocationFromJSON(json: any): LspLocation { + return LspLocationFromJSONTyped(json, false) +} + +export function LspLocationFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): LspLocation { + if (json == null) { + return json + } + return { + range: LspRangeFromJSON(json['range']), + uri: json['uri'], + } +} + +export function LspLocationToJSON(json: any): LspLocation { + return LspLocationToJSONTyped(json, false) +} + +export function LspLocationToJSONTyped( + value?: LspLocation | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + range: LspRangeToJSON(value['range']), + uri: value['uri'], + } +} diff --git a/packages/typescript/src/client/models/LspPosition.ts b/packages/typescript/src/client/models/LspPosition.ts new file mode 100644 index 0000000..f801b09 --- /dev/null +++ b/packages/typescript/src/client/models/LspPosition.ts @@ -0,0 +1,78 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface LspPosition + */ +export interface LspPosition { + /** + * + * @type {number} + * @memberof LspPosition + */ + character: number + /** + * + * @type {number} + * @memberof LspPosition + */ + line: number +} + +/** + * Check if a given object implements the LspPosition interface. + */ +export function instanceOfLspPosition(value: object): value is LspPosition { + if (!('character' in value) || value['character'] === undefined) return false + if (!('line' in value) || value['line'] === undefined) return false + return true +} + +export function LspPositionFromJSON(json: any): LspPosition { + return LspPositionFromJSONTyped(json, false) +} + +export function LspPositionFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): LspPosition { + if (json == null) { + return json + } + return { + character: json['character'], + line: json['line'], + } +} + +export function LspPositionToJSON(json: any): LspPosition { + return LspPositionToJSONTyped(json, false) +} + +export function LspPositionToJSONTyped( + value?: LspPosition | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + character: value['character'], + line: value['line'], + } +} diff --git a/packages/typescript/src/client/models/LspRange.ts b/packages/typescript/src/client/models/LspRange.ts new file mode 100644 index 0000000..e31b17d --- /dev/null +++ b/packages/typescript/src/client/models/LspRange.ts @@ -0,0 +1,86 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +import type { LspPosition } from './LspPosition' +import { + LspPositionFromJSON, + LspPositionFromJSONTyped, + LspPositionToJSON, + LspPositionToJSONTyped, +} from './LspPosition' + +/** + * + * @export + * @interface LspRange + */ +export interface LspRange { + /** + * + * @type {LspPosition} + * @memberof LspRange + */ + end: LspPosition + /** + * + * @type {LspPosition} + * @memberof LspRange + */ + start: LspPosition +} + +/** + * Check if a given object implements the LspRange interface. + */ +export function instanceOfLspRange(value: object): value is LspRange { + if (!('end' in value) || value['end'] === undefined) return false + if (!('start' in value) || value['start'] === undefined) return false + return true +} + +export function LspRangeFromJSON(json: any): LspRange { + return LspRangeFromJSONTyped(json, false) +} + +export function LspRangeFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): LspRange { + if (json == null) { + return json + } + return { + end: LspPositionFromJSON(json['end']), + start: LspPositionFromJSON(json['start']), + } +} + +export function LspRangeToJSON(json: any): LspRange { + return LspRangeToJSONTyped(json, false) +} + +export function LspRangeToJSONTyped( + value?: LspRange | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + end: LspPositionToJSON(value['end']), + start: LspPositionToJSON(value['start']), + } +} diff --git a/packages/typescript/src/client/models/LspServerRequest.ts b/packages/typescript/src/client/models/LspServerRequest.ts new file mode 100644 index 0000000..156fbae --- /dev/null +++ b/packages/typescript/src/client/models/LspServerRequest.ts @@ -0,0 +1,82 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface LspServerRequest + */ +export interface LspServerRequest { + /** + * + * @type {string} + * @memberof LspServerRequest + */ + languageId: string + /** + * + * @type {string} + * @memberof LspServerRequest + */ + pathToProject: string +} + +/** + * Check if a given object implements the LspServerRequest interface. + */ +export function instanceOfLspServerRequest( + value: object, +): value is LspServerRequest { + if (!('languageId' in value) || value['languageId'] === undefined) + return false + if (!('pathToProject' in value) || value['pathToProject'] === undefined) + return false + return true +} + +export function LspServerRequestFromJSON(json: any): LspServerRequest { + return LspServerRequestFromJSONTyped(json, false) +} + +export function LspServerRequestFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): LspServerRequest { + if (json == null) { + return json + } + return { + languageId: json['languageId'], + pathToProject: json['pathToProject'], + } +} + +export function LspServerRequestToJSON(json: any): LspServerRequest { + return LspServerRequestToJSONTyped(json, false) +} + +export function LspServerRequestToJSONTyped( + value?: LspServerRequest | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + languageId: value['languageId'], + pathToProject: value['pathToProject'], + } +} diff --git a/packages/typescript/src/client/models/LspSymbol.ts b/packages/typescript/src/client/models/LspSymbol.ts new file mode 100644 index 0000000..b33888f --- /dev/null +++ b/packages/typescript/src/client/models/LspSymbol.ts @@ -0,0 +1,95 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +import type { LspLocation } from './LspLocation' +import { + LspLocationFromJSON, + LspLocationFromJSONTyped, + LspLocationToJSON, + LspLocationToJSONTyped, +} from './LspLocation' + +/** + * + * @export + * @interface LspSymbol + */ +export interface LspSymbol { + /** + * + * @type {number} + * @memberof LspSymbol + */ + kind: number + /** + * + * @type {LspLocation} + * @memberof LspSymbol + */ + location: LspLocation + /** + * + * @type {string} + * @memberof LspSymbol + */ + name: string +} + +/** + * Check if a given object implements the LspSymbol interface. + */ +export function instanceOfLspSymbol(value: object): value is LspSymbol { + if (!('kind' in value) || value['kind'] === undefined) return false + if (!('location' in value) || value['location'] === undefined) return false + if (!('name' in value) || value['name'] === undefined) return false + return true +} + +export function LspSymbolFromJSON(json: any): LspSymbol { + return LspSymbolFromJSONTyped(json, false) +} + +export function LspSymbolFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): LspSymbol { + if (json == null) { + return json + } + return { + kind: json['kind'], + location: LspLocationFromJSON(json['location']), + name: json['name'], + } +} + +export function LspSymbolToJSON(json: any): LspSymbol { + return LspSymbolToJSONTyped(json, false) +} + +export function LspSymbolToJSONTyped( + value?: LspSymbol | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + kind: value['kind'], + location: LspLocationToJSON(value['location']), + name: value['name'], + } +} diff --git a/packages/typescript/src/client/models/Match.ts b/packages/typescript/src/client/models/Match.ts new file mode 100644 index 0000000..d143537 --- /dev/null +++ b/packages/typescript/src/client/models/Match.ts @@ -0,0 +1,87 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface Match + */ +export interface Match { + /** + * + * @type {string} + * @memberof Match + */ + content: string + /** + * + * @type {string} + * @memberof Match + */ + file: string + /** + * + * @type {number} + * @memberof Match + */ + line: number +} + +/** + * Check if a given object implements the Match interface. + */ +export function instanceOfMatch(value: object): value is Match { + if (!('content' in value) || value['content'] === undefined) return false + if (!('file' in value) || value['file'] === undefined) return false + if (!('line' in value) || value['line'] === undefined) return false + return true +} + +export function MatchFromJSON(json: any): Match { + return MatchFromJSONTyped(json, false) +} + +export function MatchFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): Match { + if (json == null) { + return json + } + return { + content: json['content'], + file: json['file'], + line: json['line'], + } +} + +export function MatchToJSON(json: any): Match { + return MatchToJSONTyped(json, false) +} + +export function MatchToJSONTyped( + value?: Match | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + content: value['content'], + file: value['file'], + line: value['line'], + } +} diff --git a/packages/typescript/src/client/models/NetworkKey.ts b/packages/typescript/src/client/models/NetworkKey.ts new file mode 100644 index 0000000..8732ec8 --- /dev/null +++ b/packages/typescript/src/client/models/NetworkKey.ts @@ -0,0 +1,69 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface NetworkKey + */ +export interface NetworkKey { + /** + * + * @type {string} + * @memberof NetworkKey + */ + key: string +} + +/** + * Check if a given object implements the NetworkKey interface. + */ +export function instanceOfNetworkKey(value: object): value is NetworkKey { + if (!('key' in value) || value['key'] === undefined) return false + return true +} + +export function NetworkKeyFromJSON(json: any): NetworkKey { + return NetworkKeyFromJSONTyped(json, false) +} + +export function NetworkKeyFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): NetworkKey { + if (json == null) { + return json + } + return { + key: json['key'], + } +} + +export function NetworkKeyToJSON(json: any): NetworkKey { + return NetworkKeyToJSONTyped(json, false) +} + +export function NetworkKeyToJSONTyped( + value?: NetworkKey | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + key: value['key'], + } +} diff --git a/packages/typescript/src/client/models/Position.ts b/packages/typescript/src/client/models/Position.ts new file mode 100644 index 0000000..1a1e100 --- /dev/null +++ b/packages/typescript/src/client/models/Position.ts @@ -0,0 +1,78 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface Position + */ +export interface Position { + /** + * + * @type {number} + * @memberof Position + */ + character: number + /** + * + * @type {number} + * @memberof Position + */ + line: number +} + +/** + * Check if a given object implements the Position interface. + */ +export function instanceOfPosition(value: object): value is Position { + if (!('character' in value) || value['character'] === undefined) return false + if (!('line' in value) || value['line'] === undefined) return false + return true +} + +export function PositionFromJSON(json: any): Position { + return PositionFromJSONTyped(json, false) +} + +export function PositionFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): Position { + if (json == null) { + return json + } + return { + character: json['character'], + line: json['line'], + } +} + +export function PositionToJSON(json: any): Position { + return PositionToJSONTyped(json, false) +} + +export function PositionToJSONTyped( + value?: Position | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + character: value['character'], + line: value['line'], + } +} diff --git a/packages/typescript/src/client/models/PrebuildConfig.ts b/packages/typescript/src/client/models/PrebuildConfig.ts new file mode 100644 index 0000000..24ee578 --- /dev/null +++ b/packages/typescript/src/client/models/PrebuildConfig.ts @@ -0,0 +1,109 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface PrebuildConfig + */ +export interface PrebuildConfig { + /** + * + * @type {string} + * @memberof PrebuildConfig + */ + branch: string + /** + * + * @type {number} + * @memberof PrebuildConfig + */ + commitInterval: number + /** + * + * @type {string} + * @memberof PrebuildConfig + */ + id: string + /** + * + * @type {number} + * @memberof PrebuildConfig + */ + retention: number + /** + * + * @type {Array} + * @memberof PrebuildConfig + */ + triggerFiles: Array +} + +/** + * Check if a given object implements the PrebuildConfig interface. + */ +export function instanceOfPrebuildConfig( + value: object, +): value is PrebuildConfig { + if (!('branch' in value) || value['branch'] === undefined) return false + if (!('commitInterval' in value) || value['commitInterval'] === undefined) + return false + if (!('id' in value) || value['id'] === undefined) return false + if (!('retention' in value) || value['retention'] === undefined) return false + if (!('triggerFiles' in value) || value['triggerFiles'] === undefined) + return false + return true +} + +export function PrebuildConfigFromJSON(json: any): PrebuildConfig { + return PrebuildConfigFromJSONTyped(json, false) +} + +export function PrebuildConfigFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): PrebuildConfig { + if (json == null) { + return json + } + return { + branch: json['branch'], + commitInterval: json['commitInterval'], + id: json['id'], + retention: json['retention'], + triggerFiles: json['triggerFiles'], + } +} + +export function PrebuildConfigToJSON(json: any): PrebuildConfig { + return PrebuildConfigToJSONTyped(json, false) +} + +export function PrebuildConfigToJSONTyped( + value?: PrebuildConfig | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + branch: value['branch'], + commitInterval: value['commitInterval'], + id: value['id'], + retention: value['retention'], + triggerFiles: value['triggerFiles'], + } +} diff --git a/packages/typescript/src/client/models/PrebuildDTO.ts b/packages/typescript/src/client/models/PrebuildDTO.ts new file mode 100644 index 0000000..fb6f152 --- /dev/null +++ b/packages/typescript/src/client/models/PrebuildDTO.ts @@ -0,0 +1,118 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface PrebuildDTO + */ +export interface PrebuildDTO { + /** + * + * @type {string} + * @memberof PrebuildDTO + */ + branch: string + /** + * + * @type {number} + * @memberof PrebuildDTO + */ + commitInterval?: number + /** + * + * @type {string} + * @memberof PrebuildDTO + */ + id: string + /** + * + * @type {string} + * @memberof PrebuildDTO + */ + projectConfigName: string + /** + * + * @type {number} + * @memberof PrebuildDTO + */ + retention: number + /** + * + * @type {Array} + * @memberof PrebuildDTO + */ + triggerFiles?: Array +} + +/** + * Check if a given object implements the PrebuildDTO interface. + */ +export function instanceOfPrebuildDTO(value: object): value is PrebuildDTO { + if (!('branch' in value) || value['branch'] === undefined) return false + if (!('id' in value) || value['id'] === undefined) return false + if ( + !('projectConfigName' in value) || + value['projectConfigName'] === undefined + ) + return false + if (!('retention' in value) || value['retention'] === undefined) return false + return true +} + +export function PrebuildDTOFromJSON(json: any): PrebuildDTO { + return PrebuildDTOFromJSONTyped(json, false) +} + +export function PrebuildDTOFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): PrebuildDTO { + if (json == null) { + return json + } + return { + branch: json['branch'], + commitInterval: + json['commitInterval'] == null ? undefined : json['commitInterval'], + id: json['id'], + projectConfigName: json['projectConfigName'], + retention: json['retention'], + triggerFiles: + json['triggerFiles'] == null ? undefined : json['triggerFiles'], + } +} + +export function PrebuildDTOToJSON(json: any): PrebuildDTO { + return PrebuildDTOToJSONTyped(json, false) +} + +export function PrebuildDTOToJSONTyped( + value?: PrebuildDTO | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + branch: value['branch'], + commitInterval: value['commitInterval'], + id: value['id'], + projectConfigName: value['projectConfigName'], + retention: value['retention'], + triggerFiles: value['triggerFiles'], + } +} diff --git a/packages/typescript/src/client/models/ProfileData.ts b/packages/typescript/src/client/models/ProfileData.ts new file mode 100644 index 0000000..ae4cf3a --- /dev/null +++ b/packages/typescript/src/client/models/ProfileData.ts @@ -0,0 +1,69 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface ProfileData + */ +export interface ProfileData { + /** + * + * @type {{ [key: string]: string; }} + * @memberof ProfileData + */ + envVars: { [key: string]: string } +} + +/** + * Check if a given object implements the ProfileData interface. + */ +export function instanceOfProfileData(value: object): value is ProfileData { + if (!('envVars' in value) || value['envVars'] === undefined) return false + return true +} + +export function ProfileDataFromJSON(json: any): ProfileData { + return ProfileDataFromJSONTyped(json, false) +} + +export function ProfileDataFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): ProfileData { + if (json == null) { + return json + } + return { + envVars: json['envVars'], + } +} + +export function ProfileDataToJSON(json: any): ProfileData { + return ProfileDataToJSONTyped(json, false) +} + +export function ProfileDataToJSONTyped( + value?: ProfileData | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + envVars: value['envVars'], + } +} diff --git a/packages/typescript/src/client/models/Project.ts b/packages/typescript/src/client/models/Project.ts new file mode 100644 index 0000000..26449d6 --- /dev/null +++ b/packages/typescript/src/client/models/Project.ts @@ -0,0 +1,178 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +import type { GitRepository } from './GitRepository' +import { + GitRepositoryFromJSON, + GitRepositoryFromJSONTyped, + GitRepositoryToJSON, + GitRepositoryToJSONTyped, +} from './GitRepository' +import type { BuildConfig } from './BuildConfig' +import { + BuildConfigFromJSON, + BuildConfigFromJSONTyped, + BuildConfigToJSON, + BuildConfigToJSONTyped, +} from './BuildConfig' +import type { ProjectState } from './ProjectState' +import { + ProjectStateFromJSON, + ProjectStateFromJSONTyped, + ProjectStateToJSON, + ProjectStateToJSONTyped, +} from './ProjectState' + +/** + * + * @export + * @interface Project + */ +export interface Project { + /** + * + * @type {BuildConfig} + * @memberof Project + */ + buildConfig?: BuildConfig + /** + * + * @type {{ [key: string]: string; }} + * @memberof Project + */ + envVars: { [key: string]: string } + /** + * + * @type {string} + * @memberof Project + */ + gitProviderConfigId?: string + /** + * + * @type {string} + * @memberof Project + */ + image: string + /** + * + * @type {string} + * @memberof Project + */ + name: string + /** + * + * @type {GitRepository} + * @memberof Project + */ + repository: GitRepository + /** + * + * @type {ProjectState} + * @memberof Project + */ + state?: ProjectState + /** + * + * @type {string} + * @memberof Project + */ + target: string + /** + * + * @type {string} + * @memberof Project + */ + user: string + /** + * + * @type {string} + * @memberof Project + */ + workspaceId: string +} + +/** + * Check if a given object implements the Project interface. + */ +export function instanceOfProject(value: object): value is Project { + if (!('envVars' in value) || value['envVars'] === undefined) return false + if (!('image' in value) || value['image'] === undefined) return false + if (!('name' in value) || value['name'] === undefined) return false + if (!('repository' in value) || value['repository'] === undefined) + return false + if (!('target' in value) || value['target'] === undefined) return false + if (!('user' in value) || value['user'] === undefined) return false + if (!('workspaceId' in value) || value['workspaceId'] === undefined) + return false + return true +} + +export function ProjectFromJSON(json: any): Project { + return ProjectFromJSONTyped(json, false) +} + +export function ProjectFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): Project { + if (json == null) { + return json + } + return { + buildConfig: + json['buildConfig'] == null + ? undefined + : BuildConfigFromJSON(json['buildConfig']), + envVars: json['envVars'], + gitProviderConfigId: + json['gitProviderConfigId'] == null + ? undefined + : json['gitProviderConfigId'], + image: json['image'], + name: json['name'], + repository: GitRepositoryFromJSON(json['repository']), + state: + json['state'] == null ? undefined : ProjectStateFromJSON(json['state']), + target: json['target'], + user: json['user'], + workspaceId: json['workspaceId'], + } +} + +export function ProjectToJSON(json: any): Project { + return ProjectToJSONTyped(json, false) +} + +export function ProjectToJSONTyped( + value?: Project | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + buildConfig: BuildConfigToJSON(value['buildConfig']), + envVars: value['envVars'], + gitProviderConfigId: value['gitProviderConfigId'], + image: value['image'], + name: value['name'], + repository: GitRepositoryToJSON(value['repository']), + state: ProjectStateToJSON(value['state']), + target: value['target'], + user: value['user'], + workspaceId: value['workspaceId'], + } +} diff --git a/packages/typescript/src/client/models/ProjectConfig.ts b/packages/typescript/src/client/models/ProjectConfig.ts new file mode 100644 index 0000000..9ae9bff --- /dev/null +++ b/packages/typescript/src/client/models/ProjectConfig.ts @@ -0,0 +1,166 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +import type { PrebuildConfig } from './PrebuildConfig' +import { + PrebuildConfigFromJSON, + PrebuildConfigFromJSONTyped, + PrebuildConfigToJSON, + PrebuildConfigToJSONTyped, +} from './PrebuildConfig' +import type { BuildConfig } from './BuildConfig' +import { + BuildConfigFromJSON, + BuildConfigFromJSONTyped, + BuildConfigToJSON, + BuildConfigToJSONTyped, +} from './BuildConfig' + +/** + * + * @export + * @interface ProjectConfig + */ +export interface ProjectConfig { + /** + * + * @type {BuildConfig} + * @memberof ProjectConfig + */ + buildConfig?: BuildConfig + /** + * + * @type {boolean} + * @memberof ProjectConfig + */ + _default: boolean + /** + * + * @type {{ [key: string]: string; }} + * @memberof ProjectConfig + */ + envVars: { [key: string]: string } + /** + * + * @type {string} + * @memberof ProjectConfig + */ + gitProviderConfigId?: string + /** + * + * @type {string} + * @memberof ProjectConfig + */ + image: string + /** + * + * @type {string} + * @memberof ProjectConfig + */ + name: string + /** + * + * @type {Array} + * @memberof ProjectConfig + */ + prebuilds?: Array + /** + * + * @type {string} + * @memberof ProjectConfig + */ + repositoryUrl: string + /** + * + * @type {string} + * @memberof ProjectConfig + */ + user: string +} + +/** + * Check if a given object implements the ProjectConfig interface. + */ +export function instanceOfProjectConfig(value: object): value is ProjectConfig { + if (!('_default' in value) || value['_default'] === undefined) return false + if (!('envVars' in value) || value['envVars'] === undefined) return false + if (!('image' in value) || value['image'] === undefined) return false + if (!('name' in value) || value['name'] === undefined) return false + if (!('repositoryUrl' in value) || value['repositoryUrl'] === undefined) + return false + if (!('user' in value) || value['user'] === undefined) return false + return true +} + +export function ProjectConfigFromJSON(json: any): ProjectConfig { + return ProjectConfigFromJSONTyped(json, false) +} + +export function ProjectConfigFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): ProjectConfig { + if (json == null) { + return json + } + return { + buildConfig: + json['buildConfig'] == null + ? undefined + : BuildConfigFromJSON(json['buildConfig']), + _default: json['default'], + envVars: json['envVars'], + gitProviderConfigId: + json['gitProviderConfigId'] == null + ? undefined + : json['gitProviderConfigId'], + image: json['image'], + name: json['name'], + prebuilds: + json['prebuilds'] == null + ? undefined + : (json['prebuilds'] as Array).map(PrebuildConfigFromJSON), + repositoryUrl: json['repositoryUrl'], + user: json['user'], + } +} + +export function ProjectConfigToJSON(json: any): ProjectConfig { + return ProjectConfigToJSONTyped(json, false) +} + +export function ProjectConfigToJSONTyped( + value?: ProjectConfig | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + buildConfig: BuildConfigToJSON(value['buildConfig']), + default: value['_default'], + envVars: value['envVars'], + gitProviderConfigId: value['gitProviderConfigId'], + image: value['image'], + name: value['name'], + prebuilds: + value['prebuilds'] == null + ? undefined + : (value['prebuilds'] as Array).map(PrebuildConfigToJSON), + repositoryUrl: value['repositoryUrl'], + user: value['user'], + } +} diff --git a/packages/typescript/src/client/models/ProjectDirResponse.ts b/packages/typescript/src/client/models/ProjectDirResponse.ts new file mode 100644 index 0000000..69c854a --- /dev/null +++ b/packages/typescript/src/client/models/ProjectDirResponse.ts @@ -0,0 +1,70 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface ProjectDirResponse + */ +export interface ProjectDirResponse { + /** + * + * @type {string} + * @memberof ProjectDirResponse + */ + dir?: string +} + +/** + * Check if a given object implements the ProjectDirResponse interface. + */ +export function instanceOfProjectDirResponse( + value: object, +): value is ProjectDirResponse { + return true +} + +export function ProjectDirResponseFromJSON(json: any): ProjectDirResponse { + return ProjectDirResponseFromJSONTyped(json, false) +} + +export function ProjectDirResponseFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): ProjectDirResponse { + if (json == null) { + return json + } + return { + dir: json['dir'] == null ? undefined : json['dir'], + } +} + +export function ProjectDirResponseToJSON(json: any): ProjectDirResponse { + return ProjectDirResponseToJSONTyped(json, false) +} + +export function ProjectDirResponseToJSONTyped( + value?: ProjectDirResponse | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + dir: value['dir'], + } +} diff --git a/packages/typescript/src/client/models/ProjectInfo.ts b/packages/typescript/src/client/models/ProjectInfo.ts new file mode 100644 index 0000000..982e040 --- /dev/null +++ b/packages/typescript/src/client/models/ProjectInfo.ts @@ -0,0 +1,106 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface ProjectInfo + */ +export interface ProjectInfo { + /** + * + * @type {string} + * @memberof ProjectInfo + */ + created: string + /** + * + * @type {boolean} + * @memberof ProjectInfo + */ + isRunning: boolean + /** + * + * @type {string} + * @memberof ProjectInfo + */ + name: string + /** + * + * @type {string} + * @memberof ProjectInfo + */ + providerMetadata?: string + /** + * + * @type {string} + * @memberof ProjectInfo + */ + workspaceId: string +} + +/** + * Check if a given object implements the ProjectInfo interface. + */ +export function instanceOfProjectInfo(value: object): value is ProjectInfo { + if (!('created' in value) || value['created'] === undefined) return false + if (!('isRunning' in value) || value['isRunning'] === undefined) return false + if (!('name' in value) || value['name'] === undefined) return false + if (!('workspaceId' in value) || value['workspaceId'] === undefined) + return false + return true +} + +export function ProjectInfoFromJSON(json: any): ProjectInfo { + return ProjectInfoFromJSONTyped(json, false) +} + +export function ProjectInfoFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): ProjectInfo { + if (json == null) { + return json + } + return { + created: json['created'], + isRunning: json['isRunning'], + name: json['name'], + providerMetadata: + json['providerMetadata'] == null ? undefined : json['providerMetadata'], + workspaceId: json['workspaceId'], + } +} + +export function ProjectInfoToJSON(json: any): ProjectInfo { + return ProjectInfoToJSONTyped(json, false) +} + +export function ProjectInfoToJSONTyped( + value?: ProjectInfo | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + created: value['created'], + isRunning: value['isRunning'], + name: value['name'], + providerMetadata: value['providerMetadata'], + workspaceId: value['workspaceId'], + } +} diff --git a/packages/typescript/src/client/models/ProjectState.ts b/packages/typescript/src/client/models/ProjectState.ts new file mode 100644 index 0000000..4be0c8c --- /dev/null +++ b/packages/typescript/src/client/models/ProjectState.ts @@ -0,0 +1,97 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +import type { GitStatus } from './GitStatus' +import { + GitStatusFromJSON, + GitStatusFromJSONTyped, + GitStatusToJSON, + GitStatusToJSONTyped, +} from './GitStatus' + +/** + * + * @export + * @interface ProjectState + */ +export interface ProjectState { + /** + * + * @type {GitStatus} + * @memberof ProjectState + */ + gitStatus?: GitStatus + /** + * + * @type {string} + * @memberof ProjectState + */ + updatedAt: string + /** + * + * @type {number} + * @memberof ProjectState + */ + uptime: number +} + +/** + * Check if a given object implements the ProjectState interface. + */ +export function instanceOfProjectState(value: object): value is ProjectState { + if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false + if (!('uptime' in value) || value['uptime'] === undefined) return false + return true +} + +export function ProjectStateFromJSON(json: any): ProjectState { + return ProjectStateFromJSONTyped(json, false) +} + +export function ProjectStateFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): ProjectState { + if (json == null) { + return json + } + return { + gitStatus: + json['gitStatus'] == null + ? undefined + : GitStatusFromJSON(json['gitStatus']), + updatedAt: json['updatedAt'], + uptime: json['uptime'], + } +} + +export function ProjectStateToJSON(json: any): ProjectState { + return ProjectStateToJSONTyped(json, false) +} + +export function ProjectStateToJSONTyped( + value?: ProjectState | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + gitStatus: GitStatusToJSON(value['gitStatus']), + updatedAt: value['updatedAt'], + uptime: value['uptime'], + } +} diff --git a/packages/typescript/src/client/models/Provider.ts b/packages/typescript/src/client/models/Provider.ts new file mode 100644 index 0000000..0d8b3cc --- /dev/null +++ b/packages/typescript/src/client/models/Provider.ts @@ -0,0 +1,86 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface Provider + */ +export interface Provider { + /** + * + * @type {string} + * @memberof Provider + */ + label?: string + /** + * + * @type {string} + * @memberof Provider + */ + name: string + /** + * + * @type {string} + * @memberof Provider + */ + version: string +} + +/** + * Check if a given object implements the Provider interface. + */ +export function instanceOfProvider(value: object): value is Provider { + if (!('name' in value) || value['name'] === undefined) return false + if (!('version' in value) || value['version'] === undefined) return false + return true +} + +export function ProviderFromJSON(json: any): Provider { + return ProviderFromJSONTyped(json, false) +} + +export function ProviderFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): Provider { + if (json == null) { + return json + } + return { + label: json['label'] == null ? undefined : json['label'], + name: json['name'], + version: json['version'], + } +} + +export function ProviderToJSON(json: any): Provider { + return ProviderToJSONTyped(json, false) +} + +export function ProviderToJSONTyped( + value?: Provider | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + label: value['label'], + name: value['name'], + version: value['version'], + } +} diff --git a/packages/typescript/src/client/models/ProviderProviderInfo.ts b/packages/typescript/src/client/models/ProviderProviderInfo.ts new file mode 100644 index 0000000..6b86571 --- /dev/null +++ b/packages/typescript/src/client/models/ProviderProviderInfo.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface ProviderProviderInfo + */ +export interface ProviderProviderInfo { + /** + * + * @type {string} + * @memberof ProviderProviderInfo + */ + label?: string + /** + * + * @type {string} + * @memberof ProviderProviderInfo + */ + name: string + /** + * + * @type {string} + * @memberof ProviderProviderInfo + */ + version: string +} + +/** + * Check if a given object implements the ProviderProviderInfo interface. + */ +export function instanceOfProviderProviderInfo( + value: object, +): value is ProviderProviderInfo { + if (!('name' in value) || value['name'] === undefined) return false + if (!('version' in value) || value['version'] === undefined) return false + return true +} + +export function ProviderProviderInfoFromJSON(json: any): ProviderProviderInfo { + return ProviderProviderInfoFromJSONTyped(json, false) +} + +export function ProviderProviderInfoFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): ProviderProviderInfo { + if (json == null) { + return json + } + return { + label: json['label'] == null ? undefined : json['label'], + name: json['name'], + version: json['version'], + } +} + +export function ProviderProviderInfoToJSON(json: any): ProviderProviderInfo { + return ProviderProviderInfoToJSONTyped(json, false) +} + +export function ProviderProviderInfoToJSONTyped( + value?: ProviderProviderInfo | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + label: value['label'], + name: value['name'], + version: value['version'], + } +} diff --git a/packages/typescript/src/client/models/ProviderProviderTargetProperty.ts b/packages/typescript/src/client/models/ProviderProviderTargetProperty.ts new file mode 100644 index 0000000..3144f88 --- /dev/null +++ b/packages/typescript/src/client/models/ProviderProviderTargetProperty.ts @@ -0,0 +1,138 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +import type { ProviderProviderTargetPropertyType } from './ProviderProviderTargetPropertyType' +import { + ProviderProviderTargetPropertyTypeFromJSON, + ProviderProviderTargetPropertyTypeFromJSONTyped, + ProviderProviderTargetPropertyTypeToJSON, + ProviderProviderTargetPropertyTypeToJSONTyped, +} from './ProviderProviderTargetPropertyType' + +/** + * + * @export + * @interface ProviderProviderTargetProperty + */ +export interface ProviderProviderTargetProperty { + /** + * DefaultValue is converted into the appropriate type based on the Type + * If the property is a FilePath, the DefaultValue is a path to a directory + * @type {string} + * @memberof ProviderProviderTargetProperty + */ + defaultValue?: string + /** + * Brief description of the property + * @type {string} + * @memberof ProviderProviderTargetProperty + */ + description?: string + /** + * A regex string matched with the name of the target to determine if the property should be disabled + * If the regex matches the target name, the property will be disabled + * E.g. "^local$" will disable the property for the local target + * @type {string} + * @memberof ProviderProviderTargetProperty + */ + disabledPredicate?: string + /** + * + * @type {boolean} + * @memberof ProviderProviderTargetProperty + */ + inputMasked?: boolean + /** + * Options is only used if the Type is ProviderTargetPropertyTypeOption + * @type {Array} + * @memberof ProviderProviderTargetProperty + */ + options?: Array + /** + * Suggestions is an optional list of auto-complete values to assist the user while filling the field + * @type {Array} + * @memberof ProviderProviderTargetProperty + */ + suggestions?: Array + /** + * + * @type {ProviderProviderTargetPropertyType} + * @memberof ProviderProviderTargetProperty + */ + type?: ProviderProviderTargetPropertyType +} + +/** + * Check if a given object implements the ProviderProviderTargetProperty interface. + */ +export function instanceOfProviderProviderTargetProperty( + value: object, +): value is ProviderProviderTargetProperty { + return true +} + +export function ProviderProviderTargetPropertyFromJSON( + json: any, +): ProviderProviderTargetProperty { + return ProviderProviderTargetPropertyFromJSONTyped(json, false) +} + +export function ProviderProviderTargetPropertyFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): ProviderProviderTargetProperty { + if (json == null) { + return json + } + return { + defaultValue: + json['defaultValue'] == null ? undefined : json['defaultValue'], + description: json['description'] == null ? undefined : json['description'], + disabledPredicate: + json['disabledPredicate'] == null ? undefined : json['disabledPredicate'], + inputMasked: json['inputMasked'] == null ? undefined : json['inputMasked'], + options: json['options'] == null ? undefined : json['options'], + suggestions: json['suggestions'] == null ? undefined : json['suggestions'], + type: + json['type'] == null + ? undefined + : ProviderProviderTargetPropertyTypeFromJSON(json['type']), + } +} + +export function ProviderProviderTargetPropertyToJSON( + json: any, +): ProviderProviderTargetProperty { + return ProviderProviderTargetPropertyToJSONTyped(json, false) +} + +export function ProviderProviderTargetPropertyToJSONTyped( + value?: ProviderProviderTargetProperty | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + defaultValue: value['defaultValue'], + description: value['description'], + disabledPredicate: value['disabledPredicate'], + inputMasked: value['inputMasked'], + options: value['options'], + suggestions: value['suggestions'], + type: ProviderProviderTargetPropertyTypeToJSON(value['type']), + } +} diff --git a/packages/typescript/src/client/models/ProviderProviderTargetPropertyType.ts b/packages/typescript/src/client/models/ProviderProviderTargetPropertyType.ts new file mode 100644 index 0000000..c6d47c6 --- /dev/null +++ b/packages/typescript/src/client/models/ProviderProviderTargetPropertyType.ts @@ -0,0 +1,76 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + */ +export const ProviderProviderTargetPropertyType = { + ProviderTargetPropertyTypeString: 'string', + ProviderTargetPropertyTypeOption: 'option', + ProviderTargetPropertyTypeBoolean: 'boolean', + ProviderTargetPropertyTypeInt: 'int', + ProviderTargetPropertyTypeFloat: 'float', + ProviderTargetPropertyTypeFilePath: 'file-path', +} as const +export type ProviderProviderTargetPropertyType = + (typeof ProviderProviderTargetPropertyType)[keyof typeof ProviderProviderTargetPropertyType] + +export function instanceOfProviderProviderTargetPropertyType( + value: any, +): boolean { + for (const key in ProviderProviderTargetPropertyType) { + if ( + Object.prototype.hasOwnProperty.call( + ProviderProviderTargetPropertyType, + key, + ) + ) { + if ( + ProviderProviderTargetPropertyType[ + key as keyof typeof ProviderProviderTargetPropertyType + ] === value + ) { + return true + } + } + } + return false +} + +export function ProviderProviderTargetPropertyTypeFromJSON( + json: any, +): ProviderProviderTargetPropertyType { + return ProviderProviderTargetPropertyTypeFromJSONTyped(json, false) +} + +export function ProviderProviderTargetPropertyTypeFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): ProviderProviderTargetPropertyType { + return json as ProviderProviderTargetPropertyType +} + +export function ProviderProviderTargetPropertyTypeToJSON( + value?: ProviderProviderTargetPropertyType | null, +): any { + return value as any +} + +export function ProviderProviderTargetPropertyTypeToJSONTyped( + value: any, + ignoreDiscriminator: boolean, +): ProviderProviderTargetPropertyType { + return value as ProviderProviderTargetPropertyType +} diff --git a/packages/typescript/src/client/models/ProviderTarget.ts b/packages/typescript/src/client/models/ProviderTarget.ts new file mode 100644 index 0000000..523eaac --- /dev/null +++ b/packages/typescript/src/client/models/ProviderTarget.ts @@ -0,0 +1,107 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +import type { ProviderProviderInfo } from './ProviderProviderInfo' +import { + ProviderProviderInfoFromJSON, + ProviderProviderInfoFromJSONTyped, + ProviderProviderInfoToJSON, + ProviderProviderInfoToJSONTyped, +} from './ProviderProviderInfo' + +/** + * + * @export + * @interface ProviderTarget + */ +export interface ProviderTarget { + /** + * + * @type {boolean} + * @memberof ProviderTarget + */ + isDefault: boolean + /** + * + * @type {string} + * @memberof ProviderTarget + */ + name: string + /** + * JSON encoded map of options + * @type {string} + * @memberof ProviderTarget + */ + options: string + /** + * + * @type {ProviderProviderInfo} + * @memberof ProviderTarget + */ + providerInfo: ProviderProviderInfo +} + +/** + * Check if a given object implements the ProviderTarget interface. + */ +export function instanceOfProviderTarget( + value: object, +): value is ProviderTarget { + if (!('isDefault' in value) || value['isDefault'] === undefined) return false + if (!('name' in value) || value['name'] === undefined) return false + if (!('options' in value) || value['options'] === undefined) return false + if (!('providerInfo' in value) || value['providerInfo'] === undefined) + return false + return true +} + +export function ProviderTargetFromJSON(json: any): ProviderTarget { + return ProviderTargetFromJSONTyped(json, false) +} + +export function ProviderTargetFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): ProviderTarget { + if (json == null) { + return json + } + return { + isDefault: json['isDefault'], + name: json['name'], + options: json['options'], + providerInfo: ProviderProviderInfoFromJSON(json['providerInfo']), + } +} + +export function ProviderTargetToJSON(json: any): ProviderTarget { + return ProviderTargetToJSONTyped(json, false) +} + +export function ProviderTargetToJSONTyped( + value?: ProviderTarget | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + isDefault: value['isDefault'], + name: value['name'], + options: value['options'], + providerInfo: ProviderProviderInfoToJSON(value['providerInfo']), + } +} diff --git a/packages/typescript/src/client/models/ReplaceRequest.ts b/packages/typescript/src/client/models/ReplaceRequest.ts new file mode 100644 index 0000000..2198b92 --- /dev/null +++ b/packages/typescript/src/client/models/ReplaceRequest.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface ReplaceRequest + */ +export interface ReplaceRequest { + /** + * + * @type {Array} + * @memberof ReplaceRequest + */ + files: Array + /** + * + * @type {string} + * @memberof ReplaceRequest + */ + newValue: string + /** + * + * @type {string} + * @memberof ReplaceRequest + */ + pattern: string +} + +/** + * Check if a given object implements the ReplaceRequest interface. + */ +export function instanceOfReplaceRequest( + value: object, +): value is ReplaceRequest { + if (!('files' in value) || value['files'] === undefined) return false + if (!('newValue' in value) || value['newValue'] === undefined) return false + if (!('pattern' in value) || value['pattern'] === undefined) return false + return true +} + +export function ReplaceRequestFromJSON(json: any): ReplaceRequest { + return ReplaceRequestFromJSONTyped(json, false) +} + +export function ReplaceRequestFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): ReplaceRequest { + if (json == null) { + return json + } + return { + files: json['files'], + newValue: json['newValue'], + pattern: json['pattern'], + } +} + +export function ReplaceRequestToJSON(json: any): ReplaceRequest { + return ReplaceRequestToJSONTyped(json, false) +} + +export function ReplaceRequestToJSONTyped( + value?: ReplaceRequest | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + files: value['files'], + newValue: value['newValue'], + pattern: value['pattern'], + } +} diff --git a/packages/typescript/src/client/models/ReplaceResult.ts b/packages/typescript/src/client/models/ReplaceResult.ts new file mode 100644 index 0000000..936302e --- /dev/null +++ b/packages/typescript/src/client/models/ReplaceResult.ts @@ -0,0 +1,84 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface ReplaceResult + */ +export interface ReplaceResult { + /** + * + * @type {string} + * @memberof ReplaceResult + */ + error?: string + /** + * + * @type {string} + * @memberof ReplaceResult + */ + file?: string + /** + * + * @type {boolean} + * @memberof ReplaceResult + */ + success?: boolean +} + +/** + * Check if a given object implements the ReplaceResult interface. + */ +export function instanceOfReplaceResult(value: object): value is ReplaceResult { + return true +} + +export function ReplaceResultFromJSON(json: any): ReplaceResult { + return ReplaceResultFromJSONTyped(json, false) +} + +export function ReplaceResultFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): ReplaceResult { + if (json == null) { + return json + } + return { + error: json['error'] == null ? undefined : json['error'], + file: json['file'] == null ? undefined : json['file'], + success: json['success'] == null ? undefined : json['success'], + } +} + +export function ReplaceResultToJSON(json: any): ReplaceResult { + return ReplaceResultToJSONTyped(json, false) +} + +export function ReplaceResultToJSONTyped( + value?: ReplaceResult | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + error: value['error'], + file: value['file'], + success: value['success'], + } +} diff --git a/packages/typescript/src/client/models/RepositoryUrl.ts b/packages/typescript/src/client/models/RepositoryUrl.ts new file mode 100644 index 0000000..57712df --- /dev/null +++ b/packages/typescript/src/client/models/RepositoryUrl.ts @@ -0,0 +1,69 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface RepositoryUrl + */ +export interface RepositoryUrl { + /** + * + * @type {string} + * @memberof RepositoryUrl + */ + url: string +} + +/** + * Check if a given object implements the RepositoryUrl interface. + */ +export function instanceOfRepositoryUrl(value: object): value is RepositoryUrl { + if (!('url' in value) || value['url'] === undefined) return false + return true +} + +export function RepositoryUrlFromJSON(json: any): RepositoryUrl { + return RepositoryUrlFromJSONTyped(json, false) +} + +export function RepositoryUrlFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): RepositoryUrl { + if (json == null) { + return json + } + return { + url: json['url'], + } +} + +export function RepositoryUrlToJSON(json: any): RepositoryUrl { + return RepositoryUrlToJSONTyped(json, false) +} + +export function RepositoryUrlToJSONTyped( + value?: RepositoryUrl | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + url: value['url'], + } +} diff --git a/packages/typescript/src/client/models/Sample.ts b/packages/typescript/src/client/models/Sample.ts new file mode 100644 index 0000000..0466f33 --- /dev/null +++ b/packages/typescript/src/client/models/Sample.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface Sample + */ +export interface Sample { + /** + * + * @type {string} + * @memberof Sample + */ + description: string + /** + * + * @type {string} + * @memberof Sample + */ + gitUrl: string + /** + * + * @type {string} + * @memberof Sample + */ + name: string +} + +/** + * Check if a given object implements the Sample interface. + */ +export function instanceOfSample(value: object): value is Sample { + if (!('description' in value) || value['description'] === undefined) + return false + if (!('gitUrl' in value) || value['gitUrl'] === undefined) return false + if (!('name' in value) || value['name'] === undefined) return false + return true +} + +export function SampleFromJSON(json: any): Sample { + return SampleFromJSONTyped(json, false) +} + +export function SampleFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): Sample { + if (json == null) { + return json + } + return { + description: json['description'], + gitUrl: json['gitUrl'], + name: json['name'], + } +} + +export function SampleToJSON(json: any): Sample { + return SampleToJSONTyped(json, false) +} + +export function SampleToJSONTyped( + value?: Sample | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + description: value['description'], + gitUrl: value['gitUrl'], + name: value['name'], + } +} diff --git a/packages/typescript/src/client/models/SearchFilesResponse.ts b/packages/typescript/src/client/models/SearchFilesResponse.ts new file mode 100644 index 0000000..f0196a4 --- /dev/null +++ b/packages/typescript/src/client/models/SearchFilesResponse.ts @@ -0,0 +1,71 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +/** + * + * @export + * @interface SearchFilesResponse + */ +export interface SearchFilesResponse { + /** + * + * @type {Array} + * @memberof SearchFilesResponse + */ + files: Array +} + +/** + * Check if a given object implements the SearchFilesResponse interface. + */ +export function instanceOfSearchFilesResponse( + value: object, +): value is SearchFilesResponse { + if (!('files' in value) || value['files'] === undefined) return false + return true +} + +export function SearchFilesResponseFromJSON(json: any): SearchFilesResponse { + return SearchFilesResponseFromJSONTyped(json, false) +} + +export function SearchFilesResponseFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): SearchFilesResponse { + if (json == null) { + return json + } + return { + files: json['files'], + } +} + +export function SearchFilesResponseToJSON(json: any): SearchFilesResponse { + return SearchFilesResponseToJSONTyped(json, false) +} + +export function SearchFilesResponseToJSONTyped( + value?: SearchFilesResponse | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + files: value['files'], + } +} diff --git a/packages/typescript/src/client/models/ServerConfig.ts b/packages/typescript/src/client/models/ServerConfig.ts new file mode 100644 index 0000000..6966082 --- /dev/null +++ b/packages/typescript/src/client/models/ServerConfig.ts @@ -0,0 +1,258 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +import type { FRPSConfig } from './FRPSConfig' +import { + FRPSConfigFromJSON, + FRPSConfigFromJSONTyped, + FRPSConfigToJSON, + FRPSConfigToJSONTyped, +} from './FRPSConfig' +import type { LogFileConfig } from './LogFileConfig' +import { + LogFileConfigFromJSON, + LogFileConfigFromJSONTyped, + LogFileConfigToJSON, + LogFileConfigToJSONTyped, +} from './LogFileConfig' + +/** + * + * @export + * @interface ServerConfig + */ +export interface ServerConfig { + /** + * + * @type {number} + * @memberof ServerConfig + */ + apiPort: number + /** + * + * @type {string} + * @memberof ServerConfig + */ + binariesPath: string + /** + * + * @type {string} + * @memberof ServerConfig + */ + buildImageNamespace?: string + /** + * + * @type {string} + * @memberof ServerConfig + */ + builderImage: string + /** + * + * @type {string} + * @memberof ServerConfig + */ + builderRegistryServer: string + /** + * + * @type {string} + * @memberof ServerConfig + */ + defaultProjectImage: string + /** + * + * @type {string} + * @memberof ServerConfig + */ + defaultProjectUser: string + /** + * + * @type {FRPSConfig} + * @memberof ServerConfig + */ + frps?: FRPSConfig + /** + * + * @type {number} + * @memberof ServerConfig + */ + headscalePort: number + /** + * + * @type {string} + * @memberof ServerConfig + */ + id: string + /** + * + * @type {string} + * @memberof ServerConfig + */ + localBuilderRegistryImage: string + /** + * + * @type {number} + * @memberof ServerConfig + */ + localBuilderRegistryPort: number + /** + * + * @type {LogFileConfig} + * @memberof ServerConfig + */ + logFile: LogFileConfig + /** + * + * @type {string} + * @memberof ServerConfig + */ + providersDir: string + /** + * + * @type {string} + * @memberof ServerConfig + */ + registryUrl: string + /** + * + * @type {string} + * @memberof ServerConfig + */ + samplesIndexUrl?: string + /** + * + * @type {string} + * @memberof ServerConfig + */ + serverDownloadUrl: string +} + +/** + * Check if a given object implements the ServerConfig interface. + */ +export function instanceOfServerConfig(value: object): value is ServerConfig { + if (!('apiPort' in value) || value['apiPort'] === undefined) return false + if (!('binariesPath' in value) || value['binariesPath'] === undefined) + return false + if (!('builderImage' in value) || value['builderImage'] === undefined) + return false + if ( + !('builderRegistryServer' in value) || + value['builderRegistryServer'] === undefined + ) + return false + if ( + !('defaultProjectImage' in value) || + value['defaultProjectImage'] === undefined + ) + return false + if ( + !('defaultProjectUser' in value) || + value['defaultProjectUser'] === undefined + ) + return false + if (!('headscalePort' in value) || value['headscalePort'] === undefined) + return false + if (!('id' in value) || value['id'] === undefined) return false + if ( + !('localBuilderRegistryImage' in value) || + value['localBuilderRegistryImage'] === undefined + ) + return false + if ( + !('localBuilderRegistryPort' in value) || + value['localBuilderRegistryPort'] === undefined + ) + return false + if (!('logFile' in value) || value['logFile'] === undefined) return false + if (!('providersDir' in value) || value['providersDir'] === undefined) + return false + if (!('registryUrl' in value) || value['registryUrl'] === undefined) + return false + if ( + !('serverDownloadUrl' in value) || + value['serverDownloadUrl'] === undefined + ) + return false + return true +} + +export function ServerConfigFromJSON(json: any): ServerConfig { + return ServerConfigFromJSONTyped(json, false) +} + +export function ServerConfigFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): ServerConfig { + if (json == null) { + return json + } + return { + apiPort: json['apiPort'], + binariesPath: json['binariesPath'], + buildImageNamespace: + json['buildImageNamespace'] == null + ? undefined + : json['buildImageNamespace'], + builderImage: json['builderImage'], + builderRegistryServer: json['builderRegistryServer'], + defaultProjectImage: json['defaultProjectImage'], + defaultProjectUser: json['defaultProjectUser'], + frps: json['frps'] == null ? undefined : FRPSConfigFromJSON(json['frps']), + headscalePort: json['headscalePort'], + id: json['id'], + localBuilderRegistryImage: json['localBuilderRegistryImage'], + localBuilderRegistryPort: json['localBuilderRegistryPort'], + logFile: LogFileConfigFromJSON(json['logFile']), + providersDir: json['providersDir'], + registryUrl: json['registryUrl'], + samplesIndexUrl: + json['samplesIndexUrl'] == null ? undefined : json['samplesIndexUrl'], + serverDownloadUrl: json['serverDownloadUrl'], + } +} + +export function ServerConfigToJSON(json: any): ServerConfig { + return ServerConfigToJSONTyped(json, false) +} + +export function ServerConfigToJSONTyped( + value?: ServerConfig | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + apiPort: value['apiPort'], + binariesPath: value['binariesPath'], + buildImageNamespace: value['buildImageNamespace'], + builderImage: value['builderImage'], + builderRegistryServer: value['builderRegistryServer'], + defaultProjectImage: value['defaultProjectImage'], + defaultProjectUser: value['defaultProjectUser'], + frps: FRPSConfigToJSON(value['frps']), + headscalePort: value['headscalePort'], + id: value['id'], + localBuilderRegistryImage: value['localBuilderRegistryImage'], + localBuilderRegistryPort: value['localBuilderRegistryPort'], + logFile: LogFileConfigToJSON(value['logFile']), + providersDir: value['providersDir'], + registryUrl: value['registryUrl'], + samplesIndexUrl: value['samplesIndexUrl'], + serverDownloadUrl: value['serverDownloadUrl'], + } +} diff --git a/packages/typescript/src/client/models/SetGitProviderConfig.ts b/packages/typescript/src/client/models/SetGitProviderConfig.ts new file mode 100644 index 0000000..a8ba4b4 --- /dev/null +++ b/packages/typescript/src/client/models/SetGitProviderConfig.ts @@ -0,0 +1,140 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +import type { SigningMethod } from './SigningMethod' +import { + SigningMethodFromJSON, + SigningMethodFromJSONTyped, + SigningMethodToJSON, + SigningMethodToJSONTyped, +} from './SigningMethod' + +/** + * + * @export + * @interface SetGitProviderConfig + */ +export interface SetGitProviderConfig { + /** + * + * @type {string} + * @memberof SetGitProviderConfig + */ + alias?: string + /** + * + * @type {string} + * @memberof SetGitProviderConfig + */ + baseApiUrl?: string + /** + * + * @type {string} + * @memberof SetGitProviderConfig + */ + id?: string + /** + * + * @type {string} + * @memberof SetGitProviderConfig + */ + providerId: string + /** + * + * @type {string} + * @memberof SetGitProviderConfig + */ + signingKey?: string + /** + * + * @type {SigningMethod} + * @memberof SetGitProviderConfig + */ + signingMethod?: SigningMethod + /** + * + * @type {string} + * @memberof SetGitProviderConfig + */ + token: string + /** + * + * @type {string} + * @memberof SetGitProviderConfig + */ + username?: string +} + +/** + * Check if a given object implements the SetGitProviderConfig interface. + */ +export function instanceOfSetGitProviderConfig( + value: object, +): value is SetGitProviderConfig { + if (!('providerId' in value) || value['providerId'] === undefined) + return false + if (!('token' in value) || value['token'] === undefined) return false + return true +} + +export function SetGitProviderConfigFromJSON(json: any): SetGitProviderConfig { + return SetGitProviderConfigFromJSONTyped(json, false) +} + +export function SetGitProviderConfigFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): SetGitProviderConfig { + if (json == null) { + return json + } + return { + alias: json['alias'] == null ? undefined : json['alias'], + baseApiUrl: json['baseApiUrl'] == null ? undefined : json['baseApiUrl'], + id: json['id'] == null ? undefined : json['id'], + providerId: json['providerId'], + signingKey: json['signingKey'] == null ? undefined : json['signingKey'], + signingMethod: + json['signingMethod'] == null + ? undefined + : SigningMethodFromJSON(json['signingMethod']), + token: json['token'], + username: json['username'] == null ? undefined : json['username'], + } +} + +export function SetGitProviderConfigToJSON(json: any): SetGitProviderConfig { + return SetGitProviderConfigToJSONTyped(json, false) +} + +export function SetGitProviderConfigToJSONTyped( + value?: SetGitProviderConfig | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + alias: value['alias'], + baseApiUrl: value['baseApiUrl'], + id: value['id'], + providerId: value['providerId'], + signingKey: value['signingKey'], + signingMethod: SigningMethodToJSON(value['signingMethod']), + token: value['token'], + username: value['username'], + } +} diff --git a/packages/typescript/src/client/models/SetProjectState.ts b/packages/typescript/src/client/models/SetProjectState.ts new file mode 100644 index 0000000..0af0503 --- /dev/null +++ b/packages/typescript/src/client/models/SetProjectState.ts @@ -0,0 +1,90 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +import type { GitStatus } from './GitStatus' +import { + GitStatusFromJSON, + GitStatusFromJSONTyped, + GitStatusToJSON, + GitStatusToJSONTyped, +} from './GitStatus' + +/** + * + * @export + * @interface SetProjectState + */ +export interface SetProjectState { + /** + * + * @type {GitStatus} + * @memberof SetProjectState + */ + gitStatus?: GitStatus + /** + * + * @type {number} + * @memberof SetProjectState + */ + uptime: number +} + +/** + * Check if a given object implements the SetProjectState interface. + */ +export function instanceOfSetProjectState( + value: object, +): value is SetProjectState { + if (!('uptime' in value) || value['uptime'] === undefined) return false + return true +} + +export function SetProjectStateFromJSON(json: any): SetProjectState { + return SetProjectStateFromJSONTyped(json, false) +} + +export function SetProjectStateFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): SetProjectState { + if (json == null) { + return json + } + return { + gitStatus: + json['gitStatus'] == null + ? undefined + : GitStatusFromJSON(json['gitStatus']), + uptime: json['uptime'], + } +} + +export function SetProjectStateToJSON(json: any): SetProjectState { + return SetProjectStateToJSONTyped(json, false) +} + +export function SetProjectStateToJSONTyped( + value?: SetProjectState | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + gitStatus: GitStatusToJSON(value['gitStatus']), + uptime: value['uptime'], + } +} diff --git a/packages/typescript/src/client/models/SigningMethod.ts b/packages/typescript/src/client/models/SigningMethod.ts new file mode 100644 index 0000000..5ffe841 --- /dev/null +++ b/packages/typescript/src/client/models/SigningMethod.ts @@ -0,0 +1,56 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + */ +export const SigningMethod = { + SigningMethodSSH: 'ssh', + SigningMethodGPG: 'gpg', +} as const +export type SigningMethod = (typeof SigningMethod)[keyof typeof SigningMethod] + +export function instanceOfSigningMethod(value: any): boolean { + for (const key in SigningMethod) { + if (Object.prototype.hasOwnProperty.call(SigningMethod, key)) { + if (SigningMethod[key as keyof typeof SigningMethod] === value) { + return true + } + } + } + return false +} + +export function SigningMethodFromJSON(json: any): SigningMethod { + return SigningMethodFromJSONTyped(json, false) +} + +export function SigningMethodFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): SigningMethod { + return json as SigningMethod +} + +export function SigningMethodToJSON(value?: SigningMethod | null): any { + return value as any +} + +export function SigningMethodToJSONTyped( + value: any, + ignoreDiscriminator: boolean, +): SigningMethod { + return value as SigningMethod +} diff --git a/packages/typescript/src/client/models/Status.ts b/packages/typescript/src/client/models/Status.ts new file mode 100644 index 0000000..62c657d --- /dev/null +++ b/packages/typescript/src/client/models/Status.ts @@ -0,0 +1,62 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + */ +export const Status = { + Unmodified: 'Unmodified', + Untracked: 'Untracked', + Modified: 'Modified', + Added: 'Added', + Deleted: 'Deleted', + Renamed: 'Renamed', + Copied: 'Copied', + UpdatedButUnmerged: 'Updated but unmerged', +} as const +export type Status = (typeof Status)[keyof typeof Status] + +export function instanceOfStatus(value: any): boolean { + for (const key in Status) { + if (Object.prototype.hasOwnProperty.call(Status, key)) { + if (Status[key as keyof typeof Status] === value) { + return true + } + } + } + return false +} + +export function StatusFromJSON(json: any): Status { + return StatusFromJSONTyped(json, false) +} + +export function StatusFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): Status { + return json as Status +} + +export function StatusToJSON(value?: Status | null): any { + return value as any +} + +export function StatusToJSONTyped( + value: any, + ignoreDiscriminator: boolean, +): Status { + return value as Status +} diff --git a/packages/typescript/src/client/models/Workspace.ts b/packages/typescript/src/client/models/Workspace.ts new file mode 100644 index 0000000..67e8b7d --- /dev/null +++ b/packages/typescript/src/client/models/Workspace.ts @@ -0,0 +1,104 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +import type { Project } from './Project' +import { + ProjectFromJSON, + ProjectFromJSONTyped, + ProjectToJSON, + ProjectToJSONTyped, +} from './Project' + +/** + * + * @export + * @interface Workspace + */ +export interface Workspace { + /** + * + * @type {string} + * @memberof Workspace + */ + id: string + /** + * + * @type {string} + * @memberof Workspace + */ + name: string + /** + * + * @type {Array} + * @memberof Workspace + */ + projects: Array + /** + * + * @type {string} + * @memberof Workspace + */ + target: string +} + +/** + * Check if a given object implements the Workspace interface. + */ +export function instanceOfWorkspace(value: object): value is Workspace { + if (!('id' in value) || value['id'] === undefined) return false + if (!('name' in value) || value['name'] === undefined) return false + if (!('projects' in value) || value['projects'] === undefined) return false + if (!('target' in value) || value['target'] === undefined) return false + return true +} + +export function WorkspaceFromJSON(json: any): Workspace { + return WorkspaceFromJSONTyped(json, false) +} + +export function WorkspaceFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): Workspace { + if (json == null) { + return json + } + return { + id: json['id'], + name: json['name'], + projects: (json['projects'] as Array).map(ProjectFromJSON), + target: json['target'], + } +} + +export function WorkspaceToJSON(json: any): Workspace { + return WorkspaceToJSONTyped(json, false) +} + +export function WorkspaceToJSONTyped( + value?: Workspace | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + id: value['id'], + name: value['name'], + projects: (value['projects'] as Array).map(ProjectToJSON), + target: value['target'], + } +} diff --git a/packages/typescript/src/client/models/WorkspaceDTO.ts b/packages/typescript/src/client/models/WorkspaceDTO.ts new file mode 100644 index 0000000..12b6634 --- /dev/null +++ b/packages/typescript/src/client/models/WorkspaceDTO.ts @@ -0,0 +1,120 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +import type { Project } from './Project' +import { + ProjectFromJSON, + ProjectFromJSONTyped, + ProjectToJSON, + ProjectToJSONTyped, +} from './Project' +import type { WorkspaceInfo } from './WorkspaceInfo' +import { + WorkspaceInfoFromJSON, + WorkspaceInfoFromJSONTyped, + WorkspaceInfoToJSON, + WorkspaceInfoToJSONTyped, +} from './WorkspaceInfo' + +/** + * + * @export + * @interface WorkspaceDTO + */ +export interface WorkspaceDTO { + /** + * + * @type {string} + * @memberof WorkspaceDTO + */ + id: string + /** + * + * @type {WorkspaceInfo} + * @memberof WorkspaceDTO + */ + info?: WorkspaceInfo + /** + * + * @type {string} + * @memberof WorkspaceDTO + */ + name: string + /** + * + * @type {Array} + * @memberof WorkspaceDTO + */ + projects: Array + /** + * + * @type {string} + * @memberof WorkspaceDTO + */ + target: string +} + +/** + * Check if a given object implements the WorkspaceDTO interface. + */ +export function instanceOfWorkspaceDTO(value: object): value is WorkspaceDTO { + if (!('id' in value) || value['id'] === undefined) return false + if (!('name' in value) || value['name'] === undefined) return false + if (!('projects' in value) || value['projects'] === undefined) return false + if (!('target' in value) || value['target'] === undefined) return false + return true +} + +export function WorkspaceDTOFromJSON(json: any): WorkspaceDTO { + return WorkspaceDTOFromJSONTyped(json, false) +} + +export function WorkspaceDTOFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): WorkspaceDTO { + if (json == null) { + return json + } + return { + id: json['id'], + info: + json['info'] == null ? undefined : WorkspaceInfoFromJSON(json['info']), + name: json['name'], + projects: (json['projects'] as Array).map(ProjectFromJSON), + target: json['target'], + } +} + +export function WorkspaceDTOToJSON(json: any): WorkspaceDTO { + return WorkspaceDTOToJSONTyped(json, false) +} + +export function WorkspaceDTOToJSONTyped( + value?: WorkspaceDTO | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + id: value['id'], + info: WorkspaceInfoToJSON(value['info']), + name: value['name'], + projects: (value['projects'] as Array).map(ProjectToJSON), + target: value['target'], + } +} diff --git a/packages/typescript/src/client/models/WorkspaceInfo.ts b/packages/typescript/src/client/models/WorkspaceInfo.ts new file mode 100644 index 0000000..99c6e98 --- /dev/null +++ b/packages/typescript/src/client/models/WorkspaceInfo.ts @@ -0,0 +1,95 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +import type { ProjectInfo } from './ProjectInfo' +import { + ProjectInfoFromJSON, + ProjectInfoFromJSONTyped, + ProjectInfoToJSON, + ProjectInfoToJSONTyped, +} from './ProjectInfo' + +/** + * + * @export + * @interface WorkspaceInfo + */ +export interface WorkspaceInfo { + /** + * + * @type {string} + * @memberof WorkspaceInfo + */ + name: string + /** + * + * @type {Array} + * @memberof WorkspaceInfo + */ + projects: Array + /** + * + * @type {string} + * @memberof WorkspaceInfo + */ + providerMetadata?: string +} + +/** + * Check if a given object implements the WorkspaceInfo interface. + */ +export function instanceOfWorkspaceInfo(value: object): value is WorkspaceInfo { + if (!('name' in value) || value['name'] === undefined) return false + if (!('projects' in value) || value['projects'] === undefined) return false + return true +} + +export function WorkspaceInfoFromJSON(json: any): WorkspaceInfo { + return WorkspaceInfoFromJSONTyped(json, false) +} + +export function WorkspaceInfoFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): WorkspaceInfo { + if (json == null) { + return json + } + return { + name: json['name'], + projects: (json['projects'] as Array).map(ProjectInfoFromJSON), + providerMetadata: + json['providerMetadata'] == null ? undefined : json['providerMetadata'], + } +} + +export function WorkspaceInfoToJSON(json: any): WorkspaceInfo { + return WorkspaceInfoToJSONTyped(json, false) +} + +export function WorkspaceInfoToJSONTyped( + value?: WorkspaceInfo | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + name: value['name'], + projects: (value['projects'] as Array).map(ProjectInfoToJSON), + providerMetadata: value['providerMetadata'], + } +} diff --git a/packages/typescript/src/client/models/index.ts b/packages/typescript/src/client/models/index.ts new file mode 100644 index 0000000..b268fcc --- /dev/null +++ b/packages/typescript/src/client/models/index.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './ApiKey' +export * from './ApikeyApiKeyType' +export * from './Build' +export * from './BuildBuildState' +export * from './BuildConfig' +export * from './CachedBuild' +export * from './CloneTarget' +export * from './CompletionContext' +export * from './CompletionItem' +export * from './CompletionList' +export * from './ContainerConfig' +export * from './ContainerRegistry' +export * from './CreateBuildDTO' +export * from './CreatePrebuildDTO' +export * from './CreateProjectConfigDTO' +export * from './CreateProjectDTO' +export * from './CreateProjectSourceDTO' +export * from './CreateProviderTargetDTO' +export * from './CreateWorkspaceDTO' +export * from './DevcontainerConfig' +export * from './ExecuteRequest' +export * from './ExecuteResponse' +export * from './FRPSConfig' +export * from './FileInfo' +export * from './FileStatus' +export * from './GetRepositoryContext' +export * from './GitAddRequest' +export * from './GitBranch' +export * from './GitBranchRequest' +export * from './GitCloneRequest' +export * from './GitCommitInfo' +export * from './GitCommitRequest' +export * from './GitCommitResponse' +export * from './GitNamespace' +export * from './GitProvider' +export * from './GitPullRequest' +export * from './GitRepoRequest' +export * from './GitRepository' +export * from './GitStatus' +export * from './GitUser' +export * from './InstallProviderRequest' +export * from './ListBranchResponse' +export * from './LogFileConfig' +export * from './LspCompletionParams' +export * from './LspDocumentRequest' +export * from './LspLocation' +export * from './LspPosition' +export * from './LspRange' +export * from './LspServerRequest' +export * from './LspSymbol' +export * from './Match' +export * from './NetworkKey' +export * from './Position' +export * from './PrebuildConfig' +export * from './PrebuildDTO' +export * from './ProfileData' +export * from './Project' +export * from './ProjectConfig' +export * from './ProjectDirResponse' +export * from './ProjectInfo' +export * from './ProjectState' +export * from './Provider' +export * from './ProviderProviderInfo' +export * from './ProviderProviderTargetProperty' +export * from './ProviderProviderTargetPropertyType' +export * from './ProviderTarget' +export * from './ReplaceRequest' +export * from './ReplaceResult' +export * from './RepositoryUrl' +export * from './Sample' +export * from './SearchFilesResponse' +export * from './ServerConfig' +export * from './SetGitProviderConfig' +export * from './SetProjectState' +export * from './SigningMethod' +export * from './Status' +export * from './Workspace' +export * from './WorkspaceDTO' +export * from './WorkspaceInfo' diff --git a/packages/typescript/src/client/runtime.ts b/packages/typescript/src/client/runtime.ts new file mode 100644 index 0000000..f75c04d --- /dev/null +++ b/packages/typescript/src/client/runtime.ts @@ -0,0 +1,522 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Daytona Server API + * Daytona Server API + * + * The version of the OpenAPI document: v0.0.0-dev + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export const BASE_PATH = 'http://localhost:3986'.replace(/\/+$/, '') + +export interface ConfigurationParameters { + basePath?: string // override base path + fetchApi?: FetchAPI // override for fetch implementation + middleware?: Middleware[] // middleware to apply before/after fetch requests + queryParamsStringify?: (params: HTTPQuery) => string // stringify function for query strings + username?: string // parameter for basic security + password?: string // parameter for basic security + apiKey?: + | string + | Promise + | ((name: string) => string | Promise) // parameter for apiKey security + accessToken?: + | string + | Promise + | ((name?: string, scopes?: string[]) => string | Promise) // parameter for oauth2 security + headers?: HTTPHeaders //header params we want to use on every request + credentials?: RequestCredentials //value for the credentials param we want to use on each request +} + +export class Configuration { + constructor(private configuration: ConfigurationParameters = {}) {} + + set config(configuration: Configuration) { + this.configuration = configuration + } + + get basePath(): string { + return this.configuration.basePath != null + ? this.configuration.basePath + : BASE_PATH + } + + get fetchApi(): FetchAPI | undefined { + return this.configuration.fetchApi + } + + get middleware(): Middleware[] { + return this.configuration.middleware || [] + } + + get queryParamsStringify(): (params: HTTPQuery) => string { + return this.configuration.queryParamsStringify || querystring + } + + get username(): string | undefined { + return this.configuration.username + } + + get password(): string | undefined { + return this.configuration.password + } + + get apiKey(): ((name: string) => string | Promise) | undefined { + const apiKey = this.configuration.apiKey + if (apiKey) { + return typeof apiKey === 'function' ? apiKey : () => apiKey + } + return undefined + } + + get accessToken(): + | ((name?: string, scopes?: string[]) => string | Promise) + | undefined { + const accessToken = this.configuration.accessToken + if (accessToken) { + return typeof accessToken === 'function' + ? accessToken + : async () => accessToken + } + return undefined + } + + get headers(): HTTPHeaders | undefined { + return this.configuration.headers + } + + get credentials(): RequestCredentials | undefined { + return this.configuration.credentials + } +} + +export const DefaultConfig = new Configuration() + +/** + * This is the base class for all generated API classes. + */ +export class BaseAPI { + private static readonly jsonRegex = new RegExp( + '^(:?application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', + 'i', + ) + private middleware: Middleware[] + + constructor(protected configuration = DefaultConfig) { + this.middleware = configuration.middleware + } + + withMiddleware(this: T, ...middlewares: Middleware[]) { + const next = this.clone() + next.middleware = next.middleware.concat(...middlewares) + return next + } + + withPreMiddleware( + this: T, + ...preMiddlewares: Array + ) { + const middlewares = preMiddlewares.map((pre) => ({ pre })) + return this.withMiddleware(...middlewares) + } + + withPostMiddleware( + this: T, + ...postMiddlewares: Array + ) { + const middlewares = postMiddlewares.map((post) => ({ post })) + return this.withMiddleware(...middlewares) + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + protected isJsonMime(mime: string | null | undefined): boolean { + if (!mime) { + return false + } + return BaseAPI.jsonRegex.test(mime) + } + + protected async request( + context: RequestOpts, + initOverrides?: RequestInit | InitOverrideFunction, + ): Promise { + const { url, init } = await this.createFetchParams(context, initOverrides) + const response = await this.fetchApi(url, init) + if (response && response.status >= 200 && response.status < 300) { + return response + } + throw new ResponseError(response, 'Response returned an error code') + } + + private async createFetchParams( + context: RequestOpts, + initOverrides?: RequestInit | InitOverrideFunction, + ) { + let url = this.configuration.basePath + context.path + if ( + context.query !== undefined && + Object.keys(context.query).length !== 0 + ) { + // only add the querystring to the URL if there are query parameters. + // this is done to avoid urls ending with a "?" character which buggy webservers + // do not handle correctly sometimes. + url += '?' + this.configuration.queryParamsStringify(context.query) + } + + const headers = Object.assign( + {}, + this.configuration.headers, + context.headers, + ) + Object.keys(headers).forEach((key) => + headers[key] === undefined ? delete headers[key] : {}, + ) + + const initOverrideFn = + typeof initOverrides === 'function' + ? initOverrides + : async () => initOverrides + + const initParams = { + method: context.method, + headers, + body: context.body, + credentials: this.configuration.credentials, + } + + const overriddenInit: RequestInit = { + ...initParams, + ...(await initOverrideFn({ + init: initParams, + context, + })), + } + + let body: any + if ( + isFormData(overriddenInit.body) || + overriddenInit.body instanceof URLSearchParams || + isBlob(overriddenInit.body) + ) { + body = overriddenInit.body + } else if (this.isJsonMime(headers['Content-Type'])) { + body = JSON.stringify(overriddenInit.body) + } else { + body = overriddenInit.body + } + + const init: RequestInit = { + ...overriddenInit, + body, + } + + return { url, init } + } + + private fetchApi = async (url: string, init: RequestInit) => { + let fetchParams = { url, init } + for (const middleware of this.middleware) { + if (middleware.pre) { + fetchParams = + (await middleware.pre({ + fetch: this.fetchApi, + ...fetchParams, + })) || fetchParams + } + } + let response: Response | undefined = undefined + try { + response = await (this.configuration.fetchApi || fetch)( + fetchParams.url, + fetchParams.init, + ) + } catch (e) { + for (const middleware of this.middleware) { + if (middleware.onError) { + response = + (await middleware.onError({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + error: e, + response: response ? response.clone() : undefined, + })) || response + } + } + if (response === undefined) { + if (e instanceof Error) { + throw new FetchError( + e, + 'The request failed and the interceptors did not return an alternative response', + ) + } else { + throw e + } + } + } + for (const middleware of this.middleware) { + if (middleware.post) { + response = + (await middleware.post({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + response: response.clone(), + })) || response + } + } + return response + } + + /** + * Create a shallow clone of `this` by constructing a new instance + * and then shallow cloning data members. + */ + private clone(this: T): T { + const constructor = this.constructor as any + const next = new constructor(this.configuration) + next.middleware = this.middleware.slice() + return next + } +} + +function isBlob(value: any): value is Blob { + return typeof Blob !== 'undefined' && value instanceof Blob +} + +function isFormData(value: any): value is FormData { + return typeof FormData !== 'undefined' && value instanceof FormData +} + +export class ResponseError extends Error { + override name: 'ResponseError' = 'ResponseError' + constructor(public response: Response, msg?: string) { + super(msg) + } +} + +export class FetchError extends Error { + override name: 'FetchError' = 'FetchError' + constructor(public cause: Error, msg?: string) { + super(msg) + } +} + +export class RequiredError extends Error { + override name: 'RequiredError' = 'RequiredError' + constructor(public field: string, msg?: string) { + super(msg) + } +} + +export const COLLECTION_FORMATS = { + csv: ',', + ssv: ' ', + tsv: '\t', + pipes: '|', +} + +export type FetchAPI = WindowOrWorkerGlobalScope['fetch'] + +export type Json = any +export type HTTPMethod = + | 'GET' + | 'POST' + | 'PUT' + | 'PATCH' + | 'DELETE' + | 'OPTIONS' + | 'HEAD' +export type HTTPHeaders = { [key: string]: string } +export type HTTPQuery = { + [key: string]: + | string + | number + | null + | boolean + | Array + | Set + | HTTPQuery +} +export type HTTPBody = Json | FormData | URLSearchParams +export type HTTPRequestInit = { + headers?: HTTPHeaders + method: HTTPMethod + credentials?: RequestCredentials + body?: HTTPBody +} +export type ModelPropertyNaming = + | 'camelCase' + | 'snake_case' + | 'PascalCase' + | 'original' + +export type InitOverrideFunction = (requestContext: { + init: HTTPRequestInit + context: RequestOpts +}) => Promise + +export interface FetchParams { + url: string + init: RequestInit +} + +export interface RequestOpts { + path: string + method: HTTPMethod + headers: HTTPHeaders + query?: HTTPQuery + body?: HTTPBody +} + +export function querystring(params: HTTPQuery, prefix: string = ''): string { + return Object.keys(params) + .map((key) => querystringSingleKey(key, params[key], prefix)) + .filter((part) => part.length > 0) + .join('&') +} + +function querystringSingleKey( + key: string, + value: + | string + | number + | null + | undefined + | boolean + | Array + | Set + | HTTPQuery, + keyPrefix: string = '', +): string { + const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key) + if (value instanceof Array) { + const multiValue = value + .map((singleValue) => encodeURIComponent(String(singleValue))) + .join(`&${encodeURIComponent(fullKey)}=`) + return `${encodeURIComponent(fullKey)}=${multiValue}` + } + if (value instanceof Set) { + const valueAsArray = Array.from(value) + return querystringSingleKey(key, valueAsArray, keyPrefix) + } + if (value instanceof Date) { + return `${encodeURIComponent(fullKey)}=${encodeURIComponent( + value.toISOString(), + )}` + } + if (value instanceof Object) { + return querystring(value as HTTPQuery, fullKey) + } + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}` +} + +export function exists(json: any, key: string) { + const value = json[key] + return value !== null && value !== undefined +} + +export function mapValues(data: any, fn: (item: any) => any) { + return Object.keys(data).reduce( + (acc, key) => ({ ...acc, [key]: fn(data[key]) }), + {}, + ) +} + +export function canConsumeForm(consumes: Consume[]): boolean { + for (const consume of consumes) { + if ('multipart/form-data' === consume.contentType) { + return true + } + } + return false +} + +export interface Consume { + contentType: string +} + +export interface RequestContext { + fetch: FetchAPI + url: string + init: RequestInit +} + +export interface ResponseContext { + fetch: FetchAPI + url: string + init: RequestInit + response: Response +} + +export interface ErrorContext { + fetch: FetchAPI + url: string + init: RequestInit + error: unknown + response?: Response +} + +export interface Middleware { + pre?(context: RequestContext): Promise + post?(context: ResponseContext): Promise + onError?(context: ErrorContext): Promise +} + +export interface ApiResponse { + raw: Response + value(): Promise +} + +export interface ResponseTransformer { + (json: any): T +} + +export class JSONApiResponse { + constructor( + public raw: Response, + private transformer: ResponseTransformer = (jsonValue: any) => jsonValue, + ) {} + + async value(): Promise { + return this.transformer(await this.raw.json()) + } +} + +export class VoidApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return undefined + } +} + +export class BlobApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.blob() + } +} + +export class TextApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.text() + } +} diff --git a/packages/typescript/src/code-toolbox/WorkspacePythonCodeToolbox.ts b/packages/typescript/src/code-toolbox/WorkspacePythonCodeToolbox.ts new file mode 100644 index 0000000..1bcad6b --- /dev/null +++ b/packages/typescript/src/code-toolbox/WorkspacePythonCodeToolbox.ts @@ -0,0 +1,12 @@ +import { WorkspaceCodeToolbox } from '../Workspace' + +export class WorkspacePythonCodeToolbox implements WorkspaceCodeToolbox { + public getDefaultImage(): string { + return 'daytonaio/ai-test:0.1.0' + } + + public getRunCommand(code: string): string { + const base64Code = Buffer.from(code).toString('base64') + return `python3 -c "exec(__import__('base64').b64decode('${base64Code}').decode())"` + } +} diff --git a/packages/typescript/src/code-toolbox/WorkspaceTsCodeToolbox.ts b/packages/typescript/src/code-toolbox/WorkspaceTsCodeToolbox.ts new file mode 100644 index 0000000..3b3138d --- /dev/null +++ b/packages/typescript/src/code-toolbox/WorkspaceTsCodeToolbox.ts @@ -0,0 +1,12 @@ +import { WorkspaceCodeToolbox } from '../Workspace' + +export class WorkspaceTsCodeToolbox implements WorkspaceCodeToolbox { + public getDefaultImage(): string { + return 'daytonaio/ai-test:0.1.0' + } + + public getRunCommand(code: string): string { + const base64Code = Buffer.from(code).toString('base64') + return `python3 -c "exec(__import__('base64').b64decode('${base64Code}').decode())"` + } +} diff --git a/packages/typescript/src/index.ts b/packages/typescript/src/index.ts new file mode 100644 index 0000000..2f5523d --- /dev/null +++ b/packages/typescript/src/index.ts @@ -0,0 +1 @@ +export * from './Daytona' diff --git a/packages/typescript/tsconfig.json b/packages/typescript/tsconfig.json new file mode 100644 index 0000000..bd3e7ff --- /dev/null +++ b/packages/typescript/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "target": "es2018", + "module": "commonjs", + "declaration": true, + "rootDir": "./src", + "outDir": "./dist", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true + }, + "include": ["src"], + "exclude": ["node_modules", "dist", "**/__tests__/*"] + } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..8cf3256 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..475ab56 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "paths": { + "@daytona/sdk": ["packages/ts/src"] + } + } + } \ No newline at end of file