From dc43b2269ae7b69bfd6ab7304467239de2ccb92d Mon Sep 17 00:00:00 2001 From: "codegen-sh[bot]" <131295404+codegen-sh[bot]@users.noreply.github.com> Date: Thu, 14 Aug 2025 23:51:13 +0000 Subject: [PATCH 1/4] Regenerate client using OpenAPI Generator 7.12.0 Co-authored-by: Jay Hack --- .github/workflows/python.yml | 20 +- .openapi-generator/FILES | 1 - README.md | 57 +++- gen/developer-api-client/.gitignore | 23 ++ gen/developer-api-client/README.md | 124 ++++++++ .../developer_api_client/__init__.py | 8 + .../developer_api_client/api/__init__.py | 1 + .../api/agents/__init__.py | 1 + .../api/organizations/__init__.py | 1 + .../api/users/__init__.py | 1 + .../developer_api_client/client.py | 268 ++++++++++++++++++ .../developer_api_client/errors.py | 16 ++ .../developer_api_client/models/__init__.py | 25 ++ .../models/agent_run_response.py | 150 ++++++++++ .../models/create_agent_run_input.py | 59 ++++ .../models/fast_api_rate_limit_response.py | 68 +++++ .../models/http_validation_error.py | 75 +++++ .../models/organization_response.py | 82 ++++++ .../models/organization_settings.py | 68 +++++ .../models/page_organization_response.py | 105 +++++++ .../models/page_user_response.py | 105 +++++++ .../models/user_response.py | 118 ++++++++ .../models/validation_error.py | 88 ++++++ .../developer_api_client/py.typed | 1 + .../developer_api_client/types.py | 54 ++++ gen/developer-api-client/pyproject.toml | 26 ++ openapitools.json | 7 + pyproject.toml | 64 +++-- requirements.txt | 4 + setup.cfg | 2 + setup.py | 49 ++++ test-requirements.txt | 6 + 32 files changed, 1631 insertions(+), 46 deletions(-) create mode 100644 gen/developer-api-client/.gitignore create mode 100644 gen/developer-api-client/README.md create mode 100644 gen/developer-api-client/developer_api_client/__init__.py create mode 100644 gen/developer-api-client/developer_api_client/api/__init__.py create mode 100644 gen/developer-api-client/developer_api_client/api/agents/__init__.py create mode 100644 gen/developer-api-client/developer_api_client/api/organizations/__init__.py create mode 100644 gen/developer-api-client/developer_api_client/api/users/__init__.py create mode 100644 gen/developer-api-client/developer_api_client/client.py create mode 100644 gen/developer-api-client/developer_api_client/errors.py create mode 100644 gen/developer-api-client/developer_api_client/models/__init__.py create mode 100644 gen/developer-api-client/developer_api_client/models/agent_run_response.py create mode 100644 gen/developer-api-client/developer_api_client/models/create_agent_run_input.py create mode 100644 gen/developer-api-client/developer_api_client/models/fast_api_rate_limit_response.py create mode 100644 gen/developer-api-client/developer_api_client/models/http_validation_error.py create mode 100644 gen/developer-api-client/developer_api_client/models/organization_response.py create mode 100644 gen/developer-api-client/developer_api_client/models/organization_settings.py create mode 100644 gen/developer-api-client/developer_api_client/models/page_organization_response.py create mode 100644 gen/developer-api-client/developer_api_client/models/page_user_response.py create mode 100644 gen/developer-api-client/developer_api_client/models/user_response.py create mode 100644 gen/developer-api-client/developer_api_client/models/validation_error.py create mode 100644 gen/developer-api-client/developer_api_client/py.typed create mode 100644 gen/developer-api-client/developer_api_client/types.py create mode 100644 gen/developer-api-client/pyproject.toml create mode 100644 openapitools.json create mode 100644 requirements.txt create mode 100644 setup.cfg create mode 100644 setup.py create mode 100644 test-requirements.txt diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 029b128..b10c406 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -5,13 +5,7 @@ name: codegen_api_client Python package -on: - push: - branches: - - develop - pull_request: - branches: - - develop +on: [push, pull_request] jobs: build: @@ -23,11 +17,15 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up UV ${{ matrix.python-version }} - uses: astral-sh/setup-uv@v5 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 with: - enable-cache: true python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install -r test-requirements.txt - name: Test with pytest run: | - uv run pytest --cov=codegen_api_client + pytest --cov=codegen_api_client diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 8a25dfd..2f319ae 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -1,7 +1,6 @@ .github/workflows/python.yml .gitignore .gitlab-ci.yml -.openapi-generator-ignore .travis.yml README.md codegen_api_client/__init__.py diff --git a/README.md b/README.md index d420724..c978aa7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,60 @@ # codegen-api-client API for application developers +## Regenerating the Client + +This client is automatically generated from the OpenAPI specification. To regenerate the client: + +### Using Docker (Recommended) + +```bash +# Pull the OpenAPI Generator Docker image (version 7.12.0 to match current) +docker pull openapitools/openapi-generator-cli:v7.12.0 + +# Run the generator (from the repository root) +docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli:v7.12.0 generate \ + -i /local/gen/openapi.yaml \ + -g python \ + -c /local/gen/config.json \ + -o /local +``` + +### Alternative: Using NPM + +```bash +# Install via npm +npm install -g @openapitools/openapi-generator-cli@7.12.0 + +# Set the version +npx @openapitools/openapi-generator-cli version-manager set 7.12.0 + +# Generate the client +npx @openapitools/openapi-generator-cli generate \ + -i ./gen/openapi.yaml \ + -g python \ + -c ./gen/config.json \ + -o . +``` + +### After Generation + +```bash +# Build the package +uv build + +# Optionally publish the package +uv publish +``` + +### Important Notes + +- The OpenAPI spec at `./gen/openapi.yaml` is the source of truth for this client +- Update this spec file first if you need to update the API client +- The configuration in `./gen/config.json` specifies the package name as "codegen_api_client" +- GitHub workflows handle testing and publishing, but not regeneration + +--- + This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 1.0.0 @@ -114,6 +168,3 @@ Endpoints do not require authorization. ## Author - - - diff --git a/gen/developer-api-client/.gitignore b/gen/developer-api-client/.gitignore new file mode 100644 index 0000000..79a2c3d --- /dev/null +++ b/gen/developer-api-client/.gitignore @@ -0,0 +1,23 @@ +__pycache__/ +build/ +dist/ +*.egg-info/ +.pytest_cache/ + +# pyenv +.python-version + +# Environments +.env +.venv + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# JetBrains +.idea/ + +/coverage.xml +/.coverage diff --git a/gen/developer-api-client/README.md b/gen/developer-api-client/README.md new file mode 100644 index 0000000..10c3046 --- /dev/null +++ b/gen/developer-api-client/README.md @@ -0,0 +1,124 @@ +# developer-api-client +A client library for accessing Developer API + +## Usage +First, create a client: + +```python +from developer_api_client import Client + +client = Client(base_url="https://api.example.com") +``` + +If the endpoints you're going to hit require authentication, use `AuthenticatedClient` instead: + +```python +from developer_api_client import AuthenticatedClient + +client = AuthenticatedClient(base_url="https://api.example.com", token="SuperSecretToken") +``` + +Now call your endpoint and use your models: + +```python +from developer_api_client.models import MyDataModel +from developer_api_client.api.my_tag import get_my_data_model +from developer_api_client.types import Response + +with client as client: + my_data: MyDataModel = get_my_data_model.sync(client=client) + # or if you need more info (e.g. status_code) + response: Response[MyDataModel] = get_my_data_model.sync_detailed(client=client) +``` + +Or do the same thing with an async version: + +```python +from developer_api_client.models import MyDataModel +from developer_api_client.api.my_tag import get_my_data_model +from developer_api_client.types import Response + +async with client as client: + my_data: MyDataModel = await get_my_data_model.asyncio(client=client) + response: Response[MyDataModel] = await get_my_data_model.asyncio_detailed(client=client) +``` + +By default, when you're calling an HTTPS API it will attempt to verify that SSL is working correctly. Using certificate verification is highly recommended most of the time, but sometimes you may need to authenticate to a server (especially an internal server) using a custom certificate bundle. + +```python +client = AuthenticatedClient( + base_url="https://internal_api.example.com", + token="SuperSecretToken", + verify_ssl="/path/to/certificate_bundle.pem", +) +``` + +You can also disable certificate validation altogether, but beware that **this is a security risk**. + +```python +client = AuthenticatedClient( + base_url="https://internal_api.example.com", + token="SuperSecretToken", + verify_ssl=False +) +``` + +Things to know: +1. Every path/method combo becomes a Python module with four functions: + 1. `sync`: Blocking request that returns parsed data (if successful) or `None` + 1. `sync_detailed`: Blocking request that always returns a `Request`, optionally with `parsed` set if the request was successful. + 1. `asyncio`: Like `sync` but async instead of blocking + 1. `asyncio_detailed`: Like `sync_detailed` but async instead of blocking + +1. All path/query params, and bodies become method arguments. +1. If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above) +1. Any endpoint which did not have a tag will be in `developer_api_client.api.default` + +## Advanced customizations + +There are more settings on the generated `Client` class which let you control more runtime behavior, check out the docstring on that class for more info. You can also customize the underlying `httpx.Client` or `httpx.AsyncClient` (depending on your use-case): + +```python +from developer_api_client import Client + +def log_request(request): + print(f"Request event hook: {request.method} {request.url} - Waiting for response") + +def log_response(response): + request = response.request + print(f"Response event hook: {request.method} {request.url} - Status {response.status_code}") + +client = Client( + base_url="https://api.example.com", + httpx_args={"event_hooks": {"request": [log_request], "response": [log_response]}}, +) + +# Or get the underlying httpx client to modify directly with client.get_httpx_client() or client.get_async_httpx_client() +``` + +You can even set the httpx client directly, but beware that this will override any existing settings (e.g., base_url): + +```python +import httpx +from developer_api_client import Client + +client = Client( + base_url="https://api.example.com", +) +# Note that base_url needs to be re-set, as would any shared cookies, headers, etc. +client.set_httpx_client(httpx.Client(base_url="https://api.example.com", proxies="http://localhost:8030")) +``` + +## Building / publishing this package +This project uses [Poetry](https://python-poetry.org/) to manage dependencies and packaging. Here are the basics: +1. Update the metadata in pyproject.toml (e.g. authors, version) +1. If you're using a private repository, configure it with Poetry + 1. `poetry config repositories. ` + 1. `poetry config http-basic. ` +1. Publish the client with `poetry publish --build -r ` or, if for public PyPI, just `poetry publish --build` + +If you want to install this client into another project without publishing it (e.g. for development) then: +1. If that project **is using Poetry**, you can simply do `poetry add ` from that project +1. If that project is not using Poetry: + 1. Build a wheel with `poetry build -f wheel` + 1. Install that wheel from the other project `pip install ` diff --git a/gen/developer-api-client/developer_api_client/__init__.py b/gen/developer-api-client/developer_api_client/__init__.py new file mode 100644 index 0000000..6fc6bc6 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/__init__.py @@ -0,0 +1,8 @@ +"""A client library for accessing Developer API""" + +from .client import AuthenticatedClient, Client + +__all__ = ( + "AuthenticatedClient", + "Client", +) diff --git a/gen/developer-api-client/developer_api_client/api/__init__.py b/gen/developer-api-client/developer_api_client/api/__init__.py new file mode 100644 index 0000000..81f9fa2 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/api/__init__.py @@ -0,0 +1 @@ +"""Contains methods for accessing the API""" diff --git a/gen/developer-api-client/developer_api_client/api/agents/__init__.py b/gen/developer-api-client/developer_api_client/api/agents/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/api/agents/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/gen/developer-api-client/developer_api_client/api/organizations/__init__.py b/gen/developer-api-client/developer_api_client/api/organizations/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/api/organizations/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/gen/developer-api-client/developer_api_client/api/users/__init__.py b/gen/developer-api-client/developer_api_client/api/users/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/api/users/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/gen/developer-api-client/developer_api_client/client.py b/gen/developer-api-client/developer_api_client/client.py new file mode 100644 index 0000000..e80446f --- /dev/null +++ b/gen/developer-api-client/developer_api_client/client.py @@ -0,0 +1,268 @@ +import ssl +from typing import Any, Optional, Union + +import httpx +from attrs import define, evolve, field + + +@define +class Client: + """A class for keeping track of data related to the API + + The following are accepted as keyword arguments and will be used to construct httpx Clients internally: + + ``base_url``: The base URL for the API, all requests are made to a relative path to this URL + + ``cookies``: A dictionary of cookies to be sent with every request + + ``headers``: A dictionary of headers to be sent with every request + + ``timeout``: The maximum amount of a time a request can take. API functions will raise + httpx.TimeoutException if this is exceeded. + + ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production, + but can be set to False for testing purposes. + + ``follow_redirects``: Whether or not to follow redirects. Default value is False. + + ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor. + + + Attributes: + raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a + status code that was not documented in the source OpenAPI document. Can also be provided as a keyword + argument to the constructor. + """ + + raise_on_unexpected_status: bool = field(default=False, kw_only=True) + _base_url: str = field(alias="base_url") + _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") + _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") + _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True, alias="timeout") + _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True, alias="verify_ssl") + _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") + _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") + _client: Optional[httpx.Client] = field(default=None, init=False) + _async_client: Optional[httpx.AsyncClient] = field(default=None, init=False) + + def with_headers(self, headers: dict[str, str]) -> "Client": + """Get a new client matching this one with additional headers""" + if self._client is not None: + self._client.headers.update(headers) + if self._async_client is not None: + self._async_client.headers.update(headers) + return evolve(self, headers={**self._headers, **headers}) + + def with_cookies(self, cookies: dict[str, str]) -> "Client": + """Get a new client matching this one with additional cookies""" + if self._client is not None: + self._client.cookies.update(cookies) + if self._async_client is not None: + self._async_client.cookies.update(cookies) + return evolve(self, cookies={**self._cookies, **cookies}) + + def with_timeout(self, timeout: httpx.Timeout) -> "Client": + """Get a new client matching this one with a new timeout (in seconds)""" + if self._client is not None: + self._client.timeout = timeout + if self._async_client is not None: + self._async_client.timeout = timeout + return evolve(self, timeout=timeout) + + def set_httpx_client(self, client: httpx.Client) -> "Client": + """Manually set the underlying httpx.Client + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._client = client + return self + + def get_httpx_client(self) -> httpx.Client: + """Get the underlying httpx.Client, constructing a new one if not previously set""" + if self._client is None: + self._client = httpx.Client( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._client + + def __enter__(self) -> "Client": + """Enter a context manager for self.client—you cannot enter twice (see httpx docs)""" + self.get_httpx_client().__enter__() + return self + + def __exit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for internal httpx.Client (see httpx docs)""" + self.get_httpx_client().__exit__(*args, **kwargs) + + def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Client": + """Manually the underlying httpx.AsyncClient + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._async_client = async_client + return self + + def get_async_httpx_client(self) -> httpx.AsyncClient: + """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" + if self._async_client is None: + self._async_client = httpx.AsyncClient( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._async_client + + async def __aenter__(self) -> "Client": + """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)""" + await self.get_async_httpx_client().__aenter__() + return self + + async def __aexit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)""" + await self.get_async_httpx_client().__aexit__(*args, **kwargs) + + +@define +class AuthenticatedClient: + """A Client which has been authenticated for use on secured endpoints + + The following are accepted as keyword arguments and will be used to construct httpx Clients internally: + + ``base_url``: The base URL for the API, all requests are made to a relative path to this URL + + ``cookies``: A dictionary of cookies to be sent with every request + + ``headers``: A dictionary of headers to be sent with every request + + ``timeout``: The maximum amount of a time a request can take. API functions will raise + httpx.TimeoutException if this is exceeded. + + ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production, + but can be set to False for testing purposes. + + ``follow_redirects``: Whether or not to follow redirects. Default value is False. + + ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor. + + + Attributes: + raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a + status code that was not documented in the source OpenAPI document. Can also be provided as a keyword + argument to the constructor. + token: The token to use for authentication + prefix: The prefix to use for the Authorization header + auth_header_name: The name of the Authorization header + """ + + raise_on_unexpected_status: bool = field(default=False, kw_only=True) + _base_url: str = field(alias="base_url") + _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") + _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") + _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True, alias="timeout") + _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True, alias="verify_ssl") + _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") + _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") + _client: Optional[httpx.Client] = field(default=None, init=False) + _async_client: Optional[httpx.AsyncClient] = field(default=None, init=False) + + token: str + prefix: str = "Bearer" + auth_header_name: str = "Authorization" + + def with_headers(self, headers: dict[str, str]) -> "AuthenticatedClient": + """Get a new client matching this one with additional headers""" + if self._client is not None: + self._client.headers.update(headers) + if self._async_client is not None: + self._async_client.headers.update(headers) + return evolve(self, headers={**self._headers, **headers}) + + def with_cookies(self, cookies: dict[str, str]) -> "AuthenticatedClient": + """Get a new client matching this one with additional cookies""" + if self._client is not None: + self._client.cookies.update(cookies) + if self._async_client is not None: + self._async_client.cookies.update(cookies) + return evolve(self, cookies={**self._cookies, **cookies}) + + def with_timeout(self, timeout: httpx.Timeout) -> "AuthenticatedClient": + """Get a new client matching this one with a new timeout (in seconds)""" + if self._client is not None: + self._client.timeout = timeout + if self._async_client is not None: + self._async_client.timeout = timeout + return evolve(self, timeout=timeout) + + def set_httpx_client(self, client: httpx.Client) -> "AuthenticatedClient": + """Manually set the underlying httpx.Client + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._client = client + return self + + def get_httpx_client(self) -> httpx.Client: + """Get the underlying httpx.Client, constructing a new one if not previously set""" + if self._client is None: + self._headers[self.auth_header_name] = f"{self.prefix} {self.token}" if self.prefix else self.token + self._client = httpx.Client( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._client + + def __enter__(self) -> "AuthenticatedClient": + """Enter a context manager for self.client—you cannot enter twice (see httpx docs)""" + self.get_httpx_client().__enter__() + return self + + def __exit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for internal httpx.Client (see httpx docs)""" + self.get_httpx_client().__exit__(*args, **kwargs) + + def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "AuthenticatedClient": + """Manually the underlying httpx.AsyncClient + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._async_client = async_client + return self + + def get_async_httpx_client(self) -> httpx.AsyncClient: + """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" + if self._async_client is None: + self._headers[self.auth_header_name] = f"{self.prefix} {self.token}" if self.prefix else self.token + self._async_client = httpx.AsyncClient( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._async_client + + async def __aenter__(self) -> "AuthenticatedClient": + """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)""" + await self.get_async_httpx_client().__aenter__() + return self + + async def __aexit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)""" + await self.get_async_httpx_client().__aexit__(*args, **kwargs) diff --git a/gen/developer-api-client/developer_api_client/errors.py b/gen/developer-api-client/developer_api_client/errors.py new file mode 100644 index 0000000..5f92e76 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/errors.py @@ -0,0 +1,16 @@ +"""Contains shared errors types that can be raised from API functions""" + + +class UnexpectedStatus(Exception): + """Raised by api functions when the response status an undocumented status and Client.raise_on_unexpected_status is True""" + + def __init__(self, status_code: int, content: bytes): + self.status_code = status_code + self.content = content + + super().__init__( + f"Unexpected status code: {status_code}\n\nResponse content:\n{content.decode(errors='ignore')}" + ) + + +__all__ = ["UnexpectedStatus"] diff --git a/gen/developer-api-client/developer_api_client/models/__init__.py b/gen/developer-api-client/developer_api_client/models/__init__.py new file mode 100644 index 0000000..7be2b72 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/__init__.py @@ -0,0 +1,25 @@ +"""Contains all the data models used in inputs/outputs""" + +from .agent_run_response import AgentRunResponse +from .create_agent_run_input import CreateAgentRunInput +from .fast_api_rate_limit_response import FastAPIRateLimitResponse +from .http_validation_error import HTTPValidationError +from .organization_response import OrganizationResponse +from .organization_settings import OrganizationSettings +from .page_organization_response import PageOrganizationResponse +from .page_user_response import PageUserResponse +from .user_response import UserResponse +from .validation_error import ValidationError + +__all__ = ( + "AgentRunResponse", + "CreateAgentRunInput", + "FastAPIRateLimitResponse", + "HTTPValidationError", + "OrganizationResponse", + "OrganizationSettings", + "PageOrganizationResponse", + "PageUserResponse", + "UserResponse", + "ValidationError", +) diff --git a/gen/developer-api-client/developer_api_client/models/agent_run_response.py b/gen/developer-api-client/developer_api_client/models/agent_run_response.py new file mode 100644 index 0000000..d8f34cd --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/agent_run_response.py @@ -0,0 +1,150 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AgentRunResponse") + + +@_attrs_define +class AgentRunResponse: + """Represents an agent run in API responses + + Attributes: + id (int): + organization_id (int): + status (Union[None, Unset, str]): + created_at (Union[None, Unset, str]): + web_url (Union[None, Unset, str]): + result (Union[None, Unset, str]): + """ + + id: int + organization_id: int + status: Union[None, Unset, str] = UNSET + created_at: Union[None, Unset, str] = UNSET + web_url: Union[None, Unset, str] = UNSET + result: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + organization_id = self.organization_id + + status: Union[None, Unset, str] + if isinstance(self.status, Unset): + status = UNSET + else: + status = self.status + + created_at: Union[None, Unset, str] + if isinstance(self.created_at, Unset): + created_at = UNSET + else: + created_at = self.created_at + + web_url: Union[None, Unset, str] + if isinstance(self.web_url, Unset): + web_url = UNSET + else: + web_url = self.web_url + + result: Union[None, Unset, str] + if isinstance(self.result, Unset): + result = UNSET + else: + result = self.result + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "organization_id": organization_id, + } + ) + if status is not UNSET: + field_dict["status"] = status + if created_at is not UNSET: + field_dict["created_at"] = created_at + if web_url is not UNSET: + field_dict["web_url"] = web_url + if result is not UNSET: + field_dict["result"] = result + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + organization_id = d.pop("organization_id") + + def _parse_status(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + status = _parse_status(d.pop("status", UNSET)) + + def _parse_created_at(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + created_at = _parse_created_at(d.pop("created_at", UNSET)) + + def _parse_web_url(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + web_url = _parse_web_url(d.pop("web_url", UNSET)) + + def _parse_result(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + result = _parse_result(d.pop("result", UNSET)) + + agent_run_response = cls( + id=id, + organization_id=organization_id, + status=status, + created_at=created_at, + web_url=web_url, + result=result, + ) + + agent_run_response.additional_properties = d + return agent_run_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/create_agent_run_input.py b/gen/developer-api-client/developer_api_client/models/create_agent_run_input.py new file mode 100644 index 0000000..9f26386 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/create_agent_run_input.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CreateAgentRunInput") + + +@_attrs_define +class CreateAgentRunInput: + """ + Attributes: + prompt (str): + """ + + prompt: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + prompt = self.prompt + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "prompt": prompt, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + prompt = d.pop("prompt") + + create_agent_run_input = cls( + prompt=prompt, + ) + + create_agent_run_input.additional_properties = d + return create_agent_run_input + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/fast_api_rate_limit_response.py b/gen/developer-api-client/developer_api_client/models/fast_api_rate_limit_response.py new file mode 100644 index 0000000..ff217a2 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/fast_api_rate_limit_response.py @@ -0,0 +1,68 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="FastAPIRateLimitResponse") + + +@_attrs_define +class FastAPIRateLimitResponse: + """ + Attributes: + detail (Union[Unset, str]): Default: 'Rate limit exceeded'. + status_code (Union[Unset, int]): Default: 429. + """ + + detail: Union[Unset, str] = "Rate limit exceeded" + status_code: Union[Unset, int] = 429 + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + detail = self.detail + + status_code = self.status_code + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if detail is not UNSET: + field_dict["detail"] = detail + if status_code is not UNSET: + field_dict["status_code"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + detail = d.pop("detail", UNSET) + + status_code = d.pop("status_code", UNSET) + + fast_api_rate_limit_response = cls( + detail=detail, + status_code=status_code, + ) + + fast_api_rate_limit_response.additional_properties = d + return fast_api_rate_limit_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/http_validation_error.py b/gen/developer-api-client/developer_api_client/models/http_validation_error.py new file mode 100644 index 0000000..36bb758 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/http_validation_error.py @@ -0,0 +1,75 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.validation_error import ValidationError + + +T = TypeVar("T", bound="HTTPValidationError") + + +@_attrs_define +class HTTPValidationError: + """ + Attributes: + detail (Union[Unset, list['ValidationError']]): + """ + + detail: Union[Unset, list["ValidationError"]] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + detail: Union[Unset, list[dict[str, Any]]] = UNSET + if not isinstance(self.detail, Unset): + detail = [] + for detail_item_data in self.detail: + detail_item = detail_item_data.to_dict() + detail.append(detail_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if detail is not UNSET: + field_dict["detail"] = detail + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.validation_error import ValidationError + + d = dict(src_dict) + detail = [] + _detail = d.pop("detail", UNSET) + for detail_item_data in _detail or []: + detail_item = ValidationError.from_dict(detail_item_data) + + detail.append(detail_item) + + http_validation_error = cls( + detail=detail, + ) + + http_validation_error.additional_properties = d + return http_validation_error + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/organization_response.py b/gen/developer-api-client/developer_api_client/models/organization_response.py new file mode 100644 index 0000000..ff3611b --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/organization_response.py @@ -0,0 +1,82 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.organization_settings import OrganizationSettings + + +T = TypeVar("T", bound="OrganizationResponse") + + +@_attrs_define +class OrganizationResponse: + """Represents an organization in API responses + + Attributes: + id (int): + name (str): + settings (OrganizationSettings): + """ + + id: int + name: str + settings: "OrganizationSettings" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + settings = self.settings.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "name": name, + "settings": settings, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.organization_settings import OrganizationSettings + + d = dict(src_dict) + id = d.pop("id") + + name = d.pop("name") + + settings = OrganizationSettings.from_dict(d.pop("settings")) + + organization_response = cls( + id=id, + name=name, + settings=settings, + ) + + organization_response.additional_properties = d + return organization_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/organization_settings.py b/gen/developer-api-client/developer_api_client/models/organization_settings.py new file mode 100644 index 0000000..f536c68 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/organization_settings.py @@ -0,0 +1,68 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="OrganizationSettings") + + +@_attrs_define +class OrganizationSettings: + """ + Attributes: + enable_pr_creation (Union[Unset, bool]): Default: True. + enable_rules_detection (Union[Unset, bool]): Default: True. + """ + + enable_pr_creation: Union[Unset, bool] = True + enable_rules_detection: Union[Unset, bool] = True + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + enable_pr_creation = self.enable_pr_creation + + enable_rules_detection = self.enable_rules_detection + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if enable_pr_creation is not UNSET: + field_dict["enable_pr_creation"] = enable_pr_creation + if enable_rules_detection is not UNSET: + field_dict["enable_rules_detection"] = enable_rules_detection + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + enable_pr_creation = d.pop("enable_pr_creation", UNSET) + + enable_rules_detection = d.pop("enable_rules_detection", UNSET) + + organization_settings = cls( + enable_pr_creation=enable_pr_creation, + enable_rules_detection=enable_rules_detection, + ) + + organization_settings.additional_properties = d + return organization_settings + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/page_organization_response.py b/gen/developer-api-client/developer_api_client/models/page_organization_response.py new file mode 100644 index 0000000..301c449 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/page_organization_response.py @@ -0,0 +1,105 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.organization_response import OrganizationResponse + + +T = TypeVar("T", bound="PageOrganizationResponse") + + +@_attrs_define +class PageOrganizationResponse: + """ + Attributes: + items (list['OrganizationResponse']): + total (int): + page (int): + size (int): + pages (int): + """ + + items: list["OrganizationResponse"] + total: int + page: int + size: int + pages: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + items = [] + for items_item_data in self.items: + items_item = items_item_data.to_dict() + items.append(items_item) + + total = self.total + + page = self.page + + size = self.size + + pages = self.pages + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "items": items, + "total": total, + "page": page, + "size": size, + "pages": pages, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.organization_response import OrganizationResponse + + d = dict(src_dict) + items = [] + _items = d.pop("items") + for items_item_data in _items: + items_item = OrganizationResponse.from_dict(items_item_data) + + items.append(items_item) + + total = d.pop("total") + + page = d.pop("page") + + size = d.pop("size") + + pages = d.pop("pages") + + page_organization_response = cls( + items=items, + total=total, + page=page, + size=size, + pages=pages, + ) + + page_organization_response.additional_properties = d + return page_organization_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/page_user_response.py b/gen/developer-api-client/developer_api_client/models/page_user_response.py new file mode 100644 index 0000000..86f58cd --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/page_user_response.py @@ -0,0 +1,105 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.user_response import UserResponse + + +T = TypeVar("T", bound="PageUserResponse") + + +@_attrs_define +class PageUserResponse: + """ + Attributes: + items (list['UserResponse']): + total (int): + page (int): + size (int): + pages (int): + """ + + items: list["UserResponse"] + total: int + page: int + size: int + pages: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + items = [] + for items_item_data in self.items: + items_item = items_item_data.to_dict() + items.append(items_item) + + total = self.total + + page = self.page + + size = self.size + + pages = self.pages + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "items": items, + "total": total, + "page": page, + "size": size, + "pages": pages, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.user_response import UserResponse + + d = dict(src_dict) + items = [] + _items = d.pop("items") + for items_item_data in _items: + items_item = UserResponse.from_dict(items_item_data) + + items.append(items_item) + + total = d.pop("total") + + page = d.pop("page") + + size = d.pop("size") + + pages = d.pop("pages") + + page_user_response = cls( + items=items, + total=total, + page=page, + size=size, + pages=pages, + ) + + page_user_response.additional_properties = d + return page_user_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/user_response.py b/gen/developer-api-client/developer_api_client/models/user_response.py new file mode 100644 index 0000000..24bb391 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/user_response.py @@ -0,0 +1,118 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="UserResponse") + + +@_attrs_define +class UserResponse: + """Represents a user in API responses + + Attributes: + id (int): + email (Union[None, str]): + github_user_id (str): + github_username (str): + avatar_url (Union[None, str]): + full_name (Union[None, str]): + """ + + id: int + email: Union[None, str] + github_user_id: str + github_username: str + avatar_url: Union[None, str] + full_name: Union[None, str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + email: Union[None, str] + email = self.email + + github_user_id = self.github_user_id + + github_username = self.github_username + + avatar_url: Union[None, str] + avatar_url = self.avatar_url + + full_name: Union[None, str] + full_name = self.full_name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "email": email, + "github_user_id": github_user_id, + "github_username": github_username, + "avatar_url": avatar_url, + "full_name": full_name, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + def _parse_email(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + email = _parse_email(d.pop("email")) + + github_user_id = d.pop("github_user_id") + + github_username = d.pop("github_username") + + def _parse_avatar_url(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + avatar_url = _parse_avatar_url(d.pop("avatar_url")) + + def _parse_full_name(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + full_name = _parse_full_name(d.pop("full_name")) + + user_response = cls( + id=id, + email=email, + github_user_id=github_user_id, + github_username=github_username, + avatar_url=avatar_url, + full_name=full_name, + ) + + user_response.additional_properties = d + return user_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/validation_error.py b/gen/developer-api-client/developer_api_client/models/validation_error.py new file mode 100644 index 0000000..e298833 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/validation_error.py @@ -0,0 +1,88 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ValidationError") + + +@_attrs_define +class ValidationError: + """ + Attributes: + loc (list[Union[int, str]]): + msg (str): + type_ (str): + """ + + loc: list[Union[int, str]] + msg: str + type_: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + loc = [] + for loc_item_data in self.loc: + loc_item: Union[int, str] + loc_item = loc_item_data + loc.append(loc_item) + + msg = self.msg + + type_ = self.type_ + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "loc": loc, + "msg": msg, + "type": type_, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + loc = [] + _loc = d.pop("loc") + for loc_item_data in _loc: + + def _parse_loc_item(data: object) -> Union[int, str]: + return cast(Union[int, str], data) + + loc_item = _parse_loc_item(loc_item_data) + + loc.append(loc_item) + + msg = d.pop("msg") + + type_ = d.pop("type") + + validation_error = cls( + loc=loc, + msg=msg, + type_=type_, + ) + + validation_error.additional_properties = d + return validation_error + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/py.typed b/gen/developer-api-client/developer_api_client/py.typed new file mode 100644 index 0000000..1aad327 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561 \ No newline at end of file diff --git a/gen/developer-api-client/developer_api_client/types.py b/gen/developer-api-client/developer_api_client/types.py new file mode 100644 index 0000000..1b96ca4 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/types.py @@ -0,0 +1,54 @@ +"""Contains some shared types for properties""" + +from collections.abc import Mapping, MutableMapping +from http import HTTPStatus +from typing import IO, BinaryIO, Generic, Literal, Optional, TypeVar, Union + +from attrs import define + + +class Unset: + def __bool__(self) -> Literal[False]: + return False + + +UNSET: Unset = Unset() + +# The types that `httpx.Client(files=)` can accept, copied from that library. +FileContent = Union[IO[bytes], bytes, str] +FileTypes = Union[ + # (filename, file (or bytes), content_type) + tuple[Optional[str], FileContent, Optional[str]], + # (filename, file (or bytes), content_type, headers) + tuple[Optional[str], FileContent, Optional[str], Mapping[str, str]], +] +RequestFiles = list[tuple[str, FileTypes]] + + +@define +class File: + """Contains information for file uploads""" + + payload: BinaryIO + file_name: Optional[str] = None + mime_type: Optional[str] = None + + def to_tuple(self) -> FileTypes: + """Return a tuple representation that httpx will accept for multipart/form-data""" + return self.file_name, self.payload, self.mime_type + + +T = TypeVar("T") + + +@define +class Response(Generic[T]): + """A response from an endpoint""" + + status_code: HTTPStatus + content: bytes + headers: MutableMapping[str, str] + parsed: Optional[T] + + +__all__ = ["UNSET", "File", "FileTypes", "RequestFiles", "Response", "Unset"] diff --git a/gen/developer-api-client/pyproject.toml b/gen/developer-api-client/pyproject.toml new file mode 100644 index 0000000..95852ef --- /dev/null +++ b/gen/developer-api-client/pyproject.toml @@ -0,0 +1,26 @@ +[tool.poetry] +name = "developer-api-client" +version = "1.0.0" +description = "A client library for accessing Developer API" +authors = [] +readme = "README.md" +packages = [ + { include = "developer_api_client" }, +] +include = ["CHANGELOG.md", "developer_api_client/py.typed"] + +[tool.poetry.dependencies] +python = "^3.9" +httpx = ">=0.23.0,<0.29.0" +attrs = ">=22.2.0" +python-dateutil = "^2.8.0" + +[build-system] +requires = ["poetry-core>=2.0.0,<3.0.0"] +build-backend = "poetry.core.masonry.api" + +[tool.ruff] +line-length = 120 + +[tool.ruff.lint] +select = ["F", "I", "UP"] diff --git a/openapitools.json b/openapitools.json new file mode 100644 index 0000000..6f7db3e --- /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.12.0" + } +} diff --git a/pyproject.toml b/pyproject.toml index 09caf0f..5113d7f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,43 +1,34 @@ -[project] +[tool.poetry] name = "codegen_api_client" version = "1.0.0" description = "Developer API" -authors = [{ name = "OpenAPI Generator Community", email = "team@openapitools.org" }] -requires-python = "~=3.8" +authors = ["OpenAPI Generator Community "] +license = "NoLicense" readme = "README.md" -license = "Apache-2.0" -keywords = [ - "OpenAPI", - "OpenAPI-Generator", - "Developer API", -] -dependencies = [ - "urllib3>= 1.25.3, < 3.0.0", - "python-dateutil>= 2.8.2", - "pydantic>= 2", - "typing-extensions>= 4.7.1", -] +repository = "https://github.com/GIT_USER_ID/GIT_REPO_ID" +keywords = ["OpenAPI", "OpenAPI-Generator", "Developer API"] +include = ["codegen_api_client/py.typed"] -[project.urls] -Repository = "https://github.com/codegen-sh/codegen-api-client" +[tool.poetry.dependencies] +python = "^3.8" -[dependency-groups] -dev = [ - "pytest>= 7.2.1", - "pytest-cov>= 2.8.1", - "tox>= 3.9.0", - "flake8>= 4.0.0", - "types-python-dateutil>= 2.8.19.14", - "mypy>= 1.5", -] +urllib3 = ">= 1.25.3, < 3.0.0" +python-dateutil = ">= 2.8.2" +pydantic = ">= 2" +typing-extensions = ">= 4.7.1" + +[tool.poetry.dev-dependencies] +pytest = ">= 7.2.1" +pytest-cov = ">= 2.8.1" +tox = ">= 3.9.0" +flake8 = ">= 4.0.0" +types-python-dateutil = ">= 2.8.19.14" +mypy = ">= 1.5" -[tool.uv.build-backend] -module-root="" -data = ["codegen_api_client/py.typed"] [build-system] -requires = ["uv_build>=0.6,<0.7"] -build-backend = "uv_build" +requires = ["setuptools"] +build-backend = "setuptools.build_meta" [tool.pylint.'MESSAGES CONTROL'] extension-pkg-whitelist = "pydantic" @@ -69,6 +60,17 @@ disallow_subclassing_any = true disallow_untyped_decorators = true disallow_any_generics = true +### These next few are various gradations of forcing use of type annotations +#disallow_untyped_calls = true +#disallow_incomplete_defs = true +#disallow_untyped_defs = true +# +### This one isn't too hard to get passing, but return on investment is lower +#no_implicit_reexport = true +# +### This one can be tricky to get passing if you use a lot of untyped libraries +#warn_return_any = true + [[tool.mypy.overrides]] module = [ "codegen_api_client.configuration", diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..67f7f68 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +urllib3 >= 1.25.3, < 3.0.0 +python_dateutil >= 2.8.2 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..11433ee --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..d0ca333 --- /dev/null +++ b/setup.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from setuptools import setup, find_packages # noqa: H301 + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools +NAME = "codegen-api-client" +VERSION = "1.0.0" +PYTHON_REQUIRES = ">= 3.8" +REQUIRES = [ + "urllib3 >= 1.25.3, < 3.0.0", + "python-dateutil >= 2.8.2", + "pydantic >= 2", + "typing-extensions >= 4.7.1", +] + +setup( + name=NAME, + version=VERSION, + description="Developer API", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="", + keywords=["OpenAPI", "OpenAPI-Generator", "Developer API"], + install_requires=REQUIRES, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + long_description_content_type='text/markdown', + long_description="""\ + API for application developers + """, # noqa: E501 + package_data={"codegen_api_client": ["py.typed"]}, +) \ No newline at end of file diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000..e98555c --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,6 @@ +pytest >= 7.2.1 +pytest-cov >= 2.8.1 +tox >= 3.9.0 +flake8 >= 4.0.0 +types-python-dateutil >= 2.8.19.14 +mypy >= 1.5 From ca13414aed6023c8cc59c8eda8c4258ef7b2da3a Mon Sep 17 00:00:00 2001 From: "codegen-sh[bot]" <131295404+codegen-sh[bot]@users.noreply.github.com> Date: Fri, 15 Aug 2025 00:01:34 +0000 Subject: [PATCH 2/4] Update OpenAPI spec to latest version and regenerate client Co-authored-by: Jay Hack --- .openapi-generator/FILES | 89 +- codegen_api_client/__init__.py | 30 +- codegen_api_client/api/__init__.py | 6 + codegen_api_client/api/agents_alpha_api.py | 711 +++ codegen_api_client/api/agents_api.py | 5326 ++++++++++++++++- codegen_api_client/api/agents_beta_api.py | 375 ++ codegen_api_client/api/integrations_api.py | 890 +++ codegen_api_client/api/linear_api.py | 1722 ++++++ codegen_api_client/api/organizations_api.py | 36 +- codegen_api_client/api/repositories_api.py | 3708 ++++++++++++ codegen_api_client/api/tools_api.py | 1879 ++++++ codegen_api_client/api/users_api.py | 1016 +++- codegen_api_client/configuration.py | 6 +- codegen_api_client/models/__init__.py | 24 +- .../agent_run_limit_reached_error_response.py | 89 + .../models/agent_run_log_response.py | 140 + .../agent_run_not_found_error_response.py | 89 + .../models/agent_run_response.py | 34 +- .../models/agent_run_with_logs_response.py | 162 + .../models/api_agent_run_source_type.py | 43 + .../models/api_rate_limit_error_response.py | 89 + .../check_suite_retry_stats_response.py | 99 + .../models/check_suite_settings_response.py | 90 + .../models/create_agent_run_input.py | 36 +- .../models/github_pull_request_response.py | 93 + .../models/integration_status.py | 110 + .../no_repos_found_in_org_error_response.py | 89 + codegen_api_client/models/observation.py | 144 + .../organization_integrations_response.py | 101 + .../models/page_agent_run_response.py | 103 + .../models/page_repo_response.py | 103 + .../models/permissions_error_response.py | 89 + codegen_api_client/models/repo_response.py | 125 + .../models/resume_agent_run_input.py | 96 + .../models/stop_agent_run_input.py | 87 + .../models/tool_execution_request.py | 96 + .../models/tool_execution_response.py | 110 + .../update_check_suite_settings_request.py | 100 + .../models/user_not_found_error_response.py | 89 + codegen_api_client/models/user_response.py | 32 +- docs/APIRateLimitErrorResponse.md | 30 + docs/AgentRunLimitReachedErrorResponse.md | 30 + docs/AgentRunLogResponse.md | 37 + docs/AgentRunNotFoundErrorResponse.md | 30 + docs/AgentRunResponse.md | 3 + docs/AgentRunWithLogsResponse.md | 41 + docs/AgentsAlphaApi.md | 182 + docs/AgentsApi.md | 1310 +++- docs/AgentsBetaApi.md | 95 + docs/ApiAgentRunSourceType.md | 24 + docs/CheckSuiteRetryStatsResponse.md | 36 + docs/CheckSuiteSettingsResponse.md | 31 + docs/CreateAgentRunInput.md | 4 + docs/GithubPullRequestResponse.md | 32 + docs/IntegrationStatus.md | 34 + docs/IntegrationsApi.md | 266 + docs/LinearApi.md | 476 ++ docs/NoReposFoundInOrgErrorResponse.md | 30 + docs/Observation.md | 28 + docs/OrganizationIntegrationsResponse.md | 33 + docs/OrganizationsApi.md | 26 +- docs/PageAgentRunResponse.md | 33 + docs/PageRepoResponse.md | 33 + docs/PermissionsErrorResponse.md | 30 + docs/RepoResponse.md | 39 + docs/RepositoriesApi.md | 989 +++ docs/ResumeAgentRunInput.md | 31 + docs/StopAgentRunInput.md | 29 + docs/ToolExecutionRequest.md | 32 + docs/ToolExecutionResponse.md | 34 + docs/ToolsApi.md | 527 ++ docs/UpdateCheckSuiteSettingsRequest.md | 31 + docs/UserNotFoundErrorResponse.md | 30 + docs/UserResponse.md | 14 +- docs/UsersApi.md | 347 +- .../api/agents_alpha/__init__.py | 1 + .../api/integrations/__init__.py | 1 + .../api/linear/__init__.py | 1 + .../api/repositories/__init__.py | 1 + .../api/tools/__init__.py | 1 + .../developer_api_client/models/__init__.py | 62 +- .../agent_run_limit_reached_error_response.py | 71 + .../models/agent_run_log_response.py | 246 + ...ent_run_log_response_observation_type_0.py | 44 + ...gent_run_log_response_tool_input_type_0.py | 44 + ...ent_run_log_response_tool_output_type_0.py | 44 + .../agent_run_not_found_error_response.py | 68 + .../models/agent_run_response.py | 114 +- .../agent_run_response_metadata_type_0.py | 44 + .../models/agent_run_with_logs_response.py | 286 + ..._run_with_logs_response_metadata_type_0.py | 44 + .../models/api_agent_run_source_type.py | 15 + ...se.py => api_rate_limit_error_response.py} | 24 +- .../check_suite_retry_stats_response.py | 112 + .../models/check_suite_settings_response.py | 71 + .../models/create_agent_run_input.py | 115 +- .../create_agent_run_input_metadata_type_0.py | 44 + .../models/github_pull_request_response.py | 83 + .../models/integration_status.py | 148 + .../integration_status_metadata_type_0.py | 44 + .../no_repos_found_in_org_error_response.py | 69 + .../organization_integrations_response.py | 98 + .../models/page_agent_run_response.py | 105 + .../models/page_repo_response.py | 105 + .../models/permissions_error_response.py | 68 + .../models/repo_response.py | 156 + .../models/resume_agent_run_input.py | 101 + .../models/stop_agent_run_input.py | 59 + .../models/tool_execution_request.py | 96 + .../tool_execution_request_arguments.py | 44 + .../models/tool_execution_response.py | 119 + .../update_check_suite_settings_request.py | 106 + .../models/user_not_found_error_response.py | 68 + .../models/user_response.py | 124 +- gen/openapi.yaml | 1992 +++++- ..._agent_run_limit_reached_error_response.py | 52 + test/test_agent_run_log_response.py | 59 + ...test_agent_run_not_found_error_response.py | 52 + test/test_agent_run_with_logs_response.py | 85 + test/test_agents_alpha_api.py | 45 + test/test_agents_beta_api.py | 38 + test/test_api_agent_run_source_type.py | 33 + test/test_api_rate_limit_error_response.py | 52 + test/test_check_suite_retry_stats_response.py | 64 + test/test_check_suite_settings_response.py | 58 + test/test_github_pull_request_response.py | 58 + test/test_integration_status.py | 57 + test/test_integrations_api.py | 52 + test/test_linear_api.py | 73 + ...st_no_repos_found_in_org_error_response.py | 52 + test/test_observation.py | 50 + ...test_organization_integrations_response.py | 72 + test/test_page_agent_run_response.py | 94 + test/test_page_repo_response.py | 84 + test/test_permissions_error_response.py | 52 + test/test_repo_response.py | 70 + test/test_repositories_api.py | 115 + test/test_resume_agent_run_input.py | 57 + test/test_stop_agent_run_input.py | 52 + test/test_tool_execution_request.py | 55 + test/test_tool_execution_response.py | 57 + test/test_tools_api.py | 73 + ...est_update_check_suite_settings_request.py | 54 + test/test_user_not_found_error_response.py | 52 + 144 files changed, 29437 insertions(+), 601 deletions(-) create mode 100644 codegen_api_client/api/agents_alpha_api.py create mode 100644 codegen_api_client/api/agents_beta_api.py create mode 100644 codegen_api_client/api/integrations_api.py create mode 100644 codegen_api_client/api/linear_api.py create mode 100644 codegen_api_client/api/repositories_api.py create mode 100644 codegen_api_client/api/tools_api.py create mode 100644 codegen_api_client/models/agent_run_limit_reached_error_response.py create mode 100644 codegen_api_client/models/agent_run_log_response.py create mode 100644 codegen_api_client/models/agent_run_not_found_error_response.py create mode 100644 codegen_api_client/models/agent_run_with_logs_response.py create mode 100644 codegen_api_client/models/api_agent_run_source_type.py create mode 100644 codegen_api_client/models/api_rate_limit_error_response.py create mode 100644 codegen_api_client/models/check_suite_retry_stats_response.py create mode 100644 codegen_api_client/models/check_suite_settings_response.py create mode 100644 codegen_api_client/models/github_pull_request_response.py create mode 100644 codegen_api_client/models/integration_status.py create mode 100644 codegen_api_client/models/no_repos_found_in_org_error_response.py create mode 100644 codegen_api_client/models/observation.py create mode 100644 codegen_api_client/models/organization_integrations_response.py create mode 100644 codegen_api_client/models/page_agent_run_response.py create mode 100644 codegen_api_client/models/page_repo_response.py create mode 100644 codegen_api_client/models/permissions_error_response.py create mode 100644 codegen_api_client/models/repo_response.py create mode 100644 codegen_api_client/models/resume_agent_run_input.py create mode 100644 codegen_api_client/models/stop_agent_run_input.py create mode 100644 codegen_api_client/models/tool_execution_request.py create mode 100644 codegen_api_client/models/tool_execution_response.py create mode 100644 codegen_api_client/models/update_check_suite_settings_request.py create mode 100644 codegen_api_client/models/user_not_found_error_response.py create mode 100644 docs/APIRateLimitErrorResponse.md create mode 100644 docs/AgentRunLimitReachedErrorResponse.md create mode 100644 docs/AgentRunLogResponse.md create mode 100644 docs/AgentRunNotFoundErrorResponse.md create mode 100644 docs/AgentRunWithLogsResponse.md create mode 100644 docs/AgentsAlphaApi.md create mode 100644 docs/AgentsBetaApi.md create mode 100644 docs/ApiAgentRunSourceType.md create mode 100644 docs/CheckSuiteRetryStatsResponse.md create mode 100644 docs/CheckSuiteSettingsResponse.md create mode 100644 docs/GithubPullRequestResponse.md create mode 100644 docs/IntegrationStatus.md create mode 100644 docs/IntegrationsApi.md create mode 100644 docs/LinearApi.md create mode 100644 docs/NoReposFoundInOrgErrorResponse.md create mode 100644 docs/Observation.md create mode 100644 docs/OrganizationIntegrationsResponse.md create mode 100644 docs/PageAgentRunResponse.md create mode 100644 docs/PageRepoResponse.md create mode 100644 docs/PermissionsErrorResponse.md create mode 100644 docs/RepoResponse.md create mode 100644 docs/RepositoriesApi.md create mode 100644 docs/ResumeAgentRunInput.md create mode 100644 docs/StopAgentRunInput.md create mode 100644 docs/ToolExecutionRequest.md create mode 100644 docs/ToolExecutionResponse.md create mode 100644 docs/ToolsApi.md create mode 100644 docs/UpdateCheckSuiteSettingsRequest.md create mode 100644 docs/UserNotFoundErrorResponse.md create mode 100644 gen/developer-api-client/developer_api_client/api/agents_alpha/__init__.py create mode 100644 gen/developer-api-client/developer_api_client/api/integrations/__init__.py create mode 100644 gen/developer-api-client/developer_api_client/api/linear/__init__.py create mode 100644 gen/developer-api-client/developer_api_client/api/repositories/__init__.py create mode 100644 gen/developer-api-client/developer_api_client/api/tools/__init__.py create mode 100644 gen/developer-api-client/developer_api_client/models/agent_run_limit_reached_error_response.py create mode 100644 gen/developer-api-client/developer_api_client/models/agent_run_log_response.py create mode 100644 gen/developer-api-client/developer_api_client/models/agent_run_log_response_observation_type_0.py create mode 100644 gen/developer-api-client/developer_api_client/models/agent_run_log_response_tool_input_type_0.py create mode 100644 gen/developer-api-client/developer_api_client/models/agent_run_log_response_tool_output_type_0.py create mode 100644 gen/developer-api-client/developer_api_client/models/agent_run_not_found_error_response.py create mode 100644 gen/developer-api-client/developer_api_client/models/agent_run_response_metadata_type_0.py create mode 100644 gen/developer-api-client/developer_api_client/models/agent_run_with_logs_response.py create mode 100644 gen/developer-api-client/developer_api_client/models/agent_run_with_logs_response_metadata_type_0.py create mode 100644 gen/developer-api-client/developer_api_client/models/api_agent_run_source_type.py rename gen/developer-api-client/developer_api_client/models/{fast_api_rate_limit_response.py => api_rate_limit_error_response.py} (71%) create mode 100644 gen/developer-api-client/developer_api_client/models/check_suite_retry_stats_response.py create mode 100644 gen/developer-api-client/developer_api_client/models/check_suite_settings_response.py create mode 100644 gen/developer-api-client/developer_api_client/models/create_agent_run_input_metadata_type_0.py create mode 100644 gen/developer-api-client/developer_api_client/models/github_pull_request_response.py create mode 100644 gen/developer-api-client/developer_api_client/models/integration_status.py create mode 100644 gen/developer-api-client/developer_api_client/models/integration_status_metadata_type_0.py create mode 100644 gen/developer-api-client/developer_api_client/models/no_repos_found_in_org_error_response.py create mode 100644 gen/developer-api-client/developer_api_client/models/organization_integrations_response.py create mode 100644 gen/developer-api-client/developer_api_client/models/page_agent_run_response.py create mode 100644 gen/developer-api-client/developer_api_client/models/page_repo_response.py create mode 100644 gen/developer-api-client/developer_api_client/models/permissions_error_response.py create mode 100644 gen/developer-api-client/developer_api_client/models/repo_response.py create mode 100644 gen/developer-api-client/developer_api_client/models/resume_agent_run_input.py create mode 100644 gen/developer-api-client/developer_api_client/models/stop_agent_run_input.py create mode 100644 gen/developer-api-client/developer_api_client/models/tool_execution_request.py create mode 100644 gen/developer-api-client/developer_api_client/models/tool_execution_request_arguments.py create mode 100644 gen/developer-api-client/developer_api_client/models/tool_execution_response.py create mode 100644 gen/developer-api-client/developer_api_client/models/update_check_suite_settings_request.py create mode 100644 gen/developer-api-client/developer_api_client/models/user_not_found_error_response.py create mode 100644 test/test_agent_run_limit_reached_error_response.py create mode 100644 test/test_agent_run_log_response.py create mode 100644 test/test_agent_run_not_found_error_response.py create mode 100644 test/test_agent_run_with_logs_response.py create mode 100644 test/test_agents_alpha_api.py create mode 100644 test/test_agents_beta_api.py create mode 100644 test/test_api_agent_run_source_type.py create mode 100644 test/test_api_rate_limit_error_response.py create mode 100644 test/test_check_suite_retry_stats_response.py create mode 100644 test/test_check_suite_settings_response.py create mode 100644 test/test_github_pull_request_response.py create mode 100644 test/test_integration_status.py create mode 100644 test/test_integrations_api.py create mode 100644 test/test_linear_api.py create mode 100644 test/test_no_repos_found_in_org_error_response.py create mode 100644 test/test_observation.py create mode 100644 test/test_organization_integrations_response.py create mode 100644 test/test_page_agent_run_response.py create mode 100644 test/test_page_repo_response.py create mode 100644 test/test_permissions_error_response.py create mode 100644 test/test_repo_response.py create mode 100644 test/test_repositories_api.py create mode 100644 test/test_resume_agent_run_input.py create mode 100644 test/test_stop_agent_run_input.py create mode 100644 test/test_tool_execution_request.py create mode 100644 test/test_tool_execution_response.py create mode 100644 test/test_tools_api.py create mode 100644 test/test_update_check_suite_settings_request.py create mode 100644 test/test_user_not_found_error_response.py diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 2f319ae..8639b04 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -5,37 +5,93 @@ README.md codegen_api_client/__init__.py codegen_api_client/api/__init__.py +codegen_api_client/api/agents_alpha_api.py codegen_api_client/api/agents_api.py +codegen_api_client/api/agents_beta_api.py +codegen_api_client/api/integrations_api.py +codegen_api_client/api/linear_api.py codegen_api_client/api/organizations_api.py +codegen_api_client/api/repositories_api.py +codegen_api_client/api/tools_api.py codegen_api_client/api/users_api.py codegen_api_client/api_client.py codegen_api_client/api_response.py codegen_api_client/configuration.py codegen_api_client/exceptions.py codegen_api_client/models/__init__.py +codegen_api_client/models/agent_run_limit_reached_error_response.py +codegen_api_client/models/agent_run_log_response.py +codegen_api_client/models/agent_run_not_found_error_response.py codegen_api_client/models/agent_run_response.py +codegen_api_client/models/agent_run_with_logs_response.py +codegen_api_client/models/api_agent_run_source_type.py +codegen_api_client/models/api_rate_limit_error_response.py +codegen_api_client/models/check_suite_retry_stats_response.py +codegen_api_client/models/check_suite_settings_response.py codegen_api_client/models/create_agent_run_input.py -codegen_api_client/models/fast_api_rate_limit_response.py +codegen_api_client/models/github_pull_request_response.py codegen_api_client/models/http_validation_error.py +codegen_api_client/models/integration_status.py +codegen_api_client/models/no_repos_found_in_org_error_response.py +codegen_api_client/models/observation.py +codegen_api_client/models/organization_integrations_response.py codegen_api_client/models/organization_response.py codegen_api_client/models/organization_settings.py +codegen_api_client/models/page_agent_run_response.py codegen_api_client/models/page_organization_response.py +codegen_api_client/models/page_repo_response.py codegen_api_client/models/page_user_response.py +codegen_api_client/models/permissions_error_response.py +codegen_api_client/models/repo_response.py +codegen_api_client/models/resume_agent_run_input.py +codegen_api_client/models/stop_agent_run_input.py +codegen_api_client/models/tool_execution_request.py +codegen_api_client/models/tool_execution_response.py +codegen_api_client/models/update_check_suite_settings_request.py +codegen_api_client/models/user_not_found_error_response.py codegen_api_client/models/user_response.py codegen_api_client/models/validation_error.py codegen_api_client/models/validation_error_loc_inner.py codegen_api_client/py.typed codegen_api_client/rest.py +docs/APIRateLimitErrorResponse.md +docs/AgentRunLimitReachedErrorResponse.md +docs/AgentRunLogResponse.md +docs/AgentRunNotFoundErrorResponse.md docs/AgentRunResponse.md +docs/AgentRunWithLogsResponse.md +docs/AgentsAlphaApi.md docs/AgentsApi.md +docs/AgentsBetaApi.md +docs/ApiAgentRunSourceType.md +docs/CheckSuiteRetryStatsResponse.md +docs/CheckSuiteSettingsResponse.md docs/CreateAgentRunInput.md -docs/FastAPIRateLimitResponse.md +docs/GithubPullRequestResponse.md docs/HTTPValidationError.md +docs/IntegrationStatus.md +docs/IntegrationsApi.md +docs/LinearApi.md +docs/NoReposFoundInOrgErrorResponse.md +docs/Observation.md +docs/OrganizationIntegrationsResponse.md docs/OrganizationResponse.md docs/OrganizationSettings.md docs/OrganizationsApi.md +docs/PageAgentRunResponse.md docs/PageOrganizationResponse.md +docs/PageRepoResponse.md docs/PageUserResponse.md +docs/PermissionsErrorResponse.md +docs/RepoResponse.md +docs/RepositoriesApi.md +docs/ResumeAgentRunInput.md +docs/StopAgentRunInput.md +docs/ToolExecutionRequest.md +docs/ToolExecutionResponse.md +docs/ToolsApi.md +docs/UpdateCheckSuiteSettingsRequest.md +docs/UserNotFoundErrorResponse.md docs/UserResponse.md docs/UsersApi.md docs/ValidationError.md @@ -47,4 +103,33 @@ setup.cfg setup.py test-requirements.txt test/__init__.py +test/test_agent_run_limit_reached_error_response.py +test/test_agent_run_log_response.py +test/test_agent_run_not_found_error_response.py +test/test_agent_run_with_logs_response.py +test/test_agents_alpha_api.py +test/test_agents_beta_api.py +test/test_api_agent_run_source_type.py +test/test_api_rate_limit_error_response.py +test/test_check_suite_retry_stats_response.py +test/test_check_suite_settings_response.py +test/test_github_pull_request_response.py +test/test_integration_status.py +test/test_integrations_api.py +test/test_linear_api.py +test/test_no_repos_found_in_org_error_response.py +test/test_observation.py +test/test_organization_integrations_response.py +test/test_page_agent_run_response.py +test/test_page_repo_response.py +test/test_permissions_error_response.py +test/test_repo_response.py +test/test_repositories_api.py +test/test_resume_agent_run_input.py +test/test_stop_agent_run_input.py +test/test_tool_execution_request.py +test/test_tool_execution_response.py +test/test_tools_api.py +test/test_update_check_suite_settings_request.py +test/test_user_not_found_error_response.py tox.ini diff --git a/codegen_api_client/__init__.py b/codegen_api_client/__init__.py index b6ca157..244f516 100644 --- a/codegen_api_client/__init__.py +++ b/codegen_api_client/__init__.py @@ -18,7 +18,13 @@ # import apis into sdk package from codegen_api_client.api.agents_api import AgentsApi +from codegen_api_client.api.agents_alpha_api import AgentsAlphaApi +from codegen_api_client.api.agents_beta_api import AgentsBetaApi +from codegen_api_client.api.integrations_api import IntegrationsApi +from codegen_api_client.api.linear_api import LinearApi from codegen_api_client.api.organizations_api import OrganizationsApi +from codegen_api_client.api.repositories_api import RepositoriesApi +from codegen_api_client.api.tools_api import ToolsApi from codegen_api_client.api.users_api import UsersApi # import ApiClient @@ -33,14 +39,36 @@ from codegen_api_client.exceptions import ApiException # import models into sdk package +from codegen_api_client.models.api_rate_limit_error_response import APIRateLimitErrorResponse +from codegen_api_client.models.agent_run_limit_reached_error_response import AgentRunLimitReachedErrorResponse +from codegen_api_client.models.agent_run_log_response import AgentRunLogResponse +from codegen_api_client.models.agent_run_not_found_error_response import AgentRunNotFoundErrorResponse from codegen_api_client.models.agent_run_response import AgentRunResponse +from codegen_api_client.models.agent_run_with_logs_response import AgentRunWithLogsResponse +from codegen_api_client.models.api_agent_run_source_type import ApiAgentRunSourceType +from codegen_api_client.models.check_suite_retry_stats_response import CheckSuiteRetryStatsResponse +from codegen_api_client.models.check_suite_settings_response import CheckSuiteSettingsResponse from codegen_api_client.models.create_agent_run_input import CreateAgentRunInput -from codegen_api_client.models.fast_api_rate_limit_response import FastAPIRateLimitResponse +from codegen_api_client.models.github_pull_request_response import GithubPullRequestResponse from codegen_api_client.models.http_validation_error import HTTPValidationError +from codegen_api_client.models.integration_status import IntegrationStatus +from codegen_api_client.models.no_repos_found_in_org_error_response import NoReposFoundInOrgErrorResponse +from codegen_api_client.models.observation import Observation +from codegen_api_client.models.organization_integrations_response import OrganizationIntegrationsResponse from codegen_api_client.models.organization_response import OrganizationResponse from codegen_api_client.models.organization_settings import OrganizationSettings +from codegen_api_client.models.page_agent_run_response import PageAgentRunResponse from codegen_api_client.models.page_organization_response import PageOrganizationResponse +from codegen_api_client.models.page_repo_response import PageRepoResponse from codegen_api_client.models.page_user_response import PageUserResponse +from codegen_api_client.models.permissions_error_response import PermissionsErrorResponse +from codegen_api_client.models.repo_response import RepoResponse +from codegen_api_client.models.resume_agent_run_input import ResumeAgentRunInput +from codegen_api_client.models.stop_agent_run_input import StopAgentRunInput +from codegen_api_client.models.tool_execution_request import ToolExecutionRequest +from codegen_api_client.models.tool_execution_response import ToolExecutionResponse +from codegen_api_client.models.update_check_suite_settings_request import UpdateCheckSuiteSettingsRequest +from codegen_api_client.models.user_not_found_error_response import UserNotFoundErrorResponse from codegen_api_client.models.user_response import UserResponse from codegen_api_client.models.validation_error import ValidationError from codegen_api_client.models.validation_error_loc_inner import ValidationErrorLocInner diff --git a/codegen_api_client/api/__init__.py b/codegen_api_client/api/__init__.py index c23cdb0..bd938da 100644 --- a/codegen_api_client/api/__init__.py +++ b/codegen_api_client/api/__init__.py @@ -2,6 +2,12 @@ # import apis into api package from codegen_api_client.api.agents_api import AgentsApi +from codegen_api_client.api.agents_alpha_api import AgentsAlphaApi +from codegen_api_client.api.agents_beta_api import AgentsBetaApi +from codegen_api_client.api.integrations_api import IntegrationsApi +from codegen_api_client.api.linear_api import LinearApi from codegen_api_client.api.organizations_api import OrganizationsApi +from codegen_api_client.api.repositories_api import RepositoriesApi +from codegen_api_client.api.tools_api import ToolsApi from codegen_api_client.api.users_api import UsersApi diff --git a/codegen_api_client/api/agents_alpha_api.py b/codegen_api_client/api/agents_alpha_api.py new file mode 100644 index 0000000..b3acdc0 --- /dev/null +++ b/codegen_api_client/api/agents_alpha_api.py @@ -0,0 +1,711 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + 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 +from typing import Any, Optional +from typing_extensions import Annotated +from codegen_api_client.models.agent_run_with_logs_response import AgentRunWithLogsResponse + +from codegen_api_client.api_client import ApiClient, RequestSerialized +from codegen_api_client.api_response import ApiResponse +from codegen_api_client.rest import RESTResponseType + + +class AgentsAlphaApi: + """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_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get( + self, + agent_run_id: StrictInt, + org_id: StrictInt, + skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + authorization: Optional[Any] = 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, + ) -> AgentRunWithLogsResponse: + """Get Agent Run Logs + + Retrieve an agent run with its logs using pagination. This endpoint is currently in ALPHA and IS subject to change. Returns the agent run details along with a paginated list of logs for the specified agent run. The agent run must belong to the specified organization. Logs are returned in chronological order. Uses standard pagination parameters (skip and limit) and includes pagination metadata in the response. Rate limit: 60 requests per 60 seconds. + + :param agent_run_id: (required) + :type agent_run_id: int + :param org_id: (required) + :type org_id: int + :param skip: + :type skip: int + :param limit: + :type limit: int + :param authorization: + :type authorization: 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._get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get_serialize( + agent_run_id=agent_run_id, + org_id=org_id, + skip=skip, + limit=limit, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentRunWithLogsResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + 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_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get_with_http_info( + self, + agent_run_id: StrictInt, + org_id: StrictInt, + skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + authorization: Optional[Any] = 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[AgentRunWithLogsResponse]: + """Get Agent Run Logs + + Retrieve an agent run with its logs using pagination. This endpoint is currently in ALPHA and IS subject to change. Returns the agent run details along with a paginated list of logs for the specified agent run. The agent run must belong to the specified organization. Logs are returned in chronological order. Uses standard pagination parameters (skip and limit) and includes pagination metadata in the response. Rate limit: 60 requests per 60 seconds. + + :param agent_run_id: (required) + :type agent_run_id: int + :param org_id: (required) + :type org_id: int + :param skip: + :type skip: int + :param limit: + :type limit: int + :param authorization: + :type authorization: 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._get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get_serialize( + agent_run_id=agent_run_id, + org_id=org_id, + skip=skip, + limit=limit, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentRunWithLogsResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + 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_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get_without_preload_content( + self, + agent_run_id: StrictInt, + org_id: StrictInt, + skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + authorization: Optional[Any] = 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 Agent Run Logs + + Retrieve an agent run with its logs using pagination. This endpoint is currently in ALPHA and IS subject to change. Returns the agent run details along with a paginated list of logs for the specified agent run. The agent run must belong to the specified organization. Logs are returned in chronological order. Uses standard pagination parameters (skip and limit) and includes pagination metadata in the response. Rate limit: 60 requests per 60 seconds. + + :param agent_run_id: (required) + :type agent_run_id: int + :param org_id: (required) + :type org_id: int + :param skip: + :type skip: int + :param limit: + :type limit: int + :param authorization: + :type authorization: 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._get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get_serialize( + agent_run_id=agent_run_id, + org_id=org_id, + skip=skip, + limit=limit, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentRunWithLogsResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get_serialize( + self, + agent_run_id, + org_id, + skip, + limit, + authorization, + _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 agent_run_id is not None: + _path_params['agent_run_id'] = agent_run_id + if org_id is not None: + _path_params['org_id'] = org_id + # process the query parameters + if skip is not None: + + _query_params.append(('skip', skip)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/alpha/organizations/{org_id}/agent/run/{agent_run_id}/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 get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get_0( + self, + agent_run_id: StrictInt, + org_id: StrictInt, + skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + authorization: Optional[Any] = 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, + ) -> AgentRunWithLogsResponse: + """Get Agent Run Logs + + Retrieve an agent run with its logs using pagination. This endpoint is currently in ALPHA and IS subject to change. Returns the agent run details along with a paginated list of logs for the specified agent run. The agent run must belong to the specified organization. Logs are returned in chronological order. Uses standard pagination parameters (skip and limit) and includes pagination metadata in the response. Rate limit: 60 requests per 60 seconds. + + :param agent_run_id: (required) + :type agent_run_id: int + :param org_id: (required) + :type org_id: int + :param skip: + :type skip: int + :param limit: + :type limit: int + :param authorization: + :type authorization: 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._get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get_0_serialize( + agent_run_id=agent_run_id, + org_id=org_id, + skip=skip, + limit=limit, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentRunWithLogsResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + 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_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get_0_with_http_info( + self, + agent_run_id: StrictInt, + org_id: StrictInt, + skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + authorization: Optional[Any] = 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[AgentRunWithLogsResponse]: + """Get Agent Run Logs + + Retrieve an agent run with its logs using pagination. This endpoint is currently in ALPHA and IS subject to change. Returns the agent run details along with a paginated list of logs for the specified agent run. The agent run must belong to the specified organization. Logs are returned in chronological order. Uses standard pagination parameters (skip and limit) and includes pagination metadata in the response. Rate limit: 60 requests per 60 seconds. + + :param agent_run_id: (required) + :type agent_run_id: int + :param org_id: (required) + :type org_id: int + :param skip: + :type skip: int + :param limit: + :type limit: int + :param authorization: + :type authorization: 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._get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get_0_serialize( + agent_run_id=agent_run_id, + org_id=org_id, + skip=skip, + limit=limit, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentRunWithLogsResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + 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_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get_0_without_preload_content( + self, + agent_run_id: StrictInt, + org_id: StrictInt, + skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + authorization: Optional[Any] = 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 Agent Run Logs + + Retrieve an agent run with its logs using pagination. This endpoint is currently in ALPHA and IS subject to change. Returns the agent run details along with a paginated list of logs for the specified agent run. The agent run must belong to the specified organization. Logs are returned in chronological order. Uses standard pagination parameters (skip and limit) and includes pagination metadata in the response. Rate limit: 60 requests per 60 seconds. + + :param agent_run_id: (required) + :type agent_run_id: int + :param org_id: (required) + :type org_id: int + :param skip: + :type skip: int + :param limit: + :type limit: int + :param authorization: + :type authorization: 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._get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get_0_serialize( + agent_run_id=agent_run_id, + org_id=org_id, + skip=skip, + limit=limit, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentRunWithLogsResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get_0_serialize( + self, + agent_run_id, + org_id, + skip, + limit, + authorization, + _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 agent_run_id is not None: + _path_params['agent_run_id'] = agent_run_id + if org_id is not None: + _path_params['org_id'] = org_id + # process the query parameters + if skip is not None: + + _query_params.append(('skip', skip)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/alpha/organizations/{org_id}/agent/run/{agent_run_id}/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 + ) + + diff --git a/codegen_api_client/api/agents_api.py b/codegen_api_client/api/agents_api.py index b48985d..cb28447 100644 --- a/codegen_api_client/api/agents_api.py +++ b/codegen_api_client/api/agents_api.py @@ -16,34 +16,4845 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import StrictInt +from pydantic import Field, StrictInt from typing import Any, Optional +from typing_extensions import Annotated from codegen_api_client.models.agent_run_response import AgentRunResponse +from codegen_api_client.models.api_agent_run_source_type import ApiAgentRunSourceType from codegen_api_client.models.create_agent_run_input import CreateAgentRunInput +from codegen_api_client.models.page_agent_run_response import PageAgentRunResponse +from codegen_api_client.models.resume_agent_run_input import ResumeAgentRunInput +from codegen_api_client.models.stop_agent_run_input import StopAgentRunInput from codegen_api_client.api_client import ApiClient, RequestSerialized from codegen_api_client.api_response import ApiResponse from codegen_api_client.rest import RESTResponseType -class AgentsApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech +class AgentsApi: + """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 ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post( + self, + org_id: StrictInt, + stop_agent_run_input: StopAgentRunInput, + authorization: Optional[Any] = 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, + ) -> object: + """Ban All Checks For Agent Run + + Ban all checks for a PR and stop all related agents. This endpoint: 1. Flags the PR to prevent future CI/CD check suite events from being processed 2. Stops all current agents for that PR + + :param org_id: (required) + :type org_id: int + :param stop_agent_run_input: (required) + :type stop_agent_run_input: StopAgentRunInput + :param authorization: + :type authorization: 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._ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_serialize( + org_id=org_id, + stop_agent_run_input=stop_agent_run_input, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + 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 ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_with_http_info( + self, + org_id: StrictInt, + stop_agent_run_input: StopAgentRunInput, + authorization: Optional[Any] = 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[object]: + """Ban All Checks For Agent Run + + Ban all checks for a PR and stop all related agents. This endpoint: 1. Flags the PR to prevent future CI/CD check suite events from being processed 2. Stops all current agents for that PR + + :param org_id: (required) + :type org_id: int + :param stop_agent_run_input: (required) + :type stop_agent_run_input: StopAgentRunInput + :param authorization: + :type authorization: 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._ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_serialize( + org_id=org_id, + stop_agent_run_input=stop_agent_run_input, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + 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 ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_without_preload_content( + self, + org_id: StrictInt, + stop_agent_run_input: StopAgentRunInput, + authorization: Optional[Any] = 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: + """Ban All Checks For Agent Run + + Ban all checks for a PR and stop all related agents. This endpoint: 1. Flags the PR to prevent future CI/CD check suite events from being processed 2. Stops all current agents for that PR + + :param org_id: (required) + :type org_id: int + :param stop_agent_run_input: (required) + :type stop_agent_run_input: StopAgentRunInput + :param authorization: + :type authorization: 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._ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_serialize( + org_id=org_id, + stop_agent_run_input=stop_agent_run_input, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_serialize( + self, + org_id, + stop_agent_run_input, + authorization, + _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 org_id is not None: + _path_params['org_id'] = org_id + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # process the form parameters + # process the body parameter + if stop_agent_run_input is not None: + _body_params = stop_agent_run_input + + + # 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] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/organizations/{org_id}/agent/run/ban', + 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 ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_0( + self, + org_id: StrictInt, + stop_agent_run_input: StopAgentRunInput, + authorization: Optional[Any] = 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, + ) -> object: + """Ban All Checks For Agent Run + + Ban all checks for a PR and stop all related agents. This endpoint: 1. Flags the PR to prevent future CI/CD check suite events from being processed 2. Stops all current agents for that PR + + :param org_id: (required) + :type org_id: int + :param stop_agent_run_input: (required) + :type stop_agent_run_input: StopAgentRunInput + :param authorization: + :type authorization: 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._ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_0_serialize( + org_id=org_id, + stop_agent_run_input=stop_agent_run_input, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + 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 ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_0_with_http_info( + self, + org_id: StrictInt, + stop_agent_run_input: StopAgentRunInput, + authorization: Optional[Any] = 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[object]: + """Ban All Checks For Agent Run + + Ban all checks for a PR and stop all related agents. This endpoint: 1. Flags the PR to prevent future CI/CD check suite events from being processed 2. Stops all current agents for that PR + + :param org_id: (required) + :type org_id: int + :param stop_agent_run_input: (required) + :type stop_agent_run_input: StopAgentRunInput + :param authorization: + :type authorization: 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._ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_0_serialize( + org_id=org_id, + stop_agent_run_input=stop_agent_run_input, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + 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 ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_0_without_preload_content( + self, + org_id: StrictInt, + stop_agent_run_input: StopAgentRunInput, + authorization: Optional[Any] = 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: + """Ban All Checks For Agent Run + + Ban all checks for a PR and stop all related agents. This endpoint: 1. Flags the PR to prevent future CI/CD check suite events from being processed 2. Stops all current agents for that PR + + :param org_id: (required) + :type org_id: int + :param stop_agent_run_input: (required) + :type stop_agent_run_input: StopAgentRunInput + :param authorization: + :type authorization: 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._ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_0_serialize( + org_id=org_id, + stop_agent_run_input=stop_agent_run_input, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_0_serialize( + self, + org_id, + stop_agent_run_input, + authorization, + _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 org_id is not None: + _path_params['org_id'] = org_id + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # process the form parameters + # process the body parameter + if stop_agent_run_input is not None: + _body_params = stop_agent_run_input + + + # 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] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/organizations/{org_id}/agent/run/ban', + 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 ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_1( + self, + org_id: StrictInt, + stop_agent_run_input: StopAgentRunInput, + authorization: Optional[Any] = 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, + ) -> object: + """Ban All Checks For Agent Run + + Ban all checks for a PR and stop all related agents. This endpoint: 1. Flags the PR to prevent future CI/CD check suite events from being processed 2. Stops all current agents for that PR + + :param org_id: (required) + :type org_id: int + :param stop_agent_run_input: (required) + :type stop_agent_run_input: StopAgentRunInput + :param authorization: + :type authorization: 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._ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_1_serialize( + org_id=org_id, + stop_agent_run_input=stop_agent_run_input, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + 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 ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_1_with_http_info( + self, + org_id: StrictInt, + stop_agent_run_input: StopAgentRunInput, + authorization: Optional[Any] = 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[object]: + """Ban All Checks For Agent Run + + Ban all checks for a PR and stop all related agents. This endpoint: 1. Flags the PR to prevent future CI/CD check suite events from being processed 2. Stops all current agents for that PR + + :param org_id: (required) + :type org_id: int + :param stop_agent_run_input: (required) + :type stop_agent_run_input: StopAgentRunInput + :param authorization: + :type authorization: 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._ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_1_serialize( + org_id=org_id, + stop_agent_run_input=stop_agent_run_input, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + 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 ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_1_without_preload_content( + self, + org_id: StrictInt, + stop_agent_run_input: StopAgentRunInput, + authorization: Optional[Any] = 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: + """Ban All Checks For Agent Run + + Ban all checks for a PR and stop all related agents. This endpoint: 1. Flags the PR to prevent future CI/CD check suite events from being processed 2. Stops all current agents for that PR + + :param org_id: (required) + :type org_id: int + :param stop_agent_run_input: (required) + :type stop_agent_run_input: StopAgentRunInput + :param authorization: + :type authorization: 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._ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_1_serialize( + org_id=org_id, + stop_agent_run_input=stop_agent_run_input, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_1_serialize( + self, + org_id, + stop_agent_run_input, + authorization, + _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 org_id is not None: + _path_params['org_id'] = org_id + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # process the form parameters + # process the body parameter + if stop_agent_run_input is not None: + _body_params = stop_agent_run_input + + + # 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] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/organizations/{org_id}/agent/run/ban', + 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 create_agent_run_v1_organizations_org_id_agent_run_post( + self, + org_id: StrictInt, + create_agent_run_input: CreateAgentRunInput, + authorization: Optional[Any] = 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, + ) -> AgentRunResponse: + """Create Agent Run + + Create a new agent run. Creates and initiates a long-running agent process based on the provided prompt. The process will complete asynchronously, and the response contains the agent run ID which can be used to check the status later. The requesting user must be a member of the specified organization. This endpoint accepts both a text prompt and an optional image file upload. Rate limit: 10 requests per minute. + + :param org_id: (required) + :type org_id: int + :param create_agent_run_input: (required) + :type create_agent_run_input: CreateAgentRunInput + :param authorization: + :type authorization: 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._create_agent_run_v1_organizations_org_id_agent_run_post_serialize( + org_id=org_id, + create_agent_run_input=create_agent_run_input, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentRunResponse", + '429': "APIRateLimitErrorResponse", + '402': "AgentRunLimitReachedErrorResponse", + '403': "PermissionsErrorResponse", + '404': "NoReposFoundInOrgErrorResponse", + '422': "HTTPValidationError", + } + 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_agent_run_v1_organizations_org_id_agent_run_post_with_http_info( + self, + org_id: StrictInt, + create_agent_run_input: CreateAgentRunInput, + authorization: Optional[Any] = 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[AgentRunResponse]: + """Create Agent Run + + Create a new agent run. Creates and initiates a long-running agent process based on the provided prompt. The process will complete asynchronously, and the response contains the agent run ID which can be used to check the status later. The requesting user must be a member of the specified organization. This endpoint accepts both a text prompt and an optional image file upload. Rate limit: 10 requests per minute. + + :param org_id: (required) + :type org_id: int + :param create_agent_run_input: (required) + :type create_agent_run_input: CreateAgentRunInput + :param authorization: + :type authorization: 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._create_agent_run_v1_organizations_org_id_agent_run_post_serialize( + org_id=org_id, + create_agent_run_input=create_agent_run_input, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentRunResponse", + '429': "APIRateLimitErrorResponse", + '402': "AgentRunLimitReachedErrorResponse", + '403': "PermissionsErrorResponse", + '404': "NoReposFoundInOrgErrorResponse", + '422': "HTTPValidationError", + } + 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_agent_run_v1_organizations_org_id_agent_run_post_without_preload_content( + self, + org_id: StrictInt, + create_agent_run_input: CreateAgentRunInput, + authorization: Optional[Any] = 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: + """Create Agent Run + + Create a new agent run. Creates and initiates a long-running agent process based on the provided prompt. The process will complete asynchronously, and the response contains the agent run ID which can be used to check the status later. The requesting user must be a member of the specified organization. This endpoint accepts both a text prompt and an optional image file upload. Rate limit: 10 requests per minute. + + :param org_id: (required) + :type org_id: int + :param create_agent_run_input: (required) + :type create_agent_run_input: CreateAgentRunInput + :param authorization: + :type authorization: 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._create_agent_run_v1_organizations_org_id_agent_run_post_serialize( + org_id=org_id, + create_agent_run_input=create_agent_run_input, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentRunResponse", + '429': "APIRateLimitErrorResponse", + '402': "AgentRunLimitReachedErrorResponse", + '403': "PermissionsErrorResponse", + '404': "NoReposFoundInOrgErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_agent_run_v1_organizations_org_id_agent_run_post_serialize( + self, + org_id, + create_agent_run_input, + authorization, + _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 org_id is not None: + _path_params['org_id'] = org_id + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # process the form parameters + # process the body parameter + if create_agent_run_input is not None: + _body_params = create_agent_run_input + + + # 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] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/organizations/{org_id}/agent/run', + 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 create_agent_run_v1_organizations_org_id_agent_run_post_0( + self, + org_id: StrictInt, + create_agent_run_input: CreateAgentRunInput, + authorization: Optional[Any] = 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, + ) -> AgentRunResponse: + """Create Agent Run + + Create a new agent run. Creates and initiates a long-running agent process based on the provided prompt. The process will complete asynchronously, and the response contains the agent run ID which can be used to check the status later. The requesting user must be a member of the specified organization. This endpoint accepts both a text prompt and an optional image file upload. Rate limit: 10 requests per minute. + + :param org_id: (required) + :type org_id: int + :param create_agent_run_input: (required) + :type create_agent_run_input: CreateAgentRunInput + :param authorization: + :type authorization: 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._create_agent_run_v1_organizations_org_id_agent_run_post_0_serialize( + org_id=org_id, + create_agent_run_input=create_agent_run_input, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentRunResponse", + '429': "APIRateLimitErrorResponse", + '402': "AgentRunLimitReachedErrorResponse", + '403': "PermissionsErrorResponse", + '404': "NoReposFoundInOrgErrorResponse", + '422': "HTTPValidationError", + } + 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_agent_run_v1_organizations_org_id_agent_run_post_0_with_http_info( + self, + org_id: StrictInt, + create_agent_run_input: CreateAgentRunInput, + authorization: Optional[Any] = 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[AgentRunResponse]: + """Create Agent Run + + Create a new agent run. Creates and initiates a long-running agent process based on the provided prompt. The process will complete asynchronously, and the response contains the agent run ID which can be used to check the status later. The requesting user must be a member of the specified organization. This endpoint accepts both a text prompt and an optional image file upload. Rate limit: 10 requests per minute. + + :param org_id: (required) + :type org_id: int + :param create_agent_run_input: (required) + :type create_agent_run_input: CreateAgentRunInput + :param authorization: + :type authorization: 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._create_agent_run_v1_organizations_org_id_agent_run_post_0_serialize( + org_id=org_id, + create_agent_run_input=create_agent_run_input, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentRunResponse", + '429': "APIRateLimitErrorResponse", + '402': "AgentRunLimitReachedErrorResponse", + '403': "PermissionsErrorResponse", + '404': "NoReposFoundInOrgErrorResponse", + '422': "HTTPValidationError", + } + 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_agent_run_v1_organizations_org_id_agent_run_post_0_without_preload_content( + self, + org_id: StrictInt, + create_agent_run_input: CreateAgentRunInput, + authorization: Optional[Any] = 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: + """Create Agent Run + + Create a new agent run. Creates and initiates a long-running agent process based on the provided prompt. The process will complete asynchronously, and the response contains the agent run ID which can be used to check the status later. The requesting user must be a member of the specified organization. This endpoint accepts both a text prompt and an optional image file upload. Rate limit: 10 requests per minute. + + :param org_id: (required) + :type org_id: int + :param create_agent_run_input: (required) + :type create_agent_run_input: CreateAgentRunInput + :param authorization: + :type authorization: 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._create_agent_run_v1_organizations_org_id_agent_run_post_0_serialize( + org_id=org_id, + create_agent_run_input=create_agent_run_input, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentRunResponse", + '429': "APIRateLimitErrorResponse", + '402': "AgentRunLimitReachedErrorResponse", + '403': "PermissionsErrorResponse", + '404': "NoReposFoundInOrgErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_agent_run_v1_organizations_org_id_agent_run_post_0_serialize( + self, + org_id, + create_agent_run_input, + authorization, + _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 org_id is not None: + _path_params['org_id'] = org_id + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # process the form parameters + # process the body parameter + if create_agent_run_input is not None: + _body_params = create_agent_run_input + + + # 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] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/organizations/{org_id}/agent/run', + 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 create_agent_run_v1_organizations_org_id_agent_run_post_1( + self, + org_id: StrictInt, + create_agent_run_input: CreateAgentRunInput, + authorization: Optional[Any] = 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, + ) -> AgentRunResponse: + """Create Agent Run + + Create a new agent run. Creates and initiates a long-running agent process based on the provided prompt. The process will complete asynchronously, and the response contains the agent run ID which can be used to check the status later. The requesting user must be a member of the specified organization. This endpoint accepts both a text prompt and an optional image file upload. Rate limit: 10 requests per minute. + + :param org_id: (required) + :type org_id: int + :param create_agent_run_input: (required) + :type create_agent_run_input: CreateAgentRunInput + :param authorization: + :type authorization: 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._create_agent_run_v1_organizations_org_id_agent_run_post_1_serialize( + org_id=org_id, + create_agent_run_input=create_agent_run_input, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentRunResponse", + '429': "APIRateLimitErrorResponse", + '402': "AgentRunLimitReachedErrorResponse", + '403': "PermissionsErrorResponse", + '404': "NoReposFoundInOrgErrorResponse", + '422': "HTTPValidationError", + } + 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_agent_run_v1_organizations_org_id_agent_run_post_1_with_http_info( + self, + org_id: StrictInt, + create_agent_run_input: CreateAgentRunInput, + authorization: Optional[Any] = 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[AgentRunResponse]: + """Create Agent Run + + Create a new agent run. Creates and initiates a long-running agent process based on the provided prompt. The process will complete asynchronously, and the response contains the agent run ID which can be used to check the status later. The requesting user must be a member of the specified organization. This endpoint accepts both a text prompt and an optional image file upload. Rate limit: 10 requests per minute. + + :param org_id: (required) + :type org_id: int + :param create_agent_run_input: (required) + :type create_agent_run_input: CreateAgentRunInput + :param authorization: + :type authorization: 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._create_agent_run_v1_organizations_org_id_agent_run_post_1_serialize( + org_id=org_id, + create_agent_run_input=create_agent_run_input, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentRunResponse", + '429': "APIRateLimitErrorResponse", + '402': "AgentRunLimitReachedErrorResponse", + '403': "PermissionsErrorResponse", + '404': "NoReposFoundInOrgErrorResponse", + '422': "HTTPValidationError", + } + 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_agent_run_v1_organizations_org_id_agent_run_post_1_without_preload_content( + self, + org_id: StrictInt, + create_agent_run_input: CreateAgentRunInput, + authorization: Optional[Any] = 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: + """Create Agent Run + + Create a new agent run. Creates and initiates a long-running agent process based on the provided prompt. The process will complete asynchronously, and the response contains the agent run ID which can be used to check the status later. The requesting user must be a member of the specified organization. This endpoint accepts both a text prompt and an optional image file upload. Rate limit: 10 requests per minute. + + :param org_id: (required) + :type org_id: int + :param create_agent_run_input: (required) + :type create_agent_run_input: CreateAgentRunInput + :param authorization: + :type authorization: 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._create_agent_run_v1_organizations_org_id_agent_run_post_1_serialize( + org_id=org_id, + create_agent_run_input=create_agent_run_input, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentRunResponse", + '429': "APIRateLimitErrorResponse", + '402': "AgentRunLimitReachedErrorResponse", + '403': "PermissionsErrorResponse", + '404': "NoReposFoundInOrgErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_agent_run_v1_organizations_org_id_agent_run_post_1_serialize( + self, + org_id, + create_agent_run_input, + authorization, + _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 org_id is not None: + _path_params['org_id'] = org_id + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # process the form parameters + # process the body parameter + if create_agent_run_input is not None: + _body_params = create_agent_run_input + + + # 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] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/organizations/{org_id}/agent/run', + 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_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get( + self, + agent_run_id: StrictInt, + org_id: StrictInt, + authorization: Optional[Any] = 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, + ) -> AgentRunResponse: + """Get Agent Run + + Retrieve the status and result of an agent run. Returns the current status, progress, and any available results for the specified agent run. The agent run must belong to the specified organization. If the agent run is still in progress, this endpoint can be polled to check for completion. Rate limit: 60 requests per 30 seconds. + + :param agent_run_id: (required) + :type agent_run_id: int + :param org_id: (required) + :type org_id: int + :param authorization: + :type authorization: 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._get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_serialize( + agent_run_id=agent_run_id, + org_id=org_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentRunResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + 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_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_with_http_info( + self, + agent_run_id: StrictInt, + org_id: StrictInt, + authorization: Optional[Any] = 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[AgentRunResponse]: + """Get Agent Run + + Retrieve the status and result of an agent run. Returns the current status, progress, and any available results for the specified agent run. The agent run must belong to the specified organization. If the agent run is still in progress, this endpoint can be polled to check for completion. Rate limit: 60 requests per 30 seconds. + + :param agent_run_id: (required) + :type agent_run_id: int + :param org_id: (required) + :type org_id: int + :param authorization: + :type authorization: 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._get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_serialize( + agent_run_id=agent_run_id, + org_id=org_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentRunResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + 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_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_without_preload_content( + self, + agent_run_id: StrictInt, + org_id: StrictInt, + authorization: Optional[Any] = 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 Agent Run + + Retrieve the status and result of an agent run. Returns the current status, progress, and any available results for the specified agent run. The agent run must belong to the specified organization. If the agent run is still in progress, this endpoint can be polled to check for completion. Rate limit: 60 requests per 30 seconds. + + :param agent_run_id: (required) + :type agent_run_id: int + :param org_id: (required) + :type org_id: int + :param authorization: + :type authorization: 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._get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_serialize( + agent_run_id=agent_run_id, + org_id=org_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentRunResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_serialize( + self, + agent_run_id, + org_id, + authorization, + _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 agent_run_id is not None: + _path_params['agent_run_id'] = agent_run_id + if org_id is not None: + _path_params['org_id'] = org_id + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/organizations/{org_id}/agent/run/{agent_run_id}', + 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_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_0( + self, + agent_run_id: StrictInt, + org_id: StrictInt, + authorization: Optional[Any] = 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, + ) -> AgentRunResponse: + """Get Agent Run + + Retrieve the status and result of an agent run. Returns the current status, progress, and any available results for the specified agent run. The agent run must belong to the specified organization. If the agent run is still in progress, this endpoint can be polled to check for completion. Rate limit: 60 requests per 30 seconds. + + :param agent_run_id: (required) + :type agent_run_id: int + :param org_id: (required) + :type org_id: int + :param authorization: + :type authorization: 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._get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_0_serialize( + agent_run_id=agent_run_id, + org_id=org_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentRunResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + 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_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_0_with_http_info( + self, + agent_run_id: StrictInt, + org_id: StrictInt, + authorization: Optional[Any] = 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[AgentRunResponse]: + """Get Agent Run + + Retrieve the status and result of an agent run. Returns the current status, progress, and any available results for the specified agent run. The agent run must belong to the specified organization. If the agent run is still in progress, this endpoint can be polled to check for completion. Rate limit: 60 requests per 30 seconds. + + :param agent_run_id: (required) + :type agent_run_id: int + :param org_id: (required) + :type org_id: int + :param authorization: + :type authorization: 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._get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_0_serialize( + agent_run_id=agent_run_id, + org_id=org_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentRunResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + 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_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_0_without_preload_content( + self, + agent_run_id: StrictInt, + org_id: StrictInt, + authorization: Optional[Any] = 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 Agent Run + + Retrieve the status and result of an agent run. Returns the current status, progress, and any available results for the specified agent run. The agent run must belong to the specified organization. If the agent run is still in progress, this endpoint can be polled to check for completion. Rate limit: 60 requests per 30 seconds. + + :param agent_run_id: (required) + :type agent_run_id: int + :param org_id: (required) + :type org_id: int + :param authorization: + :type authorization: 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._get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_0_serialize( + agent_run_id=agent_run_id, + org_id=org_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentRunResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_0_serialize( + self, + agent_run_id, + org_id, + authorization, + _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 agent_run_id is not None: + _path_params['agent_run_id'] = agent_run_id + if org_id is not None: + _path_params['org_id'] = org_id + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/organizations/{org_id}/agent/run/{agent_run_id}', + 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_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_1( + self, + agent_run_id: StrictInt, + org_id: StrictInt, + authorization: Optional[Any] = 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, + ) -> AgentRunResponse: + """Get Agent Run + + Retrieve the status and result of an agent run. Returns the current status, progress, and any available results for the specified agent run. The agent run must belong to the specified organization. If the agent run is still in progress, this endpoint can be polled to check for completion. Rate limit: 60 requests per 30 seconds. + + :param agent_run_id: (required) + :type agent_run_id: int + :param org_id: (required) + :type org_id: int + :param authorization: + :type authorization: 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._get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_1_serialize( + agent_run_id=agent_run_id, + org_id=org_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentRunResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + 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_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_1_with_http_info( + self, + agent_run_id: StrictInt, + org_id: StrictInt, + authorization: Optional[Any] = 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[AgentRunResponse]: + """Get Agent Run + + Retrieve the status and result of an agent run. Returns the current status, progress, and any available results for the specified agent run. The agent run must belong to the specified organization. If the agent run is still in progress, this endpoint can be polled to check for completion. Rate limit: 60 requests per 30 seconds. + + :param agent_run_id: (required) + :type agent_run_id: int + :param org_id: (required) + :type org_id: int + :param authorization: + :type authorization: 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._get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_1_serialize( + agent_run_id=agent_run_id, + org_id=org_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentRunResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + 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_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_1_without_preload_content( + self, + agent_run_id: StrictInt, + org_id: StrictInt, + authorization: Optional[Any] = 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 Agent Run + + Retrieve the status and result of an agent run. Returns the current status, progress, and any available results for the specified agent run. The agent run must belong to the specified organization. If the agent run is still in progress, this endpoint can be polled to check for completion. Rate limit: 60 requests per 30 seconds. + + :param agent_run_id: (required) + :type agent_run_id: int + :param org_id: (required) + :type org_id: int + :param authorization: + :type authorization: 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._get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_1_serialize( + agent_run_id=agent_run_id, + org_id=org_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentRunResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_1_serialize( + self, + agent_run_id, + org_id, + authorization, + _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 agent_run_id is not None: + _path_params['agent_run_id'] = agent_run_id + if org_id is not None: + _path_params['org_id'] = org_id + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/organizations/{org_id}/agent/run/{agent_run_id}', + 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_agent_runs_v1_organizations_org_id_agent_runs_get( + self, + org_id: StrictInt, + user_id: Annotated[Optional[StrictInt], Field(description="Filter by user ID who initiated the agent runs")] = None, + source_type: Annotated[Optional[ApiAgentRunSourceType], Field(description="Filter by source type of the agent runs")] = None, + skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + authorization: Optional[Any] = 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, + ) -> PageAgentRunResponse: + """List Agent Runs + + List agent runs for an organization with optional user filtering. Returns a paginated list of agent runs for the specified organization. Optionally filter by user_id to get only agent runs initiated by a specific user. Results are ordered by creation date (newest first). Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param user_id: Filter by user ID who initiated the agent runs + :type user_id: int + :param source_type: Filter by source type of the agent runs + :type source_type: ApiAgentRunSourceType + :param skip: + :type skip: int + :param limit: + :type limit: int + :param authorization: + :type authorization: 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._list_agent_runs_v1_organizations_org_id_agent_runs_get_serialize( + org_id=org_id, + user_id=user_id, + source_type=source_type, + skip=skip, + limit=limit, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PageAgentRunResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + 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_agent_runs_v1_organizations_org_id_agent_runs_get_with_http_info( + self, + org_id: StrictInt, + user_id: Annotated[Optional[StrictInt], Field(description="Filter by user ID who initiated the agent runs")] = None, + source_type: Annotated[Optional[ApiAgentRunSourceType], Field(description="Filter by source type of the agent runs")] = None, + skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + authorization: Optional[Any] = 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[PageAgentRunResponse]: + """List Agent Runs + + List agent runs for an organization with optional user filtering. Returns a paginated list of agent runs for the specified organization. Optionally filter by user_id to get only agent runs initiated by a specific user. Results are ordered by creation date (newest first). Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param user_id: Filter by user ID who initiated the agent runs + :type user_id: int + :param source_type: Filter by source type of the agent runs + :type source_type: ApiAgentRunSourceType + :param skip: + :type skip: int + :param limit: + :type limit: int + :param authorization: + :type authorization: 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._list_agent_runs_v1_organizations_org_id_agent_runs_get_serialize( + org_id=org_id, + user_id=user_id, + source_type=source_type, + skip=skip, + limit=limit, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PageAgentRunResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + 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_agent_runs_v1_organizations_org_id_agent_runs_get_without_preload_content( + self, + org_id: StrictInt, + user_id: Annotated[Optional[StrictInt], Field(description="Filter by user ID who initiated the agent runs")] = None, + source_type: Annotated[Optional[ApiAgentRunSourceType], Field(description="Filter by source type of the agent runs")] = None, + skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + authorization: Optional[Any] = 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 Agent Runs + + List agent runs for an organization with optional user filtering. Returns a paginated list of agent runs for the specified organization. Optionally filter by user_id to get only agent runs initiated by a specific user. Results are ordered by creation date (newest first). Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param user_id: Filter by user ID who initiated the agent runs + :type user_id: int + :param source_type: Filter by source type of the agent runs + :type source_type: ApiAgentRunSourceType + :param skip: + :type skip: int + :param limit: + :type limit: int + :param authorization: + :type authorization: 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._list_agent_runs_v1_organizations_org_id_agent_runs_get_serialize( + org_id=org_id, + user_id=user_id, + source_type=source_type, + skip=skip, + limit=limit, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PageAgentRunResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_agent_runs_v1_organizations_org_id_agent_runs_get_serialize( + self, + org_id, + user_id, + source_type, + skip, + limit, + authorization, + _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 org_id is not None: + _path_params['org_id'] = org_id + # process the query parameters + if user_id is not None: + + _query_params.append(('user_id', user_id)) + + if source_type is not None: + + _query_params.append(('source_type', source_type.value)) + + if skip is not None: + + _query_params.append(('skip', skip)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/organizations/{org_id}/agent/runs', + 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_agent_runs_v1_organizations_org_id_agent_runs_get_0( + self, + org_id: StrictInt, + user_id: Annotated[Optional[StrictInt], Field(description="Filter by user ID who initiated the agent runs")] = None, + source_type: Annotated[Optional[ApiAgentRunSourceType], Field(description="Filter by source type of the agent runs")] = None, + skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + authorization: Optional[Any] = 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, + ) -> PageAgentRunResponse: + """List Agent Runs + + List agent runs for an organization with optional user filtering. Returns a paginated list of agent runs for the specified organization. Optionally filter by user_id to get only agent runs initiated by a specific user. Results are ordered by creation date (newest first). Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param user_id: Filter by user ID who initiated the agent runs + :type user_id: int + :param source_type: Filter by source type of the agent runs + :type source_type: ApiAgentRunSourceType + :param skip: + :type skip: int + :param limit: + :type limit: int + :param authorization: + :type authorization: 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._list_agent_runs_v1_organizations_org_id_agent_runs_get_0_serialize( + org_id=org_id, + user_id=user_id, + source_type=source_type, + skip=skip, + limit=limit, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PageAgentRunResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + 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_agent_runs_v1_organizations_org_id_agent_runs_get_0_with_http_info( + self, + org_id: StrictInt, + user_id: Annotated[Optional[StrictInt], Field(description="Filter by user ID who initiated the agent runs")] = None, + source_type: Annotated[Optional[ApiAgentRunSourceType], Field(description="Filter by source type of the agent runs")] = None, + skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + authorization: Optional[Any] = 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[PageAgentRunResponse]: + """List Agent Runs + + List agent runs for an organization with optional user filtering. Returns a paginated list of agent runs for the specified organization. Optionally filter by user_id to get only agent runs initiated by a specific user. Results are ordered by creation date (newest first). Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param user_id: Filter by user ID who initiated the agent runs + :type user_id: int + :param source_type: Filter by source type of the agent runs + :type source_type: ApiAgentRunSourceType + :param skip: + :type skip: int + :param limit: + :type limit: int + :param authorization: + :type authorization: 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._list_agent_runs_v1_organizations_org_id_agent_runs_get_0_serialize( + org_id=org_id, + user_id=user_id, + source_type=source_type, + skip=skip, + limit=limit, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PageAgentRunResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + 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_agent_runs_v1_organizations_org_id_agent_runs_get_0_without_preload_content( + self, + org_id: StrictInt, + user_id: Annotated[Optional[StrictInt], Field(description="Filter by user ID who initiated the agent runs")] = None, + source_type: Annotated[Optional[ApiAgentRunSourceType], Field(description="Filter by source type of the agent runs")] = None, + skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + authorization: Optional[Any] = 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 Agent Runs + + List agent runs for an organization with optional user filtering. Returns a paginated list of agent runs for the specified organization. Optionally filter by user_id to get only agent runs initiated by a specific user. Results are ordered by creation date (newest first). Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param user_id: Filter by user ID who initiated the agent runs + :type user_id: int + :param source_type: Filter by source type of the agent runs + :type source_type: ApiAgentRunSourceType + :param skip: + :type skip: int + :param limit: + :type limit: int + :param authorization: + :type authorization: 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._list_agent_runs_v1_organizations_org_id_agent_runs_get_0_serialize( + org_id=org_id, + user_id=user_id, + source_type=source_type, + skip=skip, + limit=limit, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PageAgentRunResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_agent_runs_v1_organizations_org_id_agent_runs_get_0_serialize( + self, + org_id, + user_id, + source_type, + skip, + limit, + authorization, + _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 org_id is not None: + _path_params['org_id'] = org_id + # process the query parameters + if user_id is not None: + + _query_params.append(('user_id', user_id)) + + if source_type is not None: + + _query_params.append(('source_type', source_type.value)) + + if skip is not None: + + _query_params.append(('skip', skip)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/organizations/{org_id}/agent/runs', + 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_agent_runs_v1_organizations_org_id_agent_runs_get_1( + self, + org_id: StrictInt, + user_id: Annotated[Optional[StrictInt], Field(description="Filter by user ID who initiated the agent runs")] = None, + source_type: Annotated[Optional[ApiAgentRunSourceType], Field(description="Filter by source type of the agent runs")] = None, + skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + authorization: Optional[Any] = 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, + ) -> PageAgentRunResponse: + """List Agent Runs + + List agent runs for an organization with optional user filtering. Returns a paginated list of agent runs for the specified organization. Optionally filter by user_id to get only agent runs initiated by a specific user. Results are ordered by creation date (newest first). Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param user_id: Filter by user ID who initiated the agent runs + :type user_id: int + :param source_type: Filter by source type of the agent runs + :type source_type: ApiAgentRunSourceType + :param skip: + :type skip: int + :param limit: + :type limit: int + :param authorization: + :type authorization: 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._list_agent_runs_v1_organizations_org_id_agent_runs_get_1_serialize( + org_id=org_id, + user_id=user_id, + source_type=source_type, + skip=skip, + limit=limit, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PageAgentRunResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + 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_agent_runs_v1_organizations_org_id_agent_runs_get_1_with_http_info( + self, + org_id: StrictInt, + user_id: Annotated[Optional[StrictInt], Field(description="Filter by user ID who initiated the agent runs")] = None, + source_type: Annotated[Optional[ApiAgentRunSourceType], Field(description="Filter by source type of the agent runs")] = None, + skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + authorization: Optional[Any] = 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[PageAgentRunResponse]: + """List Agent Runs + + List agent runs for an organization with optional user filtering. Returns a paginated list of agent runs for the specified organization. Optionally filter by user_id to get only agent runs initiated by a specific user. Results are ordered by creation date (newest first). Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param user_id: Filter by user ID who initiated the agent runs + :type user_id: int + :param source_type: Filter by source type of the agent runs + :type source_type: ApiAgentRunSourceType + :param skip: + :type skip: int + :param limit: + :type limit: int + :param authorization: + :type authorization: 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._list_agent_runs_v1_organizations_org_id_agent_runs_get_1_serialize( + org_id=org_id, + user_id=user_id, + source_type=source_type, + skip=skip, + limit=limit, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PageAgentRunResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + 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_agent_runs_v1_organizations_org_id_agent_runs_get_1_without_preload_content( + self, + org_id: StrictInt, + user_id: Annotated[Optional[StrictInt], Field(description="Filter by user ID who initiated the agent runs")] = None, + source_type: Annotated[Optional[ApiAgentRunSourceType], Field(description="Filter by source type of the agent runs")] = None, + skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + authorization: Optional[Any] = 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 Agent Runs + + List agent runs for an organization with optional user filtering. Returns a paginated list of agent runs for the specified organization. Optionally filter by user_id to get only agent runs initiated by a specific user. Results are ordered by creation date (newest first). Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param user_id: Filter by user ID who initiated the agent runs + :type user_id: int + :param source_type: Filter by source type of the agent runs + :type source_type: ApiAgentRunSourceType + :param skip: + :type skip: int + :param limit: + :type limit: int + :param authorization: + :type authorization: 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._list_agent_runs_v1_organizations_org_id_agent_runs_get_1_serialize( + org_id=org_id, + user_id=user_id, + source_type=source_type, + skip=skip, + limit=limit, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PageAgentRunResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_agent_runs_v1_organizations_org_id_agent_runs_get_1_serialize( + self, + org_id, + user_id, + source_type, + skip, + limit, + authorization, + _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 org_id is not None: + _path_params['org_id'] = org_id + # process the query parameters + if user_id is not None: + + _query_params.append(('user_id', user_id)) + + if source_type is not None: + + _query_params.append(('source_type', source_type.value)) + + if skip is not None: + + _query_params.append(('skip', skip)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/organizations/{org_id}/agent/runs', + 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_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post( + self, + org_id: StrictInt, + stop_agent_run_input: StopAgentRunInput, + authorization: Optional[Any] = 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, + ) -> object: + """Remove Codegen From Pr + + Remove Codegen from a PR. This endpoint performs the same action as banning all checks but with more user-friendly naming. It: 1. Flags the PR to prevent future CI/CD check suite events from being processed 2. Stops all current agents for that PR + + :param org_id: (required) + :type org_id: int + :param stop_agent_run_input: (required) + :type stop_agent_run_input: StopAgentRunInput + :param authorization: + :type authorization: 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._remove_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_serialize( + org_id=org_id, + stop_agent_run_input=stop_agent_run_input, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + 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_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_with_http_info( + self, + org_id: StrictInt, + stop_agent_run_input: StopAgentRunInput, + authorization: Optional[Any] = 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[object]: + """Remove Codegen From Pr + + Remove Codegen from a PR. This endpoint performs the same action as banning all checks but with more user-friendly naming. It: 1. Flags the PR to prevent future CI/CD check suite events from being processed 2. Stops all current agents for that PR + + :param org_id: (required) + :type org_id: int + :param stop_agent_run_input: (required) + :type stop_agent_run_input: StopAgentRunInput + :param authorization: + :type authorization: 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._remove_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_serialize( + org_id=org_id, + stop_agent_run_input=stop_agent_run_input, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + 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_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_without_preload_content( + self, + org_id: StrictInt, + stop_agent_run_input: StopAgentRunInput, + authorization: Optional[Any] = 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 Codegen From Pr + + Remove Codegen from a PR. This endpoint performs the same action as banning all checks but with more user-friendly naming. It: 1. Flags the PR to prevent future CI/CD check suite events from being processed 2. Stops all current agents for that PR + + :param org_id: (required) + :type org_id: int + :param stop_agent_run_input: (required) + :type stop_agent_run_input: StopAgentRunInput + :param authorization: + :type authorization: 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._remove_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_serialize( + org_id=org_id, + stop_agent_run_input=stop_agent_run_input, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _remove_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_serialize( + self, + org_id, + stop_agent_run_input, + authorization, + _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 org_id is not None: + _path_params['org_id'] = org_id + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # process the form parameters + # process the body parameter + if stop_agent_run_input is not None: + _body_params = stop_agent_run_input + + + # 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] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/organizations/{org_id}/agent/run/remove-from-pr', + 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_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_0( + self, + org_id: StrictInt, + stop_agent_run_input: StopAgentRunInput, + authorization: Optional[Any] = 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, + ) -> object: + """Remove Codegen From Pr + + Remove Codegen from a PR. This endpoint performs the same action as banning all checks but with more user-friendly naming. It: 1. Flags the PR to prevent future CI/CD check suite events from being processed 2. Stops all current agents for that PR + + :param org_id: (required) + :type org_id: int + :param stop_agent_run_input: (required) + :type stop_agent_run_input: StopAgentRunInput + :param authorization: + :type authorization: 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._remove_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_0_serialize( + org_id=org_id, + stop_agent_run_input=stop_agent_run_input, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + 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_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_0_with_http_info( + self, + org_id: StrictInt, + stop_agent_run_input: StopAgentRunInput, + authorization: Optional[Any] = 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[object]: + """Remove Codegen From Pr + + Remove Codegen from a PR. This endpoint performs the same action as banning all checks but with more user-friendly naming. It: 1. Flags the PR to prevent future CI/CD check suite events from being processed 2. Stops all current agents for that PR + + :param org_id: (required) + :type org_id: int + :param stop_agent_run_input: (required) + :type stop_agent_run_input: StopAgentRunInput + :param authorization: + :type authorization: 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._remove_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_0_serialize( + org_id=org_id, + stop_agent_run_input=stop_agent_run_input, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + 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_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_0_without_preload_content( + self, + org_id: StrictInt, + stop_agent_run_input: StopAgentRunInput, + authorization: Optional[Any] = 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 Codegen From Pr + + Remove Codegen from a PR. This endpoint performs the same action as banning all checks but with more user-friendly naming. It: 1. Flags the PR to prevent future CI/CD check suite events from being processed 2. Stops all current agents for that PR + + :param org_id: (required) + :type org_id: int + :param stop_agent_run_input: (required) + :type stop_agent_run_input: StopAgentRunInput + :param authorization: + :type authorization: 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._remove_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_0_serialize( + org_id=org_id, + stop_agent_run_input=stop_agent_run_input, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _remove_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_0_serialize( + self, + org_id, + stop_agent_run_input, + authorization, + _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 org_id is not None: + _path_params['org_id'] = org_id + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # process the form parameters + # process the body parameter + if stop_agent_run_input is not None: + _body_params = stop_agent_run_input + + + # 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] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/organizations/{org_id}/agent/run/remove-from-pr', + 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_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_1( + self, + org_id: StrictInt, + stop_agent_run_input: StopAgentRunInput, + authorization: Optional[Any] = 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, + ) -> object: + """Remove Codegen From Pr + + Remove Codegen from a PR. This endpoint performs the same action as banning all checks but with more user-friendly naming. It: 1. Flags the PR to prevent future CI/CD check suite events from being processed 2. Stops all current agents for that PR + + :param org_id: (required) + :type org_id: int + :param stop_agent_run_input: (required) + :type stop_agent_run_input: StopAgentRunInput + :param authorization: + :type authorization: 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._remove_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_1_serialize( + org_id=org_id, + stop_agent_run_input=stop_agent_run_input, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + 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_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_1_with_http_info( + self, + org_id: StrictInt, + stop_agent_run_input: StopAgentRunInput, + authorization: Optional[Any] = 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[object]: + """Remove Codegen From Pr + + Remove Codegen from a PR. This endpoint performs the same action as banning all checks but with more user-friendly naming. It: 1. Flags the PR to prevent future CI/CD check suite events from being processed 2. Stops all current agents for that PR + + :param org_id: (required) + :type org_id: int + :param stop_agent_run_input: (required) + :type stop_agent_run_input: StopAgentRunInput + :param authorization: + :type authorization: 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._remove_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_1_serialize( + org_id=org_id, + stop_agent_run_input=stop_agent_run_input, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + 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_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_1_without_preload_content( + self, + org_id: StrictInt, + stop_agent_run_input: StopAgentRunInput, + authorization: Optional[Any] = 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 Codegen From Pr + + Remove Codegen from a PR. This endpoint performs the same action as banning all checks but with more user-friendly naming. It: 1. Flags the PR to prevent future CI/CD check suite events from being processed 2. Stops all current agents for that PR + + :param org_id: (required) + :type org_id: int + :param stop_agent_run_input: (required) + :type stop_agent_run_input: StopAgentRunInput + :param authorization: + :type authorization: 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._remove_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_1_serialize( + org_id=org_id, + stop_agent_run_input=stop_agent_run_input, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _remove_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_1_serialize( + self, + org_id, + stop_agent_run_input, + authorization, + _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 org_id is not None: + _path_params['org_id'] = org_id + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # process the form parameters + # process the body parameter + if stop_agent_run_input is not None: + _body_params = stop_agent_run_input + + + # 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] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/organizations/{org_id}/agent/run/remove-from-pr', + 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 + ) - 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_agent_run_v1_organizations_org_id_agent_run_post( + def resume_agent_run_v1_organizations_org_id_agent_run_resume_post( self, org_id: StrictInt, - create_agent_run_input: CreateAgentRunInput, + resume_agent_run_input: ResumeAgentRunInput, authorization: Optional[Any] = None, _request_timeout: Union[ None, @@ -58,14 +4869,14 @@ def create_agent_run_v1_organizations_org_id_agent_run_post( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> AgentRunResponse: - """Create Agent Run + """Resume Agent Run - Create a new agent run. Creates and initiates a long-running agent process based on the provided prompt. The process will complete asynchronously, and the response contains the agent run ID which can be used to check the status later. The requesting user must be a member of the specified organization. + Resume a paused agent run. Resumes a paused agent run, allowing it to continue processing. :param org_id: (required) :type org_id: int - :param create_agent_run_input: (required) - :type create_agent_run_input: CreateAgentRunInput + :param resume_agent_run_input: (required) + :type resume_agent_run_input: ResumeAgentRunInput :param authorization: :type authorization: object :param _request_timeout: timeout setting for this request. If one @@ -90,9 +4901,9 @@ def create_agent_run_v1_organizations_org_id_agent_run_post( :return: Returns the result object. """ # noqa: E501 - _param = self._create_agent_run_v1_organizations_org_id_agent_run_post_serialize( + _param = self._resume_agent_run_v1_organizations_org_id_agent_run_resume_post_serialize( org_id=org_id, - create_agent_run_input=create_agent_run_input, + resume_agent_run_input=resume_agent_run_input, authorization=authorization, _request_auth=_request_auth, _content_type=_content_type, @@ -102,8 +4913,10 @@ def create_agent_run_v1_organizations_org_id_agent_run_post( _response_types_map: Dict[str, Optional[str]] = { '200': "AgentRunResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -117,10 +4930,10 @@ def create_agent_run_v1_organizations_org_id_agent_run_post( @validate_call - def create_agent_run_v1_organizations_org_id_agent_run_post_with_http_info( + def resume_agent_run_v1_organizations_org_id_agent_run_resume_post_with_http_info( self, org_id: StrictInt, - create_agent_run_input: CreateAgentRunInput, + resume_agent_run_input: ResumeAgentRunInput, authorization: Optional[Any] = None, _request_timeout: Union[ None, @@ -135,14 +4948,14 @@ def create_agent_run_v1_organizations_org_id_agent_run_post_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[AgentRunResponse]: - """Create Agent Run + """Resume Agent Run - Create a new agent run. Creates and initiates a long-running agent process based on the provided prompt. The process will complete asynchronously, and the response contains the agent run ID which can be used to check the status later. The requesting user must be a member of the specified organization. + Resume a paused agent run. Resumes a paused agent run, allowing it to continue processing. :param org_id: (required) :type org_id: int - :param create_agent_run_input: (required) - :type create_agent_run_input: CreateAgentRunInput + :param resume_agent_run_input: (required) + :type resume_agent_run_input: ResumeAgentRunInput :param authorization: :type authorization: object :param _request_timeout: timeout setting for this request. If one @@ -167,9 +4980,9 @@ def create_agent_run_v1_organizations_org_id_agent_run_post_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._create_agent_run_v1_organizations_org_id_agent_run_post_serialize( + _param = self._resume_agent_run_v1_organizations_org_id_agent_run_resume_post_serialize( org_id=org_id, - create_agent_run_input=create_agent_run_input, + resume_agent_run_input=resume_agent_run_input, authorization=authorization, _request_auth=_request_auth, _content_type=_content_type, @@ -179,8 +4992,10 @@ def create_agent_run_v1_organizations_org_id_agent_run_post_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "AgentRunResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -194,10 +5009,10 @@ def create_agent_run_v1_organizations_org_id_agent_run_post_with_http_info( @validate_call - def create_agent_run_v1_organizations_org_id_agent_run_post_without_preload_content( + def resume_agent_run_v1_organizations_org_id_agent_run_resume_post_without_preload_content( self, org_id: StrictInt, - create_agent_run_input: CreateAgentRunInput, + resume_agent_run_input: ResumeAgentRunInput, authorization: Optional[Any] = None, _request_timeout: Union[ None, @@ -212,14 +5027,14 @@ def create_agent_run_v1_organizations_org_id_agent_run_post_without_preload_cont _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create Agent Run + """Resume Agent Run - Create a new agent run. Creates and initiates a long-running agent process based on the provided prompt. The process will complete asynchronously, and the response contains the agent run ID which can be used to check the status later. The requesting user must be a member of the specified organization. + Resume a paused agent run. Resumes a paused agent run, allowing it to continue processing. :param org_id: (required) :type org_id: int - :param create_agent_run_input: (required) - :type create_agent_run_input: CreateAgentRunInput + :param resume_agent_run_input: (required) + :type resume_agent_run_input: ResumeAgentRunInput :param authorization: :type authorization: object :param _request_timeout: timeout setting for this request. If one @@ -244,9 +5059,9 @@ def create_agent_run_v1_organizations_org_id_agent_run_post_without_preload_cont :return: Returns the result object. """ # noqa: E501 - _param = self._create_agent_run_v1_organizations_org_id_agent_run_post_serialize( + _param = self._resume_agent_run_v1_organizations_org_id_agent_run_resume_post_serialize( org_id=org_id, - create_agent_run_input=create_agent_run_input, + resume_agent_run_input=resume_agent_run_input, authorization=authorization, _request_auth=_request_auth, _content_type=_content_type, @@ -256,8 +5071,10 @@ def create_agent_run_v1_organizations_org_id_agent_run_post_without_preload_cont _response_types_map: Dict[str, Optional[str]] = { '200': "AgentRunResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -266,10 +5083,10 @@ def create_agent_run_v1_organizations_org_id_agent_run_post_without_preload_cont return response_data.response - def _create_agent_run_v1_organizations_org_id_agent_run_post_serialize( + def _resume_agent_run_v1_organizations_org_id_agent_run_resume_post_serialize( self, org_id, - create_agent_run_input, + resume_agent_run_input, authorization, _request_auth, _content_type, @@ -300,8 +5117,8 @@ def _create_agent_run_v1_organizations_org_id_agent_run_post_serialize( _header_params['authorization'] = authorization # process the form parameters # process the body parameter - if create_agent_run_input is not None: - _body_params = create_agent_run_input + if resume_agent_run_input is not None: + _body_params = resume_agent_run_input # set the HTTP header `Accept` @@ -332,7 +5149,7 @@ def _create_agent_run_v1_organizations_org_id_agent_run_post_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/v1/organizations/{org_id}/agent/run', + resource_path='/v1/organizations/{org_id}/agent/run/resume', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -349,10 +5166,10 @@ def _create_agent_run_v1_organizations_org_id_agent_run_post_serialize( @validate_call - def create_agent_run_v1_organizations_org_id_agent_run_post_0( + def resume_agent_run_v1_organizations_org_id_agent_run_resume_post_0( self, org_id: StrictInt, - create_agent_run_input: CreateAgentRunInput, + resume_agent_run_input: ResumeAgentRunInput, authorization: Optional[Any] = None, _request_timeout: Union[ None, @@ -367,14 +5184,14 @@ def create_agent_run_v1_organizations_org_id_agent_run_post_0( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> AgentRunResponse: - """Create Agent Run + """Resume Agent Run - Create a new agent run. Creates and initiates a long-running agent process based on the provided prompt. The process will complete asynchronously, and the response contains the agent run ID which can be used to check the status later. The requesting user must be a member of the specified organization. + Resume a paused agent run. Resumes a paused agent run, allowing it to continue processing. :param org_id: (required) :type org_id: int - :param create_agent_run_input: (required) - :type create_agent_run_input: CreateAgentRunInput + :param resume_agent_run_input: (required) + :type resume_agent_run_input: ResumeAgentRunInput :param authorization: :type authorization: object :param _request_timeout: timeout setting for this request. If one @@ -399,9 +5216,9 @@ def create_agent_run_v1_organizations_org_id_agent_run_post_0( :return: Returns the result object. """ # noqa: E501 - _param = self._create_agent_run_v1_organizations_org_id_agent_run_post_0_serialize( + _param = self._resume_agent_run_v1_organizations_org_id_agent_run_resume_post_0_serialize( org_id=org_id, - create_agent_run_input=create_agent_run_input, + resume_agent_run_input=resume_agent_run_input, authorization=authorization, _request_auth=_request_auth, _content_type=_content_type, @@ -411,8 +5228,10 @@ def create_agent_run_v1_organizations_org_id_agent_run_post_0( _response_types_map: Dict[str, Optional[str]] = { '200': "AgentRunResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -426,10 +5245,10 @@ def create_agent_run_v1_organizations_org_id_agent_run_post_0( @validate_call - def create_agent_run_v1_organizations_org_id_agent_run_post_0_with_http_info( + def resume_agent_run_v1_organizations_org_id_agent_run_resume_post_0_with_http_info( self, org_id: StrictInt, - create_agent_run_input: CreateAgentRunInput, + resume_agent_run_input: ResumeAgentRunInput, authorization: Optional[Any] = None, _request_timeout: Union[ None, @@ -444,14 +5263,14 @@ def create_agent_run_v1_organizations_org_id_agent_run_post_0_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[AgentRunResponse]: - """Create Agent Run + """Resume Agent Run - Create a new agent run. Creates and initiates a long-running agent process based on the provided prompt. The process will complete asynchronously, and the response contains the agent run ID which can be used to check the status later. The requesting user must be a member of the specified organization. + Resume a paused agent run. Resumes a paused agent run, allowing it to continue processing. :param org_id: (required) :type org_id: int - :param create_agent_run_input: (required) - :type create_agent_run_input: CreateAgentRunInput + :param resume_agent_run_input: (required) + :type resume_agent_run_input: ResumeAgentRunInput :param authorization: :type authorization: object :param _request_timeout: timeout setting for this request. If one @@ -476,9 +5295,9 @@ def create_agent_run_v1_organizations_org_id_agent_run_post_0_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._create_agent_run_v1_organizations_org_id_agent_run_post_0_serialize( + _param = self._resume_agent_run_v1_organizations_org_id_agent_run_resume_post_0_serialize( org_id=org_id, - create_agent_run_input=create_agent_run_input, + resume_agent_run_input=resume_agent_run_input, authorization=authorization, _request_auth=_request_auth, _content_type=_content_type, @@ -488,8 +5307,10 @@ def create_agent_run_v1_organizations_org_id_agent_run_post_0_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "AgentRunResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -503,10 +5324,10 @@ def create_agent_run_v1_organizations_org_id_agent_run_post_0_with_http_info( @validate_call - def create_agent_run_v1_organizations_org_id_agent_run_post_0_without_preload_content( + def resume_agent_run_v1_organizations_org_id_agent_run_resume_post_0_without_preload_content( self, org_id: StrictInt, - create_agent_run_input: CreateAgentRunInput, + resume_agent_run_input: ResumeAgentRunInput, authorization: Optional[Any] = None, _request_timeout: Union[ None, @@ -521,14 +5342,14 @@ def create_agent_run_v1_organizations_org_id_agent_run_post_0_without_preload_co _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create Agent Run + """Resume Agent Run - Create a new agent run. Creates and initiates a long-running agent process based on the provided prompt. The process will complete asynchronously, and the response contains the agent run ID which can be used to check the status later. The requesting user must be a member of the specified organization. + Resume a paused agent run. Resumes a paused agent run, allowing it to continue processing. :param org_id: (required) :type org_id: int - :param create_agent_run_input: (required) - :type create_agent_run_input: CreateAgentRunInput + :param resume_agent_run_input: (required) + :type resume_agent_run_input: ResumeAgentRunInput :param authorization: :type authorization: object :param _request_timeout: timeout setting for this request. If one @@ -553,9 +5374,9 @@ def create_agent_run_v1_organizations_org_id_agent_run_post_0_without_preload_co :return: Returns the result object. """ # noqa: E501 - _param = self._create_agent_run_v1_organizations_org_id_agent_run_post_0_serialize( + _param = self._resume_agent_run_v1_organizations_org_id_agent_run_resume_post_0_serialize( org_id=org_id, - create_agent_run_input=create_agent_run_input, + resume_agent_run_input=resume_agent_run_input, authorization=authorization, _request_auth=_request_auth, _content_type=_content_type, @@ -565,8 +5386,10 @@ def create_agent_run_v1_organizations_org_id_agent_run_post_0_without_preload_co _response_types_map: Dict[str, Optional[str]] = { '200': "AgentRunResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -575,10 +5398,10 @@ def create_agent_run_v1_organizations_org_id_agent_run_post_0_without_preload_co return response_data.response - def _create_agent_run_v1_organizations_org_id_agent_run_post_0_serialize( + def _resume_agent_run_v1_organizations_org_id_agent_run_resume_post_0_serialize( self, org_id, - create_agent_run_input, + resume_agent_run_input, authorization, _request_auth, _content_type, @@ -609,8 +5432,8 @@ def _create_agent_run_v1_organizations_org_id_agent_run_post_0_serialize( _header_params['authorization'] = authorization # process the form parameters # process the body parameter - if create_agent_run_input is not None: - _body_params = create_agent_run_input + if resume_agent_run_input is not None: + _body_params = resume_agent_run_input # set the HTTP header `Accept` @@ -641,7 +5464,7 @@ def _create_agent_run_v1_organizations_org_id_agent_run_post_0_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/v1/organizations/{org_id}/agent/run', + resource_path='/v1/organizations/{org_id}/agent/run/resume', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -658,10 +5481,10 @@ def _create_agent_run_v1_organizations_org_id_agent_run_post_0_serialize( @validate_call - def create_agent_run_v1_organizations_org_id_agent_run_post_1( + def resume_agent_run_v1_organizations_org_id_agent_run_resume_post_1( self, org_id: StrictInt, - create_agent_run_input: CreateAgentRunInput, + resume_agent_run_input: ResumeAgentRunInput, authorization: Optional[Any] = None, _request_timeout: Union[ None, @@ -676,14 +5499,14 @@ def create_agent_run_v1_organizations_org_id_agent_run_post_1( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> AgentRunResponse: - """Create Agent Run + """Resume Agent Run - Create a new agent run. Creates and initiates a long-running agent process based on the provided prompt. The process will complete asynchronously, and the response contains the agent run ID which can be used to check the status later. The requesting user must be a member of the specified organization. + Resume a paused agent run. Resumes a paused agent run, allowing it to continue processing. :param org_id: (required) :type org_id: int - :param create_agent_run_input: (required) - :type create_agent_run_input: CreateAgentRunInput + :param resume_agent_run_input: (required) + :type resume_agent_run_input: ResumeAgentRunInput :param authorization: :type authorization: object :param _request_timeout: timeout setting for this request. If one @@ -708,9 +5531,9 @@ def create_agent_run_v1_organizations_org_id_agent_run_post_1( :return: Returns the result object. """ # noqa: E501 - _param = self._create_agent_run_v1_organizations_org_id_agent_run_post_1_serialize( + _param = self._resume_agent_run_v1_organizations_org_id_agent_run_resume_post_1_serialize( org_id=org_id, - create_agent_run_input=create_agent_run_input, + resume_agent_run_input=resume_agent_run_input, authorization=authorization, _request_auth=_request_auth, _content_type=_content_type, @@ -720,8 +5543,10 @@ def create_agent_run_v1_organizations_org_id_agent_run_post_1( _response_types_map: Dict[str, Optional[str]] = { '200': "AgentRunResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -735,10 +5560,10 @@ def create_agent_run_v1_organizations_org_id_agent_run_post_1( @validate_call - def create_agent_run_v1_organizations_org_id_agent_run_post_1_with_http_info( + def resume_agent_run_v1_organizations_org_id_agent_run_resume_post_1_with_http_info( self, org_id: StrictInt, - create_agent_run_input: CreateAgentRunInput, + resume_agent_run_input: ResumeAgentRunInput, authorization: Optional[Any] = None, _request_timeout: Union[ None, @@ -753,14 +5578,14 @@ def create_agent_run_v1_organizations_org_id_agent_run_post_1_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[AgentRunResponse]: - """Create Agent Run + """Resume Agent Run - Create a new agent run. Creates and initiates a long-running agent process based on the provided prompt. The process will complete asynchronously, and the response contains the agent run ID which can be used to check the status later. The requesting user must be a member of the specified organization. + Resume a paused agent run. Resumes a paused agent run, allowing it to continue processing. :param org_id: (required) :type org_id: int - :param create_agent_run_input: (required) - :type create_agent_run_input: CreateAgentRunInput + :param resume_agent_run_input: (required) + :type resume_agent_run_input: ResumeAgentRunInput :param authorization: :type authorization: object :param _request_timeout: timeout setting for this request. If one @@ -785,9 +5610,9 @@ def create_agent_run_v1_organizations_org_id_agent_run_post_1_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._create_agent_run_v1_organizations_org_id_agent_run_post_1_serialize( + _param = self._resume_agent_run_v1_organizations_org_id_agent_run_resume_post_1_serialize( org_id=org_id, - create_agent_run_input=create_agent_run_input, + resume_agent_run_input=resume_agent_run_input, authorization=authorization, _request_auth=_request_auth, _content_type=_content_type, @@ -797,8 +5622,10 @@ def create_agent_run_v1_organizations_org_id_agent_run_post_1_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "AgentRunResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -812,10 +5639,10 @@ def create_agent_run_v1_organizations_org_id_agent_run_post_1_with_http_info( @validate_call - def create_agent_run_v1_organizations_org_id_agent_run_post_1_without_preload_content( + def resume_agent_run_v1_organizations_org_id_agent_run_resume_post_1_without_preload_content( self, org_id: StrictInt, - create_agent_run_input: CreateAgentRunInput, + resume_agent_run_input: ResumeAgentRunInput, authorization: Optional[Any] = None, _request_timeout: Union[ None, @@ -830,14 +5657,14 @@ def create_agent_run_v1_organizations_org_id_agent_run_post_1_without_preload_co _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create Agent Run + """Resume Agent Run - Create a new agent run. Creates and initiates a long-running agent process based on the provided prompt. The process will complete asynchronously, and the response contains the agent run ID which can be used to check the status later. The requesting user must be a member of the specified organization. + Resume a paused agent run. Resumes a paused agent run, allowing it to continue processing. :param org_id: (required) :type org_id: int - :param create_agent_run_input: (required) - :type create_agent_run_input: CreateAgentRunInput + :param resume_agent_run_input: (required) + :type resume_agent_run_input: ResumeAgentRunInput :param authorization: :type authorization: object :param _request_timeout: timeout setting for this request. If one @@ -862,9 +5689,9 @@ def create_agent_run_v1_organizations_org_id_agent_run_post_1_without_preload_co :return: Returns the result object. """ # noqa: E501 - _param = self._create_agent_run_v1_organizations_org_id_agent_run_post_1_serialize( + _param = self._resume_agent_run_v1_organizations_org_id_agent_run_resume_post_1_serialize( org_id=org_id, - create_agent_run_input=create_agent_run_input, + resume_agent_run_input=resume_agent_run_input, authorization=authorization, _request_auth=_request_auth, _content_type=_content_type, @@ -874,8 +5701,10 @@ def create_agent_run_v1_organizations_org_id_agent_run_post_1_without_preload_co _response_types_map: Dict[str, Optional[str]] = { '200': "AgentRunResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -884,10 +5713,10 @@ def create_agent_run_v1_organizations_org_id_agent_run_post_1_without_preload_co return response_data.response - def _create_agent_run_v1_organizations_org_id_agent_run_post_1_serialize( + def _resume_agent_run_v1_organizations_org_id_agent_run_resume_post_1_serialize( self, org_id, - create_agent_run_input, + resume_agent_run_input, authorization, _request_auth, _content_type, @@ -918,8 +5747,8 @@ def _create_agent_run_v1_organizations_org_id_agent_run_post_1_serialize( _header_params['authorization'] = authorization # process the form parameters # process the body parameter - if create_agent_run_input is not None: - _body_params = create_agent_run_input + if resume_agent_run_input is not None: + _body_params = resume_agent_run_input # set the HTTP header `Accept` @@ -950,7 +5779,7 @@ def _create_agent_run_v1_organizations_org_id_agent_run_post_1_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/v1/organizations/{org_id}/agent/run', + resource_path='/v1/organizations/{org_id}/agent/run/resume', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -967,10 +5796,10 @@ def _create_agent_run_v1_organizations_org_id_agent_run_post_1_serialize( @validate_call - def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get( + def unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post( self, - agent_run_id: StrictInt, org_id: StrictInt, + stop_agent_run_input: StopAgentRunInput, authorization: Optional[Any] = None, _request_timeout: Union[ None, @@ -984,15 +5813,15 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AgentRunResponse: - """Get Agent Run + ) -> object: + """Unban All Checks For Agent Run - Retrieve the status and result of an agent run. Returns the current status, progress, and any available results for the specified agent run. The agent run must belong to the specified organization. If the agent run is still in progress, this endpoint can be polled to check for completion. + Unban all checks for a PR. This endpoint: 1. Removes the ban flag from the PR to allow future CI/CD check suite events to be processed 2. Handles both URL-based bans and parent-agent-run-based bans - :param agent_run_id: (required) - :type agent_run_id: int :param org_id: (required) :type org_id: int + :param stop_agent_run_input: (required) + :type stop_agent_run_input: StopAgentRunInput :param authorization: :type authorization: object :param _request_timeout: timeout setting for this request. If one @@ -1017,9 +5846,9 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get( :return: Returns the result object. """ # noqa: E501 - _param = self._get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_serialize( - agent_run_id=agent_run_id, + _param = self._unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_serialize( org_id=org_id, + stop_agent_run_input=stop_agent_run_input, authorization=authorization, _request_auth=_request_auth, _content_type=_content_type, @@ -1028,9 +5857,11 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AgentRunResponse", + '200': "object", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -1044,10 +5875,10 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get( @validate_call - def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_with_http_info( + def unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_with_http_info( self, - agent_run_id: StrictInt, org_id: StrictInt, + stop_agent_run_input: StopAgentRunInput, authorization: Optional[Any] = None, _request_timeout: Union[ None, @@ -1061,15 +5892,15 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_with_http_i _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[AgentRunResponse]: - """Get Agent Run + ) -> ApiResponse[object]: + """Unban All Checks For Agent Run - Retrieve the status and result of an agent run. Returns the current status, progress, and any available results for the specified agent run. The agent run must belong to the specified organization. If the agent run is still in progress, this endpoint can be polled to check for completion. + Unban all checks for a PR. This endpoint: 1. Removes the ban flag from the PR to allow future CI/CD check suite events to be processed 2. Handles both URL-based bans and parent-agent-run-based bans - :param agent_run_id: (required) - :type agent_run_id: int :param org_id: (required) :type org_id: int + :param stop_agent_run_input: (required) + :type stop_agent_run_input: StopAgentRunInput :param authorization: :type authorization: object :param _request_timeout: timeout setting for this request. If one @@ -1094,9 +5925,9 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_with_http_i :return: Returns the result object. """ # noqa: E501 - _param = self._get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_serialize( - agent_run_id=agent_run_id, + _param = self._unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_serialize( org_id=org_id, + stop_agent_run_input=stop_agent_run_input, authorization=authorization, _request_auth=_request_auth, _content_type=_content_type, @@ -1105,9 +5936,11 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_with_http_i ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AgentRunResponse", + '200': "object", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -1121,10 +5954,10 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_with_http_i @validate_call - def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_without_preload_content( + def unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_without_preload_content( self, - agent_run_id: StrictInt, org_id: StrictInt, + stop_agent_run_input: StopAgentRunInput, authorization: Optional[Any] = None, _request_timeout: Union[ None, @@ -1139,14 +5972,14 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_without_pre _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get Agent Run + """Unban All Checks For Agent Run - Retrieve the status and result of an agent run. Returns the current status, progress, and any available results for the specified agent run. The agent run must belong to the specified organization. If the agent run is still in progress, this endpoint can be polled to check for completion. + Unban all checks for a PR. This endpoint: 1. Removes the ban flag from the PR to allow future CI/CD check suite events to be processed 2. Handles both URL-based bans and parent-agent-run-based bans - :param agent_run_id: (required) - :type agent_run_id: int :param org_id: (required) :type org_id: int + :param stop_agent_run_input: (required) + :type stop_agent_run_input: StopAgentRunInput :param authorization: :type authorization: object :param _request_timeout: timeout setting for this request. If one @@ -1171,9 +6004,9 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_without_pre :return: Returns the result object. """ # noqa: E501 - _param = self._get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_serialize( - agent_run_id=agent_run_id, + _param = self._unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_serialize( org_id=org_id, + stop_agent_run_input=stop_agent_run_input, authorization=authorization, _request_auth=_request_auth, _content_type=_content_type, @@ -1182,9 +6015,11 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_without_pre ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AgentRunResponse", + '200': "object", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -1193,10 +6028,10 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_without_pre return response_data.response - def _get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_serialize( + def _unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_serialize( self, - agent_run_id, org_id, + stop_agent_run_input, authorization, _request_auth, _content_type, @@ -1219,8 +6054,6 @@ def _get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_serialize( _body_params: Optional[bytes] = None # process the path parameters - if agent_run_id is not None: - _path_params['agent_run_id'] = agent_run_id if org_id is not None: _path_params['org_id'] = org_id # process the query parameters @@ -1229,6 +6062,8 @@ def _get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_serialize( _header_params['authorization'] = authorization # process the form parameters # process the body parameter + if stop_agent_run_input is not None: + _body_params = stop_agent_run_input # set the HTTP header `Accept` @@ -1239,14 +6074,27 @@ def _get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_serialize( ] ) + # 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] = [ ] return self.api_client.param_serialize( - method='GET', - resource_path='/v1/organizations/{org_id}/agent/run/{agent_run_id}', + method='POST', + resource_path='/v1/organizations/{org_id}/agent/run/unban', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1263,10 +6111,10 @@ def _get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_serialize( @validate_call - def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_0( + def unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_0( self, - agent_run_id: StrictInt, org_id: StrictInt, + stop_agent_run_input: StopAgentRunInput, authorization: Optional[Any] = None, _request_timeout: Union[ None, @@ -1280,15 +6128,15 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_0( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AgentRunResponse: - """Get Agent Run + ) -> object: + """Unban All Checks For Agent Run - Retrieve the status and result of an agent run. Returns the current status, progress, and any available results for the specified agent run. The agent run must belong to the specified organization. If the agent run is still in progress, this endpoint can be polled to check for completion. + Unban all checks for a PR. This endpoint: 1. Removes the ban flag from the PR to allow future CI/CD check suite events to be processed 2. Handles both URL-based bans and parent-agent-run-based bans - :param agent_run_id: (required) - :type agent_run_id: int :param org_id: (required) :type org_id: int + :param stop_agent_run_input: (required) + :type stop_agent_run_input: StopAgentRunInput :param authorization: :type authorization: object :param _request_timeout: timeout setting for this request. If one @@ -1313,9 +6161,9 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_0( :return: Returns the result object. """ # noqa: E501 - _param = self._get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_0_serialize( - agent_run_id=agent_run_id, + _param = self._unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_0_serialize( org_id=org_id, + stop_agent_run_input=stop_agent_run_input, authorization=authorization, _request_auth=_request_auth, _content_type=_content_type, @@ -1324,9 +6172,11 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_0( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AgentRunResponse", + '200': "object", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -1340,10 +6190,10 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_0( @validate_call - def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_0_with_http_info( + def unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_0_with_http_info( self, - agent_run_id: StrictInt, org_id: StrictInt, + stop_agent_run_input: StopAgentRunInput, authorization: Optional[Any] = None, _request_timeout: Union[ None, @@ -1357,15 +6207,15 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_0_with_http _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[AgentRunResponse]: - """Get Agent Run + ) -> ApiResponse[object]: + """Unban All Checks For Agent Run - Retrieve the status and result of an agent run. Returns the current status, progress, and any available results for the specified agent run. The agent run must belong to the specified organization. If the agent run is still in progress, this endpoint can be polled to check for completion. + Unban all checks for a PR. This endpoint: 1. Removes the ban flag from the PR to allow future CI/CD check suite events to be processed 2. Handles both URL-based bans and parent-agent-run-based bans - :param agent_run_id: (required) - :type agent_run_id: int :param org_id: (required) :type org_id: int + :param stop_agent_run_input: (required) + :type stop_agent_run_input: StopAgentRunInput :param authorization: :type authorization: object :param _request_timeout: timeout setting for this request. If one @@ -1390,9 +6240,9 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_0_with_http :return: Returns the result object. """ # noqa: E501 - _param = self._get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_0_serialize( - agent_run_id=agent_run_id, + _param = self._unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_0_serialize( org_id=org_id, + stop_agent_run_input=stop_agent_run_input, authorization=authorization, _request_auth=_request_auth, _content_type=_content_type, @@ -1401,9 +6251,11 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_0_with_http ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AgentRunResponse", + '200': "object", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -1417,10 +6269,10 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_0_with_http @validate_call - def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_0_without_preload_content( + def unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_0_without_preload_content( self, - agent_run_id: StrictInt, org_id: StrictInt, + stop_agent_run_input: StopAgentRunInput, authorization: Optional[Any] = None, _request_timeout: Union[ None, @@ -1435,14 +6287,14 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_0_without_p _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get Agent Run + """Unban All Checks For Agent Run - Retrieve the status and result of an agent run. Returns the current status, progress, and any available results for the specified agent run. The agent run must belong to the specified organization. If the agent run is still in progress, this endpoint can be polled to check for completion. + Unban all checks for a PR. This endpoint: 1. Removes the ban flag from the PR to allow future CI/CD check suite events to be processed 2. Handles both URL-based bans and parent-agent-run-based bans - :param agent_run_id: (required) - :type agent_run_id: int :param org_id: (required) :type org_id: int + :param stop_agent_run_input: (required) + :type stop_agent_run_input: StopAgentRunInput :param authorization: :type authorization: object :param _request_timeout: timeout setting for this request. If one @@ -1467,9 +6319,9 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_0_without_p :return: Returns the result object. """ # noqa: E501 - _param = self._get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_0_serialize( - agent_run_id=agent_run_id, + _param = self._unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_0_serialize( org_id=org_id, + stop_agent_run_input=stop_agent_run_input, authorization=authorization, _request_auth=_request_auth, _content_type=_content_type, @@ -1478,9 +6330,11 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_0_without_p ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AgentRunResponse", + '200': "object", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -1489,10 +6343,10 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_0_without_p return response_data.response - def _get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_0_serialize( + def _unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_0_serialize( self, - agent_run_id, org_id, + stop_agent_run_input, authorization, _request_auth, _content_type, @@ -1515,8 +6369,6 @@ def _get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_0_serializ _body_params: Optional[bytes] = None # process the path parameters - if agent_run_id is not None: - _path_params['agent_run_id'] = agent_run_id if org_id is not None: _path_params['org_id'] = org_id # process the query parameters @@ -1525,6 +6377,8 @@ def _get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_0_serializ _header_params['authorization'] = authorization # process the form parameters # process the body parameter + if stop_agent_run_input is not None: + _body_params = stop_agent_run_input # set the HTTP header `Accept` @@ -1535,14 +6389,27 @@ def _get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_0_serializ ] ) + # 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] = [ ] return self.api_client.param_serialize( - method='GET', - resource_path='/v1/organizations/{org_id}/agent/run/{agent_run_id}', + method='POST', + resource_path='/v1/organizations/{org_id}/agent/run/unban', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1559,10 +6426,10 @@ def _get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_0_serializ @validate_call - def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_1( + def unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_1( self, - agent_run_id: StrictInt, org_id: StrictInt, + stop_agent_run_input: StopAgentRunInput, authorization: Optional[Any] = None, _request_timeout: Union[ None, @@ -1576,15 +6443,15 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_1( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AgentRunResponse: - """Get Agent Run + ) -> object: + """Unban All Checks For Agent Run - Retrieve the status and result of an agent run. Returns the current status, progress, and any available results for the specified agent run. The agent run must belong to the specified organization. If the agent run is still in progress, this endpoint can be polled to check for completion. + Unban all checks for a PR. This endpoint: 1. Removes the ban flag from the PR to allow future CI/CD check suite events to be processed 2. Handles both URL-based bans and parent-agent-run-based bans - :param agent_run_id: (required) - :type agent_run_id: int :param org_id: (required) :type org_id: int + :param stop_agent_run_input: (required) + :type stop_agent_run_input: StopAgentRunInput :param authorization: :type authorization: object :param _request_timeout: timeout setting for this request. If one @@ -1609,9 +6476,9 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_1( :return: Returns the result object. """ # noqa: E501 - _param = self._get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_1_serialize( - agent_run_id=agent_run_id, + _param = self._unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_1_serialize( org_id=org_id, + stop_agent_run_input=stop_agent_run_input, authorization=authorization, _request_auth=_request_auth, _content_type=_content_type, @@ -1620,9 +6487,11 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_1( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AgentRunResponse", + '200': "object", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -1636,10 +6505,10 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_1( @validate_call - def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_1_with_http_info( + def unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_1_with_http_info( self, - agent_run_id: StrictInt, org_id: StrictInt, + stop_agent_run_input: StopAgentRunInput, authorization: Optional[Any] = None, _request_timeout: Union[ None, @@ -1653,15 +6522,15 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_1_with_http _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[AgentRunResponse]: - """Get Agent Run + ) -> ApiResponse[object]: + """Unban All Checks For Agent Run - Retrieve the status and result of an agent run. Returns the current status, progress, and any available results for the specified agent run. The agent run must belong to the specified organization. If the agent run is still in progress, this endpoint can be polled to check for completion. + Unban all checks for a PR. This endpoint: 1. Removes the ban flag from the PR to allow future CI/CD check suite events to be processed 2. Handles both URL-based bans and parent-agent-run-based bans - :param agent_run_id: (required) - :type agent_run_id: int :param org_id: (required) :type org_id: int + :param stop_agent_run_input: (required) + :type stop_agent_run_input: StopAgentRunInput :param authorization: :type authorization: object :param _request_timeout: timeout setting for this request. If one @@ -1686,9 +6555,9 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_1_with_http :return: Returns the result object. """ # noqa: E501 - _param = self._get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_1_serialize( - agent_run_id=agent_run_id, + _param = self._unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_1_serialize( org_id=org_id, + stop_agent_run_input=stop_agent_run_input, authorization=authorization, _request_auth=_request_auth, _content_type=_content_type, @@ -1697,9 +6566,11 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_1_with_http ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AgentRunResponse", + '200': "object", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -1713,10 +6584,10 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_1_with_http @validate_call - def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_1_without_preload_content( + def unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_1_without_preload_content( self, - agent_run_id: StrictInt, org_id: StrictInt, + stop_agent_run_input: StopAgentRunInput, authorization: Optional[Any] = None, _request_timeout: Union[ None, @@ -1731,14 +6602,14 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_1_without_p _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get Agent Run + """Unban All Checks For Agent Run - Retrieve the status and result of an agent run. Returns the current status, progress, and any available results for the specified agent run. The agent run must belong to the specified organization. If the agent run is still in progress, this endpoint can be polled to check for completion. + Unban all checks for a PR. This endpoint: 1. Removes the ban flag from the PR to allow future CI/CD check suite events to be processed 2. Handles both URL-based bans and parent-agent-run-based bans - :param agent_run_id: (required) - :type agent_run_id: int :param org_id: (required) :type org_id: int + :param stop_agent_run_input: (required) + :type stop_agent_run_input: StopAgentRunInput :param authorization: :type authorization: object :param _request_timeout: timeout setting for this request. If one @@ -1763,9 +6634,9 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_1_without_p :return: Returns the result object. """ # noqa: E501 - _param = self._get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_1_serialize( - agent_run_id=agent_run_id, + _param = self._unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_1_serialize( org_id=org_id, + stop_agent_run_input=stop_agent_run_input, authorization=authorization, _request_auth=_request_auth, _content_type=_content_type, @@ -1774,9 +6645,11 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_1_without_p ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AgentRunResponse", + '200': "object", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -1785,10 +6658,10 @@ def get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_1_without_p return response_data.response - def _get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_1_serialize( + def _unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_1_serialize( self, - agent_run_id, org_id, + stop_agent_run_input, authorization, _request_auth, _content_type, @@ -1811,8 +6684,6 @@ def _get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_1_serializ _body_params: Optional[bytes] = None # process the path parameters - if agent_run_id is not None: - _path_params['agent_run_id'] = agent_run_id if org_id is not None: _path_params['org_id'] = org_id # process the query parameters @@ -1821,6 +6692,8 @@ def _get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_1_serializ _header_params['authorization'] = authorization # process the form parameters # process the body parameter + if stop_agent_run_input is not None: + _body_params = stop_agent_run_input # set the HTTP header `Accept` @@ -1831,14 +6704,27 @@ def _get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_1_serializ ] ) + # 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] = [ ] return self.api_client.param_serialize( - method='GET', - resource_path='/v1/organizations/{org_id}/agent/run/{agent_run_id}', + method='POST', + resource_path='/v1/organizations/{org_id}/agent/run/unban', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/codegen_api_client/api/agents_beta_api.py b/codegen_api_client/api/agents_beta_api.py new file mode 100644 index 0000000..0f8d857 --- /dev/null +++ b/codegen_api_client/api/agents_beta_api.py @@ -0,0 +1,375 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + 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 +from typing import Any, Optional +from typing_extensions import Annotated +from codegen_api_client.models.agent_run_with_logs_response import AgentRunWithLogsResponse + +from codegen_api_client.api_client import ApiClient, RequestSerialized +from codegen_api_client.api_response import ApiResponse +from codegen_api_client.rest import RESTResponseType + + +class AgentsBetaApi: + """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_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get( + self, + agent_run_id: StrictInt, + org_id: StrictInt, + skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + authorization: Optional[Any] = 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, + ) -> AgentRunWithLogsResponse: + """Get Agent Run Logs + + Retrieve an agent run with its logs using pagination. This endpoint is currently in ALPHA and IS subject to change. Returns the agent run details along with a paginated list of logs for the specified agent run. The agent run must belong to the specified organization. Logs are returned in chronological order. Uses standard pagination parameters (skip and limit) and includes pagination metadata in the response. Rate limit: 60 requests per 60 seconds. + + :param agent_run_id: (required) + :type agent_run_id: int + :param org_id: (required) + :type org_id: int + :param skip: + :type skip: int + :param limit: + :type limit: int + :param authorization: + :type authorization: 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._get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get_serialize( + agent_run_id=agent_run_id, + org_id=org_id, + skip=skip, + limit=limit, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentRunWithLogsResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + 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_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get_with_http_info( + self, + agent_run_id: StrictInt, + org_id: StrictInt, + skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + authorization: Optional[Any] = 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[AgentRunWithLogsResponse]: + """Get Agent Run Logs + + Retrieve an agent run with its logs using pagination. This endpoint is currently in ALPHA and IS subject to change. Returns the agent run details along with a paginated list of logs for the specified agent run. The agent run must belong to the specified organization. Logs are returned in chronological order. Uses standard pagination parameters (skip and limit) and includes pagination metadata in the response. Rate limit: 60 requests per 60 seconds. + + :param agent_run_id: (required) + :type agent_run_id: int + :param org_id: (required) + :type org_id: int + :param skip: + :type skip: int + :param limit: + :type limit: int + :param authorization: + :type authorization: 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._get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get_serialize( + agent_run_id=agent_run_id, + org_id=org_id, + skip=skip, + limit=limit, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentRunWithLogsResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + 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_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get_without_preload_content( + self, + agent_run_id: StrictInt, + org_id: StrictInt, + skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + authorization: Optional[Any] = 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 Agent Run Logs + + Retrieve an agent run with its logs using pagination. This endpoint is currently in ALPHA and IS subject to change. Returns the agent run details along with a paginated list of logs for the specified agent run. The agent run must belong to the specified organization. Logs are returned in chronological order. Uses standard pagination parameters (skip and limit) and includes pagination metadata in the response. Rate limit: 60 requests per 60 seconds. + + :param agent_run_id: (required) + :type agent_run_id: int + :param org_id: (required) + :type org_id: int + :param skip: + :type skip: int + :param limit: + :type limit: int + :param authorization: + :type authorization: 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._get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get_serialize( + agent_run_id=agent_run_id, + org_id=org_id, + skip=skip, + limit=limit, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentRunWithLogsResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "AgentRunNotFoundErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get_serialize( + self, + agent_run_id, + org_id, + skip, + limit, + authorization, + _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 agent_run_id is not None: + _path_params['agent_run_id'] = agent_run_id + if org_id is not None: + _path_params['org_id'] = org_id + # process the query parameters + if skip is not None: + + _query_params.append(('skip', skip)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/alpha/organizations/{org_id}/agent/run/{agent_run_id}/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 + ) + + diff --git a/codegen_api_client/api/integrations_api.py b/codegen_api_client/api/integrations_api.py new file mode 100644 index 0000000..a660c1d --- /dev/null +++ b/codegen_api_client/api/integrations_api.py @@ -0,0 +1,890 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + 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 StrictInt +from typing import Any, Optional +from codegen_api_client.models.organization_integrations_response import OrganizationIntegrationsResponse + +from codegen_api_client.api_client import ApiClient, RequestSerialized +from codegen_api_client.api_response import ApiResponse +from codegen_api_client.rest import RESTResponseType + + +class IntegrationsApi: + """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_organization_integrations_endpoint_v1_organizations_org_id_integrations_get( + self, + org_id: StrictInt, + authorization: Optional[Any] = 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, + ) -> OrganizationIntegrationsResponse: + """Get Organization Integrations Endpoint + + Get all integration statuses for the given organization. Returns a comprehensive overview of all integrations configured for the organization, including: - OAuth-based integrations (Slack, Linear, Notion, Figma, ClickUp, Jira, Sentry, Monday.com) - GitHub app installations - API key-based integrations (CircleCI) - Database connections (PostgreSQL) Each integration includes its current status (active/inactive), associated token/installation IDs, and relevant metadata such as app names, organization names, etc. Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param authorization: + :type authorization: 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._get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_serialize( + org_id=org_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OrganizationIntegrationsResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + 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_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_with_http_info( + self, + org_id: StrictInt, + authorization: Optional[Any] = 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[OrganizationIntegrationsResponse]: + """Get Organization Integrations Endpoint + + Get all integration statuses for the given organization. Returns a comprehensive overview of all integrations configured for the organization, including: - OAuth-based integrations (Slack, Linear, Notion, Figma, ClickUp, Jira, Sentry, Monday.com) - GitHub app installations - API key-based integrations (CircleCI) - Database connections (PostgreSQL) Each integration includes its current status (active/inactive), associated token/installation IDs, and relevant metadata such as app names, organization names, etc. Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param authorization: + :type authorization: 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._get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_serialize( + org_id=org_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OrganizationIntegrationsResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + 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_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_without_preload_content( + self, + org_id: StrictInt, + authorization: Optional[Any] = 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 Organization Integrations Endpoint + + Get all integration statuses for the given organization. Returns a comprehensive overview of all integrations configured for the organization, including: - OAuth-based integrations (Slack, Linear, Notion, Figma, ClickUp, Jira, Sentry, Monday.com) - GitHub app installations - API key-based integrations (CircleCI) - Database connections (PostgreSQL) Each integration includes its current status (active/inactive), associated token/installation IDs, and relevant metadata such as app names, organization names, etc. Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param authorization: + :type authorization: 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._get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_serialize( + org_id=org_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OrganizationIntegrationsResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_serialize( + self, + org_id, + authorization, + _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 org_id is not None: + _path_params['org_id'] = org_id + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/organizations/{org_id}/integrations', + 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_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_0( + self, + org_id: StrictInt, + authorization: Optional[Any] = 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, + ) -> OrganizationIntegrationsResponse: + """Get Organization Integrations Endpoint + + Get all integration statuses for the given organization. Returns a comprehensive overview of all integrations configured for the organization, including: - OAuth-based integrations (Slack, Linear, Notion, Figma, ClickUp, Jira, Sentry, Monday.com) - GitHub app installations - API key-based integrations (CircleCI) - Database connections (PostgreSQL) Each integration includes its current status (active/inactive), associated token/installation IDs, and relevant metadata such as app names, organization names, etc. Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param authorization: + :type authorization: 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._get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_0_serialize( + org_id=org_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OrganizationIntegrationsResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + 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_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_0_with_http_info( + self, + org_id: StrictInt, + authorization: Optional[Any] = 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[OrganizationIntegrationsResponse]: + """Get Organization Integrations Endpoint + + Get all integration statuses for the given organization. Returns a comprehensive overview of all integrations configured for the organization, including: - OAuth-based integrations (Slack, Linear, Notion, Figma, ClickUp, Jira, Sentry, Monday.com) - GitHub app installations - API key-based integrations (CircleCI) - Database connections (PostgreSQL) Each integration includes its current status (active/inactive), associated token/installation IDs, and relevant metadata such as app names, organization names, etc. Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param authorization: + :type authorization: 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._get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_0_serialize( + org_id=org_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OrganizationIntegrationsResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + 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_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_0_without_preload_content( + self, + org_id: StrictInt, + authorization: Optional[Any] = 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 Organization Integrations Endpoint + + Get all integration statuses for the given organization. Returns a comprehensive overview of all integrations configured for the organization, including: - OAuth-based integrations (Slack, Linear, Notion, Figma, ClickUp, Jira, Sentry, Monday.com) - GitHub app installations - API key-based integrations (CircleCI) - Database connections (PostgreSQL) Each integration includes its current status (active/inactive), associated token/installation IDs, and relevant metadata such as app names, organization names, etc. Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param authorization: + :type authorization: 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._get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_0_serialize( + org_id=org_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OrganizationIntegrationsResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_0_serialize( + self, + org_id, + authorization, + _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 org_id is not None: + _path_params['org_id'] = org_id + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/organizations/{org_id}/integrations', + 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_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_1( + self, + org_id: StrictInt, + authorization: Optional[Any] = 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, + ) -> OrganizationIntegrationsResponse: + """Get Organization Integrations Endpoint + + Get all integration statuses for the given organization. Returns a comprehensive overview of all integrations configured for the organization, including: - OAuth-based integrations (Slack, Linear, Notion, Figma, ClickUp, Jira, Sentry, Monday.com) - GitHub app installations - API key-based integrations (CircleCI) - Database connections (PostgreSQL) Each integration includes its current status (active/inactive), associated token/installation IDs, and relevant metadata such as app names, organization names, etc. Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param authorization: + :type authorization: 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._get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_1_serialize( + org_id=org_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OrganizationIntegrationsResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + 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_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_1_with_http_info( + self, + org_id: StrictInt, + authorization: Optional[Any] = 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[OrganizationIntegrationsResponse]: + """Get Organization Integrations Endpoint + + Get all integration statuses for the given organization. Returns a comprehensive overview of all integrations configured for the organization, including: - OAuth-based integrations (Slack, Linear, Notion, Figma, ClickUp, Jira, Sentry, Monday.com) - GitHub app installations - API key-based integrations (CircleCI) - Database connections (PostgreSQL) Each integration includes its current status (active/inactive), associated token/installation IDs, and relevant metadata such as app names, organization names, etc. Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param authorization: + :type authorization: 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._get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_1_serialize( + org_id=org_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OrganizationIntegrationsResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + 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_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_1_without_preload_content( + self, + org_id: StrictInt, + authorization: Optional[Any] = 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 Organization Integrations Endpoint + + Get all integration statuses for the given organization. Returns a comprehensive overview of all integrations configured for the organization, including: - OAuth-based integrations (Slack, Linear, Notion, Figma, ClickUp, Jira, Sentry, Monday.com) - GitHub app installations - API key-based integrations (CircleCI) - Database connections (PostgreSQL) Each integration includes its current status (active/inactive), associated token/installation IDs, and relevant metadata such as app names, organization names, etc. Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param authorization: + :type authorization: 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._get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_1_serialize( + org_id=org_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OrganizationIntegrationsResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_1_serialize( + self, + org_id, + authorization, + _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 org_id is not None: + _path_params['org_id'] = org_id + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/organizations/{org_id}/integrations', + 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/codegen_api_client/api/linear_api.py b/codegen_api_client/api/linear_api.py new file mode 100644 index 0000000..035ccab --- /dev/null +++ b/codegen_api_client/api/linear_api.py @@ -0,0 +1,1722 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + 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 Any, Optional + +from codegen_api_client.api_client import ApiClient, RequestSerialized +from codegen_api_client.api_response import ApiResponse +from codegen_api_client.rest import RESTResponseType + + +class LinearApi: + """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_linear_projects_v1_linear_projects_get( + self, + authorization: Optional[Any] = None, + x_organization_id: Optional[Any] = 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, + ) -> object: + """Get Linear Projects + + Get Linear projects for the authenticated user's organization. Returns a list of all Linear projects that the authenticated user has access to within the specified organization. This endpoint is used to populate project selection dropdowns in repository settings. Rate limit: 60 requests per 30 seconds. + + :param authorization: + :type authorization: object + :param x_organization_id: + :type x_organization_id: 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._get_linear_projects_v1_linear_projects_get_serialize( + authorization=authorization, + x_organization_id=x_organization_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '422': "HTTPValidationError", + } + 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_linear_projects_v1_linear_projects_get_with_http_info( + self, + authorization: Optional[Any] = None, + x_organization_id: Optional[Any] = 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[object]: + """Get Linear Projects + + Get Linear projects for the authenticated user's organization. Returns a list of all Linear projects that the authenticated user has access to within the specified organization. This endpoint is used to populate project selection dropdowns in repository settings. Rate limit: 60 requests per 30 seconds. + + :param authorization: + :type authorization: object + :param x_organization_id: + :type x_organization_id: 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._get_linear_projects_v1_linear_projects_get_serialize( + authorization=authorization, + x_organization_id=x_organization_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '422': "HTTPValidationError", + } + 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_linear_projects_v1_linear_projects_get_without_preload_content( + self, + authorization: Optional[Any] = None, + x_organization_id: Optional[Any] = 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 Linear Projects + + Get Linear projects for the authenticated user's organization. Returns a list of all Linear projects that the authenticated user has access to within the specified organization. This endpoint is used to populate project selection dropdowns in repository settings. Rate limit: 60 requests per 30 seconds. + + :param authorization: + :type authorization: object + :param x_organization_id: + :type x_organization_id: 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._get_linear_projects_v1_linear_projects_get_serialize( + authorization=authorization, + x_organization_id=x_organization_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_linear_projects_v1_linear_projects_get_serialize( + self, + authorization, + x_organization_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 + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + if x_organization_id is not None: + _header_params['X-Organization-Id'] = x_organization_id + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/linear/projects', + 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_linear_projects_v1_linear_projects_get_0( + self, + authorization: Optional[Any] = None, + x_organization_id: Optional[Any] = 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, + ) -> object: + """Get Linear Projects + + Get Linear projects for the authenticated user's organization. Returns a list of all Linear projects that the authenticated user has access to within the specified organization. This endpoint is used to populate project selection dropdowns in repository settings. Rate limit: 60 requests per 30 seconds. + + :param authorization: + :type authorization: object + :param x_organization_id: + :type x_organization_id: 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._get_linear_projects_v1_linear_projects_get_0_serialize( + authorization=authorization, + x_organization_id=x_organization_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '422': "HTTPValidationError", + } + 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_linear_projects_v1_linear_projects_get_0_with_http_info( + self, + authorization: Optional[Any] = None, + x_organization_id: Optional[Any] = 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[object]: + """Get Linear Projects + + Get Linear projects for the authenticated user's organization. Returns a list of all Linear projects that the authenticated user has access to within the specified organization. This endpoint is used to populate project selection dropdowns in repository settings. Rate limit: 60 requests per 30 seconds. + + :param authorization: + :type authorization: object + :param x_organization_id: + :type x_organization_id: 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._get_linear_projects_v1_linear_projects_get_0_serialize( + authorization=authorization, + x_organization_id=x_organization_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '422': "HTTPValidationError", + } + 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_linear_projects_v1_linear_projects_get_0_without_preload_content( + self, + authorization: Optional[Any] = None, + x_organization_id: Optional[Any] = 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 Linear Projects + + Get Linear projects for the authenticated user's organization. Returns a list of all Linear projects that the authenticated user has access to within the specified organization. This endpoint is used to populate project selection dropdowns in repository settings. Rate limit: 60 requests per 30 seconds. + + :param authorization: + :type authorization: object + :param x_organization_id: + :type x_organization_id: 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._get_linear_projects_v1_linear_projects_get_0_serialize( + authorization=authorization, + x_organization_id=x_organization_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_linear_projects_v1_linear_projects_get_0_serialize( + self, + authorization, + x_organization_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 + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + if x_organization_id is not None: + _header_params['X-Organization-Id'] = x_organization_id + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/linear/projects', + 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_linear_projects_v1_linear_projects_get_1( + self, + authorization: Optional[Any] = None, + x_organization_id: Optional[Any] = 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, + ) -> object: + """Get Linear Projects + + Get Linear projects for the authenticated user's organization. Returns a list of all Linear projects that the authenticated user has access to within the specified organization. This endpoint is used to populate project selection dropdowns in repository settings. Rate limit: 60 requests per 30 seconds. + + :param authorization: + :type authorization: object + :param x_organization_id: + :type x_organization_id: 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._get_linear_projects_v1_linear_projects_get_1_serialize( + authorization=authorization, + x_organization_id=x_organization_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '422': "HTTPValidationError", + } + 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_linear_projects_v1_linear_projects_get_1_with_http_info( + self, + authorization: Optional[Any] = None, + x_organization_id: Optional[Any] = 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[object]: + """Get Linear Projects + + Get Linear projects for the authenticated user's organization. Returns a list of all Linear projects that the authenticated user has access to within the specified organization. This endpoint is used to populate project selection dropdowns in repository settings. Rate limit: 60 requests per 30 seconds. + + :param authorization: + :type authorization: object + :param x_organization_id: + :type x_organization_id: 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._get_linear_projects_v1_linear_projects_get_1_serialize( + authorization=authorization, + x_organization_id=x_organization_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '422': "HTTPValidationError", + } + 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_linear_projects_v1_linear_projects_get_1_without_preload_content( + self, + authorization: Optional[Any] = None, + x_organization_id: Optional[Any] = 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 Linear Projects + + Get Linear projects for the authenticated user's organization. Returns a list of all Linear projects that the authenticated user has access to within the specified organization. This endpoint is used to populate project selection dropdowns in repository settings. Rate limit: 60 requests per 30 seconds. + + :param authorization: + :type authorization: object + :param x_organization_id: + :type x_organization_id: 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._get_linear_projects_v1_linear_projects_get_1_serialize( + authorization=authorization, + x_organization_id=x_organization_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_linear_projects_v1_linear_projects_get_1_serialize( + self, + authorization, + x_organization_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 + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + if x_organization_id is not None: + _header_params['X-Organization-Id'] = x_organization_id + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/linear/projects', + 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_linear_teams_v1_linear_teams_get( + self, + authorization: Optional[Any] = None, + x_organization_id: Optional[Any] = 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, + ) -> object: + """Get Linear Teams + + Get Linear teams for the authenticated user's organization. Returns a list of all Linear teams that the authenticated user has access to within the specified organization. This endpoint is used to populate team selection dropdowns in repository settings. Rate limit: 60 requests per 30 seconds. + + :param authorization: + :type authorization: object + :param x_organization_id: + :type x_organization_id: 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._get_linear_teams_v1_linear_teams_get_serialize( + authorization=authorization, + x_organization_id=x_organization_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '422': "HTTPValidationError", + } + 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_linear_teams_v1_linear_teams_get_with_http_info( + self, + authorization: Optional[Any] = None, + x_organization_id: Optional[Any] = 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[object]: + """Get Linear Teams + + Get Linear teams for the authenticated user's organization. Returns a list of all Linear teams that the authenticated user has access to within the specified organization. This endpoint is used to populate team selection dropdowns in repository settings. Rate limit: 60 requests per 30 seconds. + + :param authorization: + :type authorization: object + :param x_organization_id: + :type x_organization_id: 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._get_linear_teams_v1_linear_teams_get_serialize( + authorization=authorization, + x_organization_id=x_organization_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '422': "HTTPValidationError", + } + 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_linear_teams_v1_linear_teams_get_without_preload_content( + self, + authorization: Optional[Any] = None, + x_organization_id: Optional[Any] = 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 Linear Teams + + Get Linear teams for the authenticated user's organization. Returns a list of all Linear teams that the authenticated user has access to within the specified organization. This endpoint is used to populate team selection dropdowns in repository settings. Rate limit: 60 requests per 30 seconds. + + :param authorization: + :type authorization: object + :param x_organization_id: + :type x_organization_id: 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._get_linear_teams_v1_linear_teams_get_serialize( + authorization=authorization, + x_organization_id=x_organization_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_linear_teams_v1_linear_teams_get_serialize( + self, + authorization, + x_organization_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 + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + if x_organization_id is not None: + _header_params['X-Organization-Id'] = x_organization_id + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/linear/teams', + 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_linear_teams_v1_linear_teams_get_0( + self, + authorization: Optional[Any] = None, + x_organization_id: Optional[Any] = 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, + ) -> object: + """Get Linear Teams + + Get Linear teams for the authenticated user's organization. Returns a list of all Linear teams that the authenticated user has access to within the specified organization. This endpoint is used to populate team selection dropdowns in repository settings. Rate limit: 60 requests per 30 seconds. + + :param authorization: + :type authorization: object + :param x_organization_id: + :type x_organization_id: 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._get_linear_teams_v1_linear_teams_get_0_serialize( + authorization=authorization, + x_organization_id=x_organization_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '422': "HTTPValidationError", + } + 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_linear_teams_v1_linear_teams_get_0_with_http_info( + self, + authorization: Optional[Any] = None, + x_organization_id: Optional[Any] = 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[object]: + """Get Linear Teams + + Get Linear teams for the authenticated user's organization. Returns a list of all Linear teams that the authenticated user has access to within the specified organization. This endpoint is used to populate team selection dropdowns in repository settings. Rate limit: 60 requests per 30 seconds. + + :param authorization: + :type authorization: object + :param x_organization_id: + :type x_organization_id: 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._get_linear_teams_v1_linear_teams_get_0_serialize( + authorization=authorization, + x_organization_id=x_organization_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '422': "HTTPValidationError", + } + 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_linear_teams_v1_linear_teams_get_0_without_preload_content( + self, + authorization: Optional[Any] = None, + x_organization_id: Optional[Any] = 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 Linear Teams + + Get Linear teams for the authenticated user's organization. Returns a list of all Linear teams that the authenticated user has access to within the specified organization. This endpoint is used to populate team selection dropdowns in repository settings. Rate limit: 60 requests per 30 seconds. + + :param authorization: + :type authorization: object + :param x_organization_id: + :type x_organization_id: 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._get_linear_teams_v1_linear_teams_get_0_serialize( + authorization=authorization, + x_organization_id=x_organization_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_linear_teams_v1_linear_teams_get_0_serialize( + self, + authorization, + x_organization_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 + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + if x_organization_id is not None: + _header_params['X-Organization-Id'] = x_organization_id + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/linear/teams', + 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_linear_teams_v1_linear_teams_get_1( + self, + authorization: Optional[Any] = None, + x_organization_id: Optional[Any] = 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, + ) -> object: + """Get Linear Teams + + Get Linear teams for the authenticated user's organization. Returns a list of all Linear teams that the authenticated user has access to within the specified organization. This endpoint is used to populate team selection dropdowns in repository settings. Rate limit: 60 requests per 30 seconds. + + :param authorization: + :type authorization: object + :param x_organization_id: + :type x_organization_id: 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._get_linear_teams_v1_linear_teams_get_1_serialize( + authorization=authorization, + x_organization_id=x_organization_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '422': "HTTPValidationError", + } + 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_linear_teams_v1_linear_teams_get_1_with_http_info( + self, + authorization: Optional[Any] = None, + x_organization_id: Optional[Any] = 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[object]: + """Get Linear Teams + + Get Linear teams for the authenticated user's organization. Returns a list of all Linear teams that the authenticated user has access to within the specified organization. This endpoint is used to populate team selection dropdowns in repository settings. Rate limit: 60 requests per 30 seconds. + + :param authorization: + :type authorization: object + :param x_organization_id: + :type x_organization_id: 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._get_linear_teams_v1_linear_teams_get_1_serialize( + authorization=authorization, + x_organization_id=x_organization_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '422': "HTTPValidationError", + } + 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_linear_teams_v1_linear_teams_get_1_without_preload_content( + self, + authorization: Optional[Any] = None, + x_organization_id: Optional[Any] = 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 Linear Teams + + Get Linear teams for the authenticated user's organization. Returns a list of all Linear teams that the authenticated user has access to within the specified organization. This endpoint is used to populate team selection dropdowns in repository settings. Rate limit: 60 requests per 30 seconds. + + :param authorization: + :type authorization: object + :param x_organization_id: + :type x_organization_id: 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._get_linear_teams_v1_linear_teams_get_1_serialize( + authorization=authorization, + x_organization_id=x_organization_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "object", + '429': "APIRateLimitErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_linear_teams_v1_linear_teams_get_1_serialize( + self, + authorization, + x_organization_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 + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + if x_organization_id is not None: + _header_params['X-Organization-Id'] = x_organization_id + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/linear/teams', + 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/codegen_api_client/api/organizations_api.py b/codegen_api_client/api/organizations_api.py index c3f8f6a..7f530cb 100644 --- a/codegen_api_client/api/organizations_api.py +++ b/codegen_api_client/api/organizations_api.py @@ -60,7 +60,7 @@ def get_organizations_v1_organizations_get( ) -> PageOrganizationResponse: """Get Organizations - Get organizations for the authenticated user. Returns a paginated list of all organizations that the authenticated user is a member of. Results include basic organization details such as name, ID, and membership information. Use pagination parameters to control the number of results returned. + Get organizations for the authenticated user. Returns a paginated list of all organizations that the authenticated user is a member of. Results include basic organization details such as name, ID, and membership information. Use pagination parameters to control the number of results returned. Rate limit: 60 requests per 30 seconds. :param skip: :type skip: int @@ -102,8 +102,8 @@ def get_organizations_v1_organizations_get( _response_types_map: Dict[str, Optional[str]] = { '200': "PageOrganizationResponse", + '429': "APIRateLimitErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -137,7 +137,7 @@ def get_organizations_v1_organizations_get_with_http_info( ) -> ApiResponse[PageOrganizationResponse]: """Get Organizations - Get organizations for the authenticated user. Returns a paginated list of all organizations that the authenticated user is a member of. Results include basic organization details such as name, ID, and membership information. Use pagination parameters to control the number of results returned. + Get organizations for the authenticated user. Returns a paginated list of all organizations that the authenticated user is a member of. Results include basic organization details such as name, ID, and membership information. Use pagination parameters to control the number of results returned. Rate limit: 60 requests per 30 seconds. :param skip: :type skip: int @@ -179,8 +179,8 @@ def get_organizations_v1_organizations_get_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "PageOrganizationResponse", + '429': "APIRateLimitErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -214,7 +214,7 @@ def get_organizations_v1_organizations_get_without_preload_content( ) -> RESTResponseType: """Get Organizations - Get organizations for the authenticated user. Returns a paginated list of all organizations that the authenticated user is a member of. Results include basic organization details such as name, ID, and membership information. Use pagination parameters to control the number of results returned. + Get organizations for the authenticated user. Returns a paginated list of all organizations that the authenticated user is a member of. Results include basic organization details such as name, ID, and membership information. Use pagination parameters to control the number of results returned. Rate limit: 60 requests per 30 seconds. :param skip: :type skip: int @@ -256,8 +256,8 @@ def get_organizations_v1_organizations_get_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "PageOrganizationResponse", + '429': "APIRateLimitErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -360,7 +360,7 @@ def get_organizations_v1_organizations_get_0( ) -> PageOrganizationResponse: """Get Organizations - Get organizations for the authenticated user. Returns a paginated list of all organizations that the authenticated user is a member of. Results include basic organization details such as name, ID, and membership information. Use pagination parameters to control the number of results returned. + Get organizations for the authenticated user. Returns a paginated list of all organizations that the authenticated user is a member of. Results include basic organization details such as name, ID, and membership information. Use pagination parameters to control the number of results returned. Rate limit: 60 requests per 30 seconds. :param skip: :type skip: int @@ -402,8 +402,8 @@ def get_organizations_v1_organizations_get_0( _response_types_map: Dict[str, Optional[str]] = { '200': "PageOrganizationResponse", + '429': "APIRateLimitErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -437,7 +437,7 @@ def get_organizations_v1_organizations_get_0_with_http_info( ) -> ApiResponse[PageOrganizationResponse]: """Get Organizations - Get organizations for the authenticated user. Returns a paginated list of all organizations that the authenticated user is a member of. Results include basic organization details such as name, ID, and membership information. Use pagination parameters to control the number of results returned. + Get organizations for the authenticated user. Returns a paginated list of all organizations that the authenticated user is a member of. Results include basic organization details such as name, ID, and membership information. Use pagination parameters to control the number of results returned. Rate limit: 60 requests per 30 seconds. :param skip: :type skip: int @@ -479,8 +479,8 @@ def get_organizations_v1_organizations_get_0_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "PageOrganizationResponse", + '429': "APIRateLimitErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -514,7 +514,7 @@ def get_organizations_v1_organizations_get_0_without_preload_content( ) -> RESTResponseType: """Get Organizations - Get organizations for the authenticated user. Returns a paginated list of all organizations that the authenticated user is a member of. Results include basic organization details such as name, ID, and membership information. Use pagination parameters to control the number of results returned. + Get organizations for the authenticated user. Returns a paginated list of all organizations that the authenticated user is a member of. Results include basic organization details such as name, ID, and membership information. Use pagination parameters to control the number of results returned. Rate limit: 60 requests per 30 seconds. :param skip: :type skip: int @@ -556,8 +556,8 @@ def get_organizations_v1_organizations_get_0_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "PageOrganizationResponse", + '429': "APIRateLimitErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -660,7 +660,7 @@ def get_organizations_v1_organizations_get_1( ) -> PageOrganizationResponse: """Get Organizations - Get organizations for the authenticated user. Returns a paginated list of all organizations that the authenticated user is a member of. Results include basic organization details such as name, ID, and membership information. Use pagination parameters to control the number of results returned. + Get organizations for the authenticated user. Returns a paginated list of all organizations that the authenticated user is a member of. Results include basic organization details such as name, ID, and membership information. Use pagination parameters to control the number of results returned. Rate limit: 60 requests per 30 seconds. :param skip: :type skip: int @@ -702,8 +702,8 @@ def get_organizations_v1_organizations_get_1( _response_types_map: Dict[str, Optional[str]] = { '200': "PageOrganizationResponse", + '429': "APIRateLimitErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -737,7 +737,7 @@ def get_organizations_v1_organizations_get_1_with_http_info( ) -> ApiResponse[PageOrganizationResponse]: """Get Organizations - Get organizations for the authenticated user. Returns a paginated list of all organizations that the authenticated user is a member of. Results include basic organization details such as name, ID, and membership information. Use pagination parameters to control the number of results returned. + Get organizations for the authenticated user. Returns a paginated list of all organizations that the authenticated user is a member of. Results include basic organization details such as name, ID, and membership information. Use pagination parameters to control the number of results returned. Rate limit: 60 requests per 30 seconds. :param skip: :type skip: int @@ -779,8 +779,8 @@ def get_organizations_v1_organizations_get_1_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "PageOrganizationResponse", + '429': "APIRateLimitErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -814,7 +814,7 @@ def get_organizations_v1_organizations_get_1_without_preload_content( ) -> RESTResponseType: """Get Organizations - Get organizations for the authenticated user. Returns a paginated list of all organizations that the authenticated user is a member of. Results include basic organization details such as name, ID, and membership information. Use pagination parameters to control the number of results returned. + Get organizations for the authenticated user. Returns a paginated list of all organizations that the authenticated user is a member of. Results include basic organization details such as name, ID, and membership information. Use pagination parameters to control the number of results returned. Rate limit: 60 requests per 30 seconds. :param skip: :type skip: int @@ -856,8 +856,8 @@ def get_organizations_v1_organizations_get_1_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "PageOrganizationResponse", + '429': "APIRateLimitErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, diff --git a/codegen_api_client/api/repositories_api.py b/codegen_api_client/api/repositories_api.py new file mode 100644 index 0000000..2db7f43 --- /dev/null +++ b/codegen_api_client/api/repositories_api.py @@ -0,0 +1,3708 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + 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 +from typing import Any, Optional +from typing_extensions import Annotated +from codegen_api_client.models.check_suite_retry_stats_response import CheckSuiteRetryStatsResponse +from codegen_api_client.models.check_suite_settings_response import CheckSuiteSettingsResponse +from codegen_api_client.models.page_repo_response import PageRepoResponse +from codegen_api_client.models.update_check_suite_settings_request import UpdateCheckSuiteSettingsRequest + +from codegen_api_client.api_client import ApiClient, RequestSerialized +from codegen_api_client.api_response import ApiResponse +from codegen_api_client.rest import RESTResponseType + + +class RepositoriesApi: + """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_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get( + self, + org_id: StrictInt, + repo_id: StrictInt, + authorization: Optional[Any] = 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, + ) -> CheckSuiteRetryStatsResponse: + """Get Check Suite Retry Stats + + Get check suite retry statistics for a repository. Returns comprehensive statistics about check suite orchestrations and retry attempts: - Total, active, completed, and failed orchestrations - Total retry attempts across all checks - Number of checks that have reached their retry limit Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: (required) + :type repo_id: int + :param authorization: + :type authorization: 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._get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_serialize( + org_id=org_id, + repo_id=repo_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckSuiteRetryStatsResponse", + '422': "HTTPValidationError", + } + 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_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_with_http_info( + self, + org_id: StrictInt, + repo_id: StrictInt, + authorization: Optional[Any] = 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[CheckSuiteRetryStatsResponse]: + """Get Check Suite Retry Stats + + Get check suite retry statistics for a repository. Returns comprehensive statistics about check suite orchestrations and retry attempts: - Total, active, completed, and failed orchestrations - Total retry attempts across all checks - Number of checks that have reached their retry limit Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: (required) + :type repo_id: int + :param authorization: + :type authorization: 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._get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_serialize( + org_id=org_id, + repo_id=repo_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckSuiteRetryStatsResponse", + '422': "HTTPValidationError", + } + 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_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_without_preload_content( + self, + org_id: StrictInt, + repo_id: StrictInt, + authorization: Optional[Any] = 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 Check Suite Retry Stats + + Get check suite retry statistics for a repository. Returns comprehensive statistics about check suite orchestrations and retry attempts: - Total, active, completed, and failed orchestrations - Total retry attempts across all checks - Number of checks that have reached their retry limit Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: (required) + :type repo_id: int + :param authorization: + :type authorization: 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._get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_serialize( + org_id=org_id, + repo_id=repo_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckSuiteRetryStatsResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_serialize( + self, + org_id, + repo_id, + authorization, + _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 org_id is not None: + _path_params['org_id'] = org_id + if repo_id is not None: + _path_params['repo_id'] = repo_id + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/organizations/{org_id}/repos/{repo_id}/check-suite/stats', + 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_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_0( + self, + org_id: StrictInt, + repo_id: StrictInt, + authorization: Optional[Any] = 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, + ) -> CheckSuiteRetryStatsResponse: + """Get Check Suite Retry Stats + + Get check suite retry statistics for a repository. Returns comprehensive statistics about check suite orchestrations and retry attempts: - Total, active, completed, and failed orchestrations - Total retry attempts across all checks - Number of checks that have reached their retry limit Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: (required) + :type repo_id: int + :param authorization: + :type authorization: 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._get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_0_serialize( + org_id=org_id, + repo_id=repo_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckSuiteRetryStatsResponse", + '422': "HTTPValidationError", + } + 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_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_0_with_http_info( + self, + org_id: StrictInt, + repo_id: StrictInt, + authorization: Optional[Any] = 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[CheckSuiteRetryStatsResponse]: + """Get Check Suite Retry Stats + + Get check suite retry statistics for a repository. Returns comprehensive statistics about check suite orchestrations and retry attempts: - Total, active, completed, and failed orchestrations - Total retry attempts across all checks - Number of checks that have reached their retry limit Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: (required) + :type repo_id: int + :param authorization: + :type authorization: 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._get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_0_serialize( + org_id=org_id, + repo_id=repo_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckSuiteRetryStatsResponse", + '422': "HTTPValidationError", + } + 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_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_0_without_preload_content( + self, + org_id: StrictInt, + repo_id: StrictInt, + authorization: Optional[Any] = 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 Check Suite Retry Stats + + Get check suite retry statistics for a repository. Returns comprehensive statistics about check suite orchestrations and retry attempts: - Total, active, completed, and failed orchestrations - Total retry attempts across all checks - Number of checks that have reached their retry limit Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: (required) + :type repo_id: int + :param authorization: + :type authorization: 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._get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_0_serialize( + org_id=org_id, + repo_id=repo_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckSuiteRetryStatsResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_0_serialize( + self, + org_id, + repo_id, + authorization, + _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 org_id is not None: + _path_params['org_id'] = org_id + if repo_id is not None: + _path_params['repo_id'] = repo_id + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/organizations/{org_id}/repos/{repo_id}/check-suite/stats', + 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_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_1( + self, + org_id: StrictInt, + repo_id: StrictInt, + authorization: Optional[Any] = 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, + ) -> CheckSuiteRetryStatsResponse: + """Get Check Suite Retry Stats + + Get check suite retry statistics for a repository. Returns comprehensive statistics about check suite orchestrations and retry attempts: - Total, active, completed, and failed orchestrations - Total retry attempts across all checks - Number of checks that have reached their retry limit Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: (required) + :type repo_id: int + :param authorization: + :type authorization: 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._get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_1_serialize( + org_id=org_id, + repo_id=repo_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckSuiteRetryStatsResponse", + '422': "HTTPValidationError", + } + 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_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_1_with_http_info( + self, + org_id: StrictInt, + repo_id: StrictInt, + authorization: Optional[Any] = 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[CheckSuiteRetryStatsResponse]: + """Get Check Suite Retry Stats + + Get check suite retry statistics for a repository. Returns comprehensive statistics about check suite orchestrations and retry attempts: - Total, active, completed, and failed orchestrations - Total retry attempts across all checks - Number of checks that have reached their retry limit Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: (required) + :type repo_id: int + :param authorization: + :type authorization: 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._get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_1_serialize( + org_id=org_id, + repo_id=repo_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckSuiteRetryStatsResponse", + '422': "HTTPValidationError", + } + 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_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_1_without_preload_content( + self, + org_id: StrictInt, + repo_id: StrictInt, + authorization: Optional[Any] = 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 Check Suite Retry Stats + + Get check suite retry statistics for a repository. Returns comprehensive statistics about check suite orchestrations and retry attempts: - Total, active, completed, and failed orchestrations - Total retry attempts across all checks - Number of checks that have reached their retry limit Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: (required) + :type repo_id: int + :param authorization: + :type authorization: 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._get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_1_serialize( + org_id=org_id, + repo_id=repo_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckSuiteRetryStatsResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_1_serialize( + self, + org_id, + repo_id, + authorization, + _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 org_id is not None: + _path_params['org_id'] = org_id + if repo_id is not None: + _path_params['repo_id'] = repo_id + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/organizations/{org_id}/repos/{repo_id}/check-suite/stats', + 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_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get( + self, + org_id: StrictInt, + repo_id: StrictInt, + authorization: Optional[Any] = 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, + ) -> CheckSuiteSettingsResponse: + """Get Check Suite Settings + + Get check suite retry settings for a repository. Returns the current configuration for check suite retry logic including: - retry_count: Maximum number of retry attempts per failed check - ignored_checks: List of check names that should be ignored Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: (required) + :type repo_id: int + :param authorization: + :type authorization: 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._get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_serialize( + org_id=org_id, + repo_id=repo_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckSuiteSettingsResponse", + '422': "HTTPValidationError", + } + 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_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_with_http_info( + self, + org_id: StrictInt, + repo_id: StrictInt, + authorization: Optional[Any] = 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[CheckSuiteSettingsResponse]: + """Get Check Suite Settings + + Get check suite retry settings for a repository. Returns the current configuration for check suite retry logic including: - retry_count: Maximum number of retry attempts per failed check - ignored_checks: List of check names that should be ignored Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: (required) + :type repo_id: int + :param authorization: + :type authorization: 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._get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_serialize( + org_id=org_id, + repo_id=repo_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckSuiteSettingsResponse", + '422': "HTTPValidationError", + } + 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_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_without_preload_content( + self, + org_id: StrictInt, + repo_id: StrictInt, + authorization: Optional[Any] = 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 Check Suite Settings + + Get check suite retry settings for a repository. Returns the current configuration for check suite retry logic including: - retry_count: Maximum number of retry attempts per failed check - ignored_checks: List of check names that should be ignored Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: (required) + :type repo_id: int + :param authorization: + :type authorization: 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._get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_serialize( + org_id=org_id, + repo_id=repo_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckSuiteSettingsResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_serialize( + self, + org_id, + repo_id, + authorization, + _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 org_id is not None: + _path_params['org_id'] = org_id + if repo_id is not None: + _path_params['repo_id'] = repo_id + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/organizations/{org_id}/repos/{repo_id}/check-suite/settings', + 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_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_0( + self, + org_id: StrictInt, + repo_id: StrictInt, + authorization: Optional[Any] = 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, + ) -> CheckSuiteSettingsResponse: + """Get Check Suite Settings + + Get check suite retry settings for a repository. Returns the current configuration for check suite retry logic including: - retry_count: Maximum number of retry attempts per failed check - ignored_checks: List of check names that should be ignored Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: (required) + :type repo_id: int + :param authorization: + :type authorization: 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._get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_0_serialize( + org_id=org_id, + repo_id=repo_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckSuiteSettingsResponse", + '422': "HTTPValidationError", + } + 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_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_0_with_http_info( + self, + org_id: StrictInt, + repo_id: StrictInt, + authorization: Optional[Any] = 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[CheckSuiteSettingsResponse]: + """Get Check Suite Settings + + Get check suite retry settings for a repository. Returns the current configuration for check suite retry logic including: - retry_count: Maximum number of retry attempts per failed check - ignored_checks: List of check names that should be ignored Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: (required) + :type repo_id: int + :param authorization: + :type authorization: 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._get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_0_serialize( + org_id=org_id, + repo_id=repo_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckSuiteSettingsResponse", + '422': "HTTPValidationError", + } + 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_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_0_without_preload_content( + self, + org_id: StrictInt, + repo_id: StrictInt, + authorization: Optional[Any] = 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 Check Suite Settings + + Get check suite retry settings for a repository. Returns the current configuration for check suite retry logic including: - retry_count: Maximum number of retry attempts per failed check - ignored_checks: List of check names that should be ignored Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: (required) + :type repo_id: int + :param authorization: + :type authorization: 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._get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_0_serialize( + org_id=org_id, + repo_id=repo_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckSuiteSettingsResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_0_serialize( + self, + org_id, + repo_id, + authorization, + _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 org_id is not None: + _path_params['org_id'] = org_id + if repo_id is not None: + _path_params['repo_id'] = repo_id + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/organizations/{org_id}/repos/{repo_id}/check-suite/settings', + 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_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_1( + self, + org_id: StrictInt, + repo_id: StrictInt, + authorization: Optional[Any] = 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, + ) -> CheckSuiteSettingsResponse: + """Get Check Suite Settings + + Get check suite retry settings for a repository. Returns the current configuration for check suite retry logic including: - retry_count: Maximum number of retry attempts per failed check - ignored_checks: List of check names that should be ignored Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: (required) + :type repo_id: int + :param authorization: + :type authorization: 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._get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_1_serialize( + org_id=org_id, + repo_id=repo_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckSuiteSettingsResponse", + '422': "HTTPValidationError", + } + 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_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_1_with_http_info( + self, + org_id: StrictInt, + repo_id: StrictInt, + authorization: Optional[Any] = 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[CheckSuiteSettingsResponse]: + """Get Check Suite Settings + + Get check suite retry settings for a repository. Returns the current configuration for check suite retry logic including: - retry_count: Maximum number of retry attempts per failed check - ignored_checks: List of check names that should be ignored Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: (required) + :type repo_id: int + :param authorization: + :type authorization: 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._get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_1_serialize( + org_id=org_id, + repo_id=repo_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckSuiteSettingsResponse", + '422': "HTTPValidationError", + } + 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_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_1_without_preload_content( + self, + org_id: StrictInt, + repo_id: StrictInt, + authorization: Optional[Any] = 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 Check Suite Settings + + Get check suite retry settings for a repository. Returns the current configuration for check suite retry logic including: - retry_count: Maximum number of retry attempts per failed check - ignored_checks: List of check names that should be ignored Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: (required) + :type repo_id: int + :param authorization: + :type authorization: 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._get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_1_serialize( + org_id=org_id, + repo_id=repo_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckSuiteSettingsResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_1_serialize( + self, + org_id, + repo_id, + authorization, + _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 org_id is not None: + _path_params['org_id'] = org_id + if repo_id is not None: + _path_params['repo_id'] = repo_id + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/organizations/{org_id}/repos/{repo_id}/check-suite/settings', + 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_v1_organizations_org_id_repos_get( + self, + org_id: StrictInt, + skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + authorization: Optional[Any] = 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, + ) -> PageRepoResponse: + """Get Repositories + + Get repositories for the specified organization. Returns a paginated list of all repositories that belong to the specified organization. Results include repository details such as name, ID, description, visibility, and setup status. Use pagination parameters to control the number of results returned. Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param skip: + :type skip: int + :param limit: + :type limit: int + :param authorization: + :type authorization: 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._get_repositories_v1_organizations_org_id_repos_get_serialize( + org_id=org_id, + skip=skip, + limit=limit, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PageRepoResponse", + '429': "APIRateLimitErrorResponse", + '422': "HTTPValidationError", + } + 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_v1_organizations_org_id_repos_get_with_http_info( + self, + org_id: StrictInt, + skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + authorization: Optional[Any] = 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[PageRepoResponse]: + """Get Repositories + + Get repositories for the specified organization. Returns a paginated list of all repositories that belong to the specified organization. Results include repository details such as name, ID, description, visibility, and setup status. Use pagination parameters to control the number of results returned. Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param skip: + :type skip: int + :param limit: + :type limit: int + :param authorization: + :type authorization: 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._get_repositories_v1_organizations_org_id_repos_get_serialize( + org_id=org_id, + skip=skip, + limit=limit, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PageRepoResponse", + '429': "APIRateLimitErrorResponse", + '422': "HTTPValidationError", + } + 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_v1_organizations_org_id_repos_get_without_preload_content( + self, + org_id: StrictInt, + skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + authorization: Optional[Any] = 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 Repositories + + Get repositories for the specified organization. Returns a paginated list of all repositories that belong to the specified organization. Results include repository details such as name, ID, description, visibility, and setup status. Use pagination parameters to control the number of results returned. Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param skip: + :type skip: int + :param limit: + :type limit: int + :param authorization: + :type authorization: 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._get_repositories_v1_organizations_org_id_repos_get_serialize( + org_id=org_id, + skip=skip, + limit=limit, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PageRepoResponse", + '429': "APIRateLimitErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_repositories_v1_organizations_org_id_repos_get_serialize( + self, + org_id, + skip, + limit, + authorization, + _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 org_id is not None: + _path_params['org_id'] = org_id + # process the query parameters + if skip is not None: + + _query_params.append(('skip', skip)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/organizations/{org_id}/repos', + 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_v1_organizations_org_id_repos_get_0( + self, + org_id: StrictInt, + skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + authorization: Optional[Any] = 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, + ) -> PageRepoResponse: + """Get Repositories + + Get repositories for the specified organization. Returns a paginated list of all repositories that belong to the specified organization. Results include repository details such as name, ID, description, visibility, and setup status. Use pagination parameters to control the number of results returned. Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param skip: + :type skip: int + :param limit: + :type limit: int + :param authorization: + :type authorization: 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._get_repositories_v1_organizations_org_id_repos_get_0_serialize( + org_id=org_id, + skip=skip, + limit=limit, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PageRepoResponse", + '429': "APIRateLimitErrorResponse", + '422': "HTTPValidationError", + } + 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_v1_organizations_org_id_repos_get_0_with_http_info( + self, + org_id: StrictInt, + skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + authorization: Optional[Any] = 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[PageRepoResponse]: + """Get Repositories + + Get repositories for the specified organization. Returns a paginated list of all repositories that belong to the specified organization. Results include repository details such as name, ID, description, visibility, and setup status. Use pagination parameters to control the number of results returned. Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param skip: + :type skip: int + :param limit: + :type limit: int + :param authorization: + :type authorization: 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._get_repositories_v1_organizations_org_id_repos_get_0_serialize( + org_id=org_id, + skip=skip, + limit=limit, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PageRepoResponse", + '429': "APIRateLimitErrorResponse", + '422': "HTTPValidationError", + } + 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_v1_organizations_org_id_repos_get_0_without_preload_content( + self, + org_id: StrictInt, + skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + authorization: Optional[Any] = 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 Repositories + + Get repositories for the specified organization. Returns a paginated list of all repositories that belong to the specified organization. Results include repository details such as name, ID, description, visibility, and setup status. Use pagination parameters to control the number of results returned. Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param skip: + :type skip: int + :param limit: + :type limit: int + :param authorization: + :type authorization: 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._get_repositories_v1_organizations_org_id_repos_get_0_serialize( + org_id=org_id, + skip=skip, + limit=limit, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PageRepoResponse", + '429': "APIRateLimitErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_repositories_v1_organizations_org_id_repos_get_0_serialize( + self, + org_id, + skip, + limit, + authorization, + _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 org_id is not None: + _path_params['org_id'] = org_id + # process the query parameters + if skip is not None: + + _query_params.append(('skip', skip)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/organizations/{org_id}/repos', + 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_v1_organizations_org_id_repos_get_1( + self, + org_id: StrictInt, + skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + authorization: Optional[Any] = 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, + ) -> PageRepoResponse: + """Get Repositories + + Get repositories for the specified organization. Returns a paginated list of all repositories that belong to the specified organization. Results include repository details such as name, ID, description, visibility, and setup status. Use pagination parameters to control the number of results returned. Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param skip: + :type skip: int + :param limit: + :type limit: int + :param authorization: + :type authorization: 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._get_repositories_v1_organizations_org_id_repos_get_1_serialize( + org_id=org_id, + skip=skip, + limit=limit, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PageRepoResponse", + '429': "APIRateLimitErrorResponse", + '422': "HTTPValidationError", + } + 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_v1_organizations_org_id_repos_get_1_with_http_info( + self, + org_id: StrictInt, + skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + authorization: Optional[Any] = 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[PageRepoResponse]: + """Get Repositories + + Get repositories for the specified organization. Returns a paginated list of all repositories that belong to the specified organization. Results include repository details such as name, ID, description, visibility, and setup status. Use pagination parameters to control the number of results returned. Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param skip: + :type skip: int + :param limit: + :type limit: int + :param authorization: + :type authorization: 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._get_repositories_v1_organizations_org_id_repos_get_1_serialize( + org_id=org_id, + skip=skip, + limit=limit, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PageRepoResponse", + '429': "APIRateLimitErrorResponse", + '422': "HTTPValidationError", + } + 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_v1_organizations_org_id_repos_get_1_without_preload_content( + self, + org_id: StrictInt, + skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + authorization: Optional[Any] = 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 Repositories + + Get repositories for the specified organization. Returns a paginated list of all repositories that belong to the specified organization. Results include repository details such as name, ID, description, visibility, and setup status. Use pagination parameters to control the number of results returned. Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param skip: + :type skip: int + :param limit: + :type limit: int + :param authorization: + :type authorization: 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._get_repositories_v1_organizations_org_id_repos_get_1_serialize( + org_id=org_id, + skip=skip, + limit=limit, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PageRepoResponse", + '429': "APIRateLimitErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_repositories_v1_organizations_org_id_repos_get_1_serialize( + self, + org_id, + skip, + limit, + authorization, + _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 org_id is not None: + _path_params['org_id'] = org_id + # process the query parameters + if skip is not None: + + _query_params.append(('skip', skip)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/organizations/{org_id}/repos', + 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 update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put( + self, + org_id: StrictInt, + repo_id: StrictInt, + update_check_suite_settings_request: UpdateCheckSuiteSettingsRequest, + authorization: Optional[Any] = 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, + ) -> CheckSuiteSettingsResponse: + """Update Check Suite Settings + + Update check suite retry settings for a repository. Updates the configuration for check suite retry logic. You can update: - retry_count: Maximum number of retry attempts per failed check (0-10) - ignored_checks: List of check names that should be ignored Rate limit: 30 requests per 60 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: (required) + :type repo_id: int + :param update_check_suite_settings_request: (required) + :type update_check_suite_settings_request: UpdateCheckSuiteSettingsRequest + :param authorization: + :type authorization: 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._update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_serialize( + org_id=org_id, + repo_id=repo_id, + update_check_suite_settings_request=update_check_suite_settings_request, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckSuiteSettingsResponse", + '422': "HTTPValidationError", + } + 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 update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_with_http_info( + self, + org_id: StrictInt, + repo_id: StrictInt, + update_check_suite_settings_request: UpdateCheckSuiteSettingsRequest, + authorization: Optional[Any] = 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[CheckSuiteSettingsResponse]: + """Update Check Suite Settings + + Update check suite retry settings for a repository. Updates the configuration for check suite retry logic. You can update: - retry_count: Maximum number of retry attempts per failed check (0-10) - ignored_checks: List of check names that should be ignored Rate limit: 30 requests per 60 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: (required) + :type repo_id: int + :param update_check_suite_settings_request: (required) + :type update_check_suite_settings_request: UpdateCheckSuiteSettingsRequest + :param authorization: + :type authorization: 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._update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_serialize( + org_id=org_id, + repo_id=repo_id, + update_check_suite_settings_request=update_check_suite_settings_request, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckSuiteSettingsResponse", + '422': "HTTPValidationError", + } + 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 update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_without_preload_content( + self, + org_id: StrictInt, + repo_id: StrictInt, + update_check_suite_settings_request: UpdateCheckSuiteSettingsRequest, + authorization: Optional[Any] = 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: + """Update Check Suite Settings + + Update check suite retry settings for a repository. Updates the configuration for check suite retry logic. You can update: - retry_count: Maximum number of retry attempts per failed check (0-10) - ignored_checks: List of check names that should be ignored Rate limit: 30 requests per 60 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: (required) + :type repo_id: int + :param update_check_suite_settings_request: (required) + :type update_check_suite_settings_request: UpdateCheckSuiteSettingsRequest + :param authorization: + :type authorization: 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._update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_serialize( + org_id=org_id, + repo_id=repo_id, + update_check_suite_settings_request=update_check_suite_settings_request, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckSuiteSettingsResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_serialize( + self, + org_id, + repo_id, + update_check_suite_settings_request, + authorization, + _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 org_id is not None: + _path_params['org_id'] = org_id + if repo_id is not None: + _path_params['repo_id'] = repo_id + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # process the form parameters + # process the body parameter + if update_check_suite_settings_request is not None: + _body_params = update_check_suite_settings_request + + + # 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] = [ + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/v1/organizations/{org_id}/repos/{repo_id}/check-suite/settings', + 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 update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_0( + self, + org_id: StrictInt, + repo_id: StrictInt, + update_check_suite_settings_request: UpdateCheckSuiteSettingsRequest, + authorization: Optional[Any] = 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, + ) -> CheckSuiteSettingsResponse: + """Update Check Suite Settings + + Update check suite retry settings for a repository. Updates the configuration for check suite retry logic. You can update: - retry_count: Maximum number of retry attempts per failed check (0-10) - ignored_checks: List of check names that should be ignored Rate limit: 30 requests per 60 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: (required) + :type repo_id: int + :param update_check_suite_settings_request: (required) + :type update_check_suite_settings_request: UpdateCheckSuiteSettingsRequest + :param authorization: + :type authorization: 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._update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_0_serialize( + org_id=org_id, + repo_id=repo_id, + update_check_suite_settings_request=update_check_suite_settings_request, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckSuiteSettingsResponse", + '422': "HTTPValidationError", + } + 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 update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_0_with_http_info( + self, + org_id: StrictInt, + repo_id: StrictInt, + update_check_suite_settings_request: UpdateCheckSuiteSettingsRequest, + authorization: Optional[Any] = 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[CheckSuiteSettingsResponse]: + """Update Check Suite Settings + + Update check suite retry settings for a repository. Updates the configuration for check suite retry logic. You can update: - retry_count: Maximum number of retry attempts per failed check (0-10) - ignored_checks: List of check names that should be ignored Rate limit: 30 requests per 60 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: (required) + :type repo_id: int + :param update_check_suite_settings_request: (required) + :type update_check_suite_settings_request: UpdateCheckSuiteSettingsRequest + :param authorization: + :type authorization: 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._update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_0_serialize( + org_id=org_id, + repo_id=repo_id, + update_check_suite_settings_request=update_check_suite_settings_request, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckSuiteSettingsResponse", + '422': "HTTPValidationError", + } + 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 update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_0_without_preload_content( + self, + org_id: StrictInt, + repo_id: StrictInt, + update_check_suite_settings_request: UpdateCheckSuiteSettingsRequest, + authorization: Optional[Any] = 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: + """Update Check Suite Settings + + Update check suite retry settings for a repository. Updates the configuration for check suite retry logic. You can update: - retry_count: Maximum number of retry attempts per failed check (0-10) - ignored_checks: List of check names that should be ignored Rate limit: 30 requests per 60 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: (required) + :type repo_id: int + :param update_check_suite_settings_request: (required) + :type update_check_suite_settings_request: UpdateCheckSuiteSettingsRequest + :param authorization: + :type authorization: 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._update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_0_serialize( + org_id=org_id, + repo_id=repo_id, + update_check_suite_settings_request=update_check_suite_settings_request, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckSuiteSettingsResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_0_serialize( + self, + org_id, + repo_id, + update_check_suite_settings_request, + authorization, + _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 org_id is not None: + _path_params['org_id'] = org_id + if repo_id is not None: + _path_params['repo_id'] = repo_id + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # process the form parameters + # process the body parameter + if update_check_suite_settings_request is not None: + _body_params = update_check_suite_settings_request + + + # 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] = [ + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/v1/organizations/{org_id}/repos/{repo_id}/check-suite/settings', + 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 update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_1( + self, + org_id: StrictInt, + repo_id: StrictInt, + update_check_suite_settings_request: UpdateCheckSuiteSettingsRequest, + authorization: Optional[Any] = 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, + ) -> CheckSuiteSettingsResponse: + """Update Check Suite Settings + + Update check suite retry settings for a repository. Updates the configuration for check suite retry logic. You can update: - retry_count: Maximum number of retry attempts per failed check (0-10) - ignored_checks: List of check names that should be ignored Rate limit: 30 requests per 60 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: (required) + :type repo_id: int + :param update_check_suite_settings_request: (required) + :type update_check_suite_settings_request: UpdateCheckSuiteSettingsRequest + :param authorization: + :type authorization: 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._update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_1_serialize( + org_id=org_id, + repo_id=repo_id, + update_check_suite_settings_request=update_check_suite_settings_request, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckSuiteSettingsResponse", + '422': "HTTPValidationError", + } + 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 update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_1_with_http_info( + self, + org_id: StrictInt, + repo_id: StrictInt, + update_check_suite_settings_request: UpdateCheckSuiteSettingsRequest, + authorization: Optional[Any] = 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[CheckSuiteSettingsResponse]: + """Update Check Suite Settings + + Update check suite retry settings for a repository. Updates the configuration for check suite retry logic. You can update: - retry_count: Maximum number of retry attempts per failed check (0-10) - ignored_checks: List of check names that should be ignored Rate limit: 30 requests per 60 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: (required) + :type repo_id: int + :param update_check_suite_settings_request: (required) + :type update_check_suite_settings_request: UpdateCheckSuiteSettingsRequest + :param authorization: + :type authorization: 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._update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_1_serialize( + org_id=org_id, + repo_id=repo_id, + update_check_suite_settings_request=update_check_suite_settings_request, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckSuiteSettingsResponse", + '422': "HTTPValidationError", + } + 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 update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_1_without_preload_content( + self, + org_id: StrictInt, + repo_id: StrictInt, + update_check_suite_settings_request: UpdateCheckSuiteSettingsRequest, + authorization: Optional[Any] = 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: + """Update Check Suite Settings + + Update check suite retry settings for a repository. Updates the configuration for check suite retry logic. You can update: - retry_count: Maximum number of retry attempts per failed check (0-10) - ignored_checks: List of check names that should be ignored Rate limit: 30 requests per 60 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: (required) + :type repo_id: int + :param update_check_suite_settings_request: (required) + :type update_check_suite_settings_request: UpdateCheckSuiteSettingsRequest + :param authorization: + :type authorization: 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._update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_1_serialize( + org_id=org_id, + repo_id=repo_id, + update_check_suite_settings_request=update_check_suite_settings_request, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CheckSuiteSettingsResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_1_serialize( + self, + org_id, + repo_id, + update_check_suite_settings_request, + authorization, + _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 org_id is not None: + _path_params['org_id'] = org_id + if repo_id is not None: + _path_params['repo_id'] = repo_id + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # process the form parameters + # process the body parameter + if update_check_suite_settings_request is not None: + _body_params = update_check_suite_settings_request + + + # 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] = [ + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/v1/organizations/{org_id}/repos/{repo_id}/check-suite/settings', + 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/codegen_api_client/api/tools_api.py b/codegen_api_client/api/tools_api.py new file mode 100644 index 0000000..98b1903 --- /dev/null +++ b/codegen_api_client/api/tools_api.py @@ -0,0 +1,1879 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + 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 +from typing import Any, Dict, Optional +from typing_extensions import Annotated +from codegen_api_client.models.tool_execution_request import ToolExecutionRequest +from codegen_api_client.models.tool_execution_response import ToolExecutionResponse + +from codegen_api_client.api_client import ApiClient, RequestSerialized +from codegen_api_client.api_response import ApiResponse +from codegen_api_client.rest import RESTResponseType + + +class ToolsApi: + """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 execute_tool_v1_organizations_org_id_tools_execute_post( + self, + org_id: StrictInt, + tool_execution_request: ToolExecutionRequest, + authorization: Optional[Any] = 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, + ) -> ToolExecutionResponse: + """Execute Tool + + Execute a specific tool with the provided arguments. This endpoint allows direct execution of available tools by providing the tool name and arguments as JSON. The tool will be executed in the context of the authenticated user's organization and permissions. The tool execution happens with the same permissions and context as if the tool were called by an agent, ensuring proper security and access control. Rate limit: 30 requests per minute. + + :param org_id: (required) + :type org_id: int + :param tool_execution_request: (required) + :type tool_execution_request: ToolExecutionRequest + :param authorization: + :type authorization: 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._execute_tool_v1_organizations_org_id_tools_execute_post_serialize( + org_id=org_id, + tool_execution_request=tool_execution_request, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ToolExecutionResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + 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 execute_tool_v1_organizations_org_id_tools_execute_post_with_http_info( + self, + org_id: StrictInt, + tool_execution_request: ToolExecutionRequest, + authorization: Optional[Any] = 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[ToolExecutionResponse]: + """Execute Tool + + Execute a specific tool with the provided arguments. This endpoint allows direct execution of available tools by providing the tool name and arguments as JSON. The tool will be executed in the context of the authenticated user's organization and permissions. The tool execution happens with the same permissions and context as if the tool were called by an agent, ensuring proper security and access control. Rate limit: 30 requests per minute. + + :param org_id: (required) + :type org_id: int + :param tool_execution_request: (required) + :type tool_execution_request: ToolExecutionRequest + :param authorization: + :type authorization: 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._execute_tool_v1_organizations_org_id_tools_execute_post_serialize( + org_id=org_id, + tool_execution_request=tool_execution_request, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ToolExecutionResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + 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 execute_tool_v1_organizations_org_id_tools_execute_post_without_preload_content( + self, + org_id: StrictInt, + tool_execution_request: ToolExecutionRequest, + authorization: Optional[Any] = 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: + """Execute Tool + + Execute a specific tool with the provided arguments. This endpoint allows direct execution of available tools by providing the tool name and arguments as JSON. The tool will be executed in the context of the authenticated user's organization and permissions. The tool execution happens with the same permissions and context as if the tool were called by an agent, ensuring proper security and access control. Rate limit: 30 requests per minute. + + :param org_id: (required) + :type org_id: int + :param tool_execution_request: (required) + :type tool_execution_request: ToolExecutionRequest + :param authorization: + :type authorization: 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._execute_tool_v1_organizations_org_id_tools_execute_post_serialize( + org_id=org_id, + tool_execution_request=tool_execution_request, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ToolExecutionResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _execute_tool_v1_organizations_org_id_tools_execute_post_serialize( + self, + org_id, + tool_execution_request, + authorization, + _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 org_id is not None: + _path_params['org_id'] = org_id + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # process the form parameters + # process the body parameter + if tool_execution_request is not None: + _body_params = tool_execution_request + + + # 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] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/organizations/{org_id}/tools/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 + ) + + + + + @validate_call + def execute_tool_v1_organizations_org_id_tools_execute_post_0( + self, + org_id: StrictInt, + tool_execution_request: ToolExecutionRequest, + authorization: Optional[Any] = 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, + ) -> ToolExecutionResponse: + """Execute Tool + + Execute a specific tool with the provided arguments. This endpoint allows direct execution of available tools by providing the tool name and arguments as JSON. The tool will be executed in the context of the authenticated user's organization and permissions. The tool execution happens with the same permissions and context as if the tool were called by an agent, ensuring proper security and access control. Rate limit: 30 requests per minute. + + :param org_id: (required) + :type org_id: int + :param tool_execution_request: (required) + :type tool_execution_request: ToolExecutionRequest + :param authorization: + :type authorization: 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._execute_tool_v1_organizations_org_id_tools_execute_post_0_serialize( + org_id=org_id, + tool_execution_request=tool_execution_request, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ToolExecutionResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + 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 execute_tool_v1_organizations_org_id_tools_execute_post_0_with_http_info( + self, + org_id: StrictInt, + tool_execution_request: ToolExecutionRequest, + authorization: Optional[Any] = 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[ToolExecutionResponse]: + """Execute Tool + + Execute a specific tool with the provided arguments. This endpoint allows direct execution of available tools by providing the tool name and arguments as JSON. The tool will be executed in the context of the authenticated user's organization and permissions. The tool execution happens with the same permissions and context as if the tool were called by an agent, ensuring proper security and access control. Rate limit: 30 requests per minute. + + :param org_id: (required) + :type org_id: int + :param tool_execution_request: (required) + :type tool_execution_request: ToolExecutionRequest + :param authorization: + :type authorization: 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._execute_tool_v1_organizations_org_id_tools_execute_post_0_serialize( + org_id=org_id, + tool_execution_request=tool_execution_request, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ToolExecutionResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + 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 execute_tool_v1_organizations_org_id_tools_execute_post_0_without_preload_content( + self, + org_id: StrictInt, + tool_execution_request: ToolExecutionRequest, + authorization: Optional[Any] = 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: + """Execute Tool + + Execute a specific tool with the provided arguments. This endpoint allows direct execution of available tools by providing the tool name and arguments as JSON. The tool will be executed in the context of the authenticated user's organization and permissions. The tool execution happens with the same permissions and context as if the tool were called by an agent, ensuring proper security and access control. Rate limit: 30 requests per minute. + + :param org_id: (required) + :type org_id: int + :param tool_execution_request: (required) + :type tool_execution_request: ToolExecutionRequest + :param authorization: + :type authorization: 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._execute_tool_v1_organizations_org_id_tools_execute_post_0_serialize( + org_id=org_id, + tool_execution_request=tool_execution_request, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ToolExecutionResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _execute_tool_v1_organizations_org_id_tools_execute_post_0_serialize( + self, + org_id, + tool_execution_request, + authorization, + _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 org_id is not None: + _path_params['org_id'] = org_id + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # process the form parameters + # process the body parameter + if tool_execution_request is not None: + _body_params = tool_execution_request + + + # 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] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/organizations/{org_id}/tools/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 + ) + + + + + @validate_call + def execute_tool_v1_organizations_org_id_tools_execute_post_1( + self, + org_id: StrictInt, + tool_execution_request: ToolExecutionRequest, + authorization: Optional[Any] = 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, + ) -> ToolExecutionResponse: + """Execute Tool + + Execute a specific tool with the provided arguments. This endpoint allows direct execution of available tools by providing the tool name and arguments as JSON. The tool will be executed in the context of the authenticated user's organization and permissions. The tool execution happens with the same permissions and context as if the tool were called by an agent, ensuring proper security and access control. Rate limit: 30 requests per minute. + + :param org_id: (required) + :type org_id: int + :param tool_execution_request: (required) + :type tool_execution_request: ToolExecutionRequest + :param authorization: + :type authorization: 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._execute_tool_v1_organizations_org_id_tools_execute_post_1_serialize( + org_id=org_id, + tool_execution_request=tool_execution_request, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ToolExecutionResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + 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 execute_tool_v1_organizations_org_id_tools_execute_post_1_with_http_info( + self, + org_id: StrictInt, + tool_execution_request: ToolExecutionRequest, + authorization: Optional[Any] = 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[ToolExecutionResponse]: + """Execute Tool + + Execute a specific tool with the provided arguments. This endpoint allows direct execution of available tools by providing the tool name and arguments as JSON. The tool will be executed in the context of the authenticated user's organization and permissions. The tool execution happens with the same permissions and context as if the tool were called by an agent, ensuring proper security and access control. Rate limit: 30 requests per minute. + + :param org_id: (required) + :type org_id: int + :param tool_execution_request: (required) + :type tool_execution_request: ToolExecutionRequest + :param authorization: + :type authorization: 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._execute_tool_v1_organizations_org_id_tools_execute_post_1_serialize( + org_id=org_id, + tool_execution_request=tool_execution_request, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ToolExecutionResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + 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 execute_tool_v1_organizations_org_id_tools_execute_post_1_without_preload_content( + self, + org_id: StrictInt, + tool_execution_request: ToolExecutionRequest, + authorization: Optional[Any] = 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: + """Execute Tool + + Execute a specific tool with the provided arguments. This endpoint allows direct execution of available tools by providing the tool name and arguments as JSON. The tool will be executed in the context of the authenticated user's organization and permissions. The tool execution happens with the same permissions and context as if the tool were called by an agent, ensuring proper security and access control. Rate limit: 30 requests per minute. + + :param org_id: (required) + :type org_id: int + :param tool_execution_request: (required) + :type tool_execution_request: ToolExecutionRequest + :param authorization: + :type authorization: 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._execute_tool_v1_organizations_org_id_tools_execute_post_1_serialize( + org_id=org_id, + tool_execution_request=tool_execution_request, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ToolExecutionResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _execute_tool_v1_organizations_org_id_tools_execute_post_1_serialize( + self, + org_id, + tool_execution_request, + authorization, + _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 org_id is not None: + _path_params['org_id'] = org_id + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # process the form parameters + # process the body parameter + if tool_execution_request is not None: + _body_params = tool_execution_request + + + # 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] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/organizations/{org_id}/tools/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 + ) + + + + + @validate_call + def get_available_tools_v1_organizations_org_id_tools_get( + self, + org_id: StrictInt, + repo_id: Annotated[Optional[StrictInt], Field(description="Optional repository ID to filter tools for specific repository context")] = None, + authorization: Optional[Any] = 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, + ) -> Dict[str, object]: + """Get Available Tools + + Get a list of all available tools for the given API token and organization. Returns a comprehensive list of tools that can be used with the current API token, including their names, descriptions, and parameter specifications. Tools are filtered based on the organization's permissions and enabled integrations. The response includes tool schemas that can be used to understand: - Tool name and description - Required and optional parameters - Parameter types and constraints - Default values where applicable Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: Optional repository ID to filter tools for specific repository context + :type repo_id: int + :param authorization: + :type authorization: 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._get_available_tools_v1_organizations_org_id_tools_get_serialize( + org_id=org_id, + repo_id=repo_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Dict[str, object]", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + 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_available_tools_v1_organizations_org_id_tools_get_with_http_info( + self, + org_id: StrictInt, + repo_id: Annotated[Optional[StrictInt], Field(description="Optional repository ID to filter tools for specific repository context")] = None, + authorization: Optional[Any] = 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[Dict[str, object]]: + """Get Available Tools + + Get a list of all available tools for the given API token and organization. Returns a comprehensive list of tools that can be used with the current API token, including their names, descriptions, and parameter specifications. Tools are filtered based on the organization's permissions and enabled integrations. The response includes tool schemas that can be used to understand: - Tool name and description - Required and optional parameters - Parameter types and constraints - Default values where applicable Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: Optional repository ID to filter tools for specific repository context + :type repo_id: int + :param authorization: + :type authorization: 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._get_available_tools_v1_organizations_org_id_tools_get_serialize( + org_id=org_id, + repo_id=repo_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Dict[str, object]", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + 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_available_tools_v1_organizations_org_id_tools_get_without_preload_content( + self, + org_id: StrictInt, + repo_id: Annotated[Optional[StrictInt], Field(description="Optional repository ID to filter tools for specific repository context")] = None, + authorization: Optional[Any] = 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 Available Tools + + Get a list of all available tools for the given API token and organization. Returns a comprehensive list of tools that can be used with the current API token, including their names, descriptions, and parameter specifications. Tools are filtered based on the organization's permissions and enabled integrations. The response includes tool schemas that can be used to understand: - Tool name and description - Required and optional parameters - Parameter types and constraints - Default values where applicable Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: Optional repository ID to filter tools for specific repository context + :type repo_id: int + :param authorization: + :type authorization: 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._get_available_tools_v1_organizations_org_id_tools_get_serialize( + org_id=org_id, + repo_id=repo_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Dict[str, object]", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_available_tools_v1_organizations_org_id_tools_get_serialize( + self, + org_id, + repo_id, + authorization, + _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 org_id is not None: + _path_params['org_id'] = org_id + # process the query parameters + if repo_id is not None: + + _query_params.append(('repo_id', repo_id)) + + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/organizations/{org_id}/tools', + 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_available_tools_v1_organizations_org_id_tools_get_0( + self, + org_id: StrictInt, + repo_id: Annotated[Optional[StrictInt], Field(description="Optional repository ID to filter tools for specific repository context")] = None, + authorization: Optional[Any] = 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, + ) -> Dict[str, object]: + """Get Available Tools + + Get a list of all available tools for the given API token and organization. Returns a comprehensive list of tools that can be used with the current API token, including their names, descriptions, and parameter specifications. Tools are filtered based on the organization's permissions and enabled integrations. The response includes tool schemas that can be used to understand: - Tool name and description - Required and optional parameters - Parameter types and constraints - Default values where applicable Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: Optional repository ID to filter tools for specific repository context + :type repo_id: int + :param authorization: + :type authorization: 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._get_available_tools_v1_organizations_org_id_tools_get_0_serialize( + org_id=org_id, + repo_id=repo_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Dict[str, object]", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + 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_available_tools_v1_organizations_org_id_tools_get_0_with_http_info( + self, + org_id: StrictInt, + repo_id: Annotated[Optional[StrictInt], Field(description="Optional repository ID to filter tools for specific repository context")] = None, + authorization: Optional[Any] = 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[Dict[str, object]]: + """Get Available Tools + + Get a list of all available tools for the given API token and organization. Returns a comprehensive list of tools that can be used with the current API token, including their names, descriptions, and parameter specifications. Tools are filtered based on the organization's permissions and enabled integrations. The response includes tool schemas that can be used to understand: - Tool name and description - Required and optional parameters - Parameter types and constraints - Default values where applicable Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: Optional repository ID to filter tools for specific repository context + :type repo_id: int + :param authorization: + :type authorization: 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._get_available_tools_v1_organizations_org_id_tools_get_0_serialize( + org_id=org_id, + repo_id=repo_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Dict[str, object]", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + 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_available_tools_v1_organizations_org_id_tools_get_0_without_preload_content( + self, + org_id: StrictInt, + repo_id: Annotated[Optional[StrictInt], Field(description="Optional repository ID to filter tools for specific repository context")] = None, + authorization: Optional[Any] = 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 Available Tools + + Get a list of all available tools for the given API token and organization. Returns a comprehensive list of tools that can be used with the current API token, including their names, descriptions, and parameter specifications. Tools are filtered based on the organization's permissions and enabled integrations. The response includes tool schemas that can be used to understand: - Tool name and description - Required and optional parameters - Parameter types and constraints - Default values where applicable Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: Optional repository ID to filter tools for specific repository context + :type repo_id: int + :param authorization: + :type authorization: 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._get_available_tools_v1_organizations_org_id_tools_get_0_serialize( + org_id=org_id, + repo_id=repo_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Dict[str, object]", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_available_tools_v1_organizations_org_id_tools_get_0_serialize( + self, + org_id, + repo_id, + authorization, + _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 org_id is not None: + _path_params['org_id'] = org_id + # process the query parameters + if repo_id is not None: + + _query_params.append(('repo_id', repo_id)) + + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/organizations/{org_id}/tools', + 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_available_tools_v1_organizations_org_id_tools_get_1( + self, + org_id: StrictInt, + repo_id: Annotated[Optional[StrictInt], Field(description="Optional repository ID to filter tools for specific repository context")] = None, + authorization: Optional[Any] = 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, + ) -> Dict[str, object]: + """Get Available Tools + + Get a list of all available tools for the given API token and organization. Returns a comprehensive list of tools that can be used with the current API token, including their names, descriptions, and parameter specifications. Tools are filtered based on the organization's permissions and enabled integrations. The response includes tool schemas that can be used to understand: - Tool name and description - Required and optional parameters - Parameter types and constraints - Default values where applicable Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: Optional repository ID to filter tools for specific repository context + :type repo_id: int + :param authorization: + :type authorization: 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._get_available_tools_v1_organizations_org_id_tools_get_1_serialize( + org_id=org_id, + repo_id=repo_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Dict[str, object]", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + 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_available_tools_v1_organizations_org_id_tools_get_1_with_http_info( + self, + org_id: StrictInt, + repo_id: Annotated[Optional[StrictInt], Field(description="Optional repository ID to filter tools for specific repository context")] = None, + authorization: Optional[Any] = 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[Dict[str, object]]: + """Get Available Tools + + Get a list of all available tools for the given API token and organization. Returns a comprehensive list of tools that can be used with the current API token, including their names, descriptions, and parameter specifications. Tools are filtered based on the organization's permissions and enabled integrations. The response includes tool schemas that can be used to understand: - Tool name and description - Required and optional parameters - Parameter types and constraints - Default values where applicable Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: Optional repository ID to filter tools for specific repository context + :type repo_id: int + :param authorization: + :type authorization: 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._get_available_tools_v1_organizations_org_id_tools_get_1_serialize( + org_id=org_id, + repo_id=repo_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Dict[str, object]", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + 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_available_tools_v1_organizations_org_id_tools_get_1_without_preload_content( + self, + org_id: StrictInt, + repo_id: Annotated[Optional[StrictInt], Field(description="Optional repository ID to filter tools for specific repository context")] = None, + authorization: Optional[Any] = 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 Available Tools + + Get a list of all available tools for the given API token and organization. Returns a comprehensive list of tools that can be used with the current API token, including their names, descriptions, and parameter specifications. Tools are filtered based on the organization's permissions and enabled integrations. The response includes tool schemas that can be used to understand: - Tool name and description - Required and optional parameters - Parameter types and constraints - Default values where applicable Rate limit: 60 requests per 30 seconds. + + :param org_id: (required) + :type org_id: int + :param repo_id: Optional repository ID to filter tools for specific repository context + :type repo_id: int + :param authorization: + :type authorization: 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._get_available_tools_v1_organizations_org_id_tools_get_1_serialize( + org_id=org_id, + repo_id=repo_id, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Dict[str, object]", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_available_tools_v1_organizations_org_id_tools_get_1_serialize( + self, + org_id, + repo_id, + authorization, + _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 org_id is not None: + _path_params['org_id'] = org_id + # process the query parameters + if repo_id is not None: + + _query_params.append(('repo_id', repo_id)) + + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/organizations/{org_id}/tools', + 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/codegen_api_client/api/users_api.py b/codegen_api_client/api/users_api.py index 6a0038f..85b05a1 100644 --- a/codegen_api_client/api/users_api.py +++ b/codegen_api_client/api/users_api.py @@ -16,7 +16,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictStr +from pydantic import Field, StrictInt from typing import Any, Optional from typing_extensions import Annotated from codegen_api_client.models.page_user_response import PageUserResponse @@ -40,11 +40,818 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client + @validate_call + def get_current_user_info_v1_users_me_get( + self, + authorization: Optional[Any] = 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, + ) -> UserResponse: + """Get Current User Info + + Get current user information from API token. Returns detailed information about the user associated with the provided API token. This is useful for applications that need to identify the current user from their API token. Rate limit: 60 requests per 30 seconds. + + :param authorization: + :type authorization: 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._get_current_user_info_v1_users_me_get_serialize( + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + 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_current_user_info_v1_users_me_get_with_http_info( + self, + authorization: Optional[Any] = 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[UserResponse]: + """Get Current User Info + + Get current user information from API token. Returns detailed information about the user associated with the provided API token. This is useful for applications that need to identify the current user from their API token. Rate limit: 60 requests per 30 seconds. + + :param authorization: + :type authorization: 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._get_current_user_info_v1_users_me_get_serialize( + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + 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_current_user_info_v1_users_me_get_without_preload_content( + self, + authorization: Optional[Any] = 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 Current User Info + + Get current user information from API token. Returns detailed information about the user associated with the provided API token. This is useful for applications that need to identify the current user from their API token. Rate limit: 60 requests per 30 seconds. + + :param authorization: + :type authorization: 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._get_current_user_info_v1_users_me_get_serialize( + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_current_user_info_v1_users_me_get_serialize( + self, + authorization, + _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 + if authorization is not None: + _header_params['authorization'] = authorization + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/users/me', + 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_current_user_info_v1_users_me_get_0( + self, + authorization: Optional[Any] = 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, + ) -> UserResponse: + """Get Current User Info + + Get current user information from API token. Returns detailed information about the user associated with the provided API token. This is useful for applications that need to identify the current user from their API token. Rate limit: 60 requests per 30 seconds. + + :param authorization: + :type authorization: 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._get_current_user_info_v1_users_me_get_0_serialize( + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + 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_current_user_info_v1_users_me_get_0_with_http_info( + self, + authorization: Optional[Any] = 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[UserResponse]: + """Get Current User Info + + Get current user information from API token. Returns detailed information about the user associated with the provided API token. This is useful for applications that need to identify the current user from their API token. Rate limit: 60 requests per 30 seconds. + + :param authorization: + :type authorization: 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._get_current_user_info_v1_users_me_get_0_serialize( + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + 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_current_user_info_v1_users_me_get_0_without_preload_content( + self, + authorization: Optional[Any] = 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 Current User Info + + Get current user information from API token. Returns detailed information about the user associated with the provided API token. This is useful for applications that need to identify the current user from their API token. Rate limit: 60 requests per 30 seconds. + + :param authorization: + :type authorization: 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._get_current_user_info_v1_users_me_get_0_serialize( + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_current_user_info_v1_users_me_get_0_serialize( + self, + authorization, + _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 + if authorization is not None: + _header_params['authorization'] = authorization + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/users/me', + 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_current_user_info_v1_users_me_get_1( + self, + authorization: Optional[Any] = 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, + ) -> UserResponse: + """Get Current User Info + + Get current user information from API token. Returns detailed information about the user associated with the provided API token. This is useful for applications that need to identify the current user from their API token. Rate limit: 60 requests per 30 seconds. + + :param authorization: + :type authorization: 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._get_current_user_info_v1_users_me_get_1_serialize( + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + 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_current_user_info_v1_users_me_get_1_with_http_info( + self, + authorization: Optional[Any] = 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[UserResponse]: + """Get Current User Info + + Get current user information from API token. Returns detailed information about the user associated with the provided API token. This is useful for applications that need to identify the current user from their API token. Rate limit: 60 requests per 30 seconds. + + :param authorization: + :type authorization: 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._get_current_user_info_v1_users_me_get_1_serialize( + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + 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_current_user_info_v1_users_me_get_1_without_preload_content( + self, + authorization: Optional[Any] = 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 Current User Info + + Get current user information from API token. Returns detailed information about the user associated with the provided API token. This is useful for applications that need to identify the current user from their API token. Rate limit: 60 requests per 30 seconds. + + :param authorization: + :type authorization: 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._get_current_user_info_v1_users_me_get_1_serialize( + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_current_user_info_v1_users_me_get_1_serialize( + self, + authorization, + _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 + if authorization is not None: + _header_params['authorization'] = authorization + # 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] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/users/me', + 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_user_v1_organizations_org_id_users_user_id_get( self, - org_id: StrictStr, - user_id: StrictStr, + org_id: StrictInt, + user_id: StrictInt, authorization: Optional[Any] = None, _request_timeout: Union[ None, @@ -61,12 +868,12 @@ def get_user_v1_organizations_org_id_users_user_id_get( ) -> UserResponse: """Get User - Get details for a specific user in an organization. Returns detailed information about a user within the specified organization. The requesting user must be a member of the organization to access this endpoint. + Get details for a specific user in an organization. Returns detailed information about a user within the specified organization. The requesting user must be a member of the organization to access this endpoint. Rate limit: 60 requests per 30 seconds. :param org_id: (required) - :type org_id: str + :type org_id: int :param user_id: (required) - :type user_id: str + :type user_id: int :param authorization: :type authorization: object :param _request_timeout: timeout setting for this request. If one @@ -103,8 +910,10 @@ def get_user_v1_organizations_org_id_users_user_id_get( _response_types_map: Dict[str, Optional[str]] = { '200': "UserResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "UserNotFoundErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -120,8 +929,8 @@ def get_user_v1_organizations_org_id_users_user_id_get( @validate_call def get_user_v1_organizations_org_id_users_user_id_get_with_http_info( self, - org_id: StrictStr, - user_id: StrictStr, + org_id: StrictInt, + user_id: StrictInt, authorization: Optional[Any] = None, _request_timeout: Union[ None, @@ -138,12 +947,12 @@ def get_user_v1_organizations_org_id_users_user_id_get_with_http_info( ) -> ApiResponse[UserResponse]: """Get User - Get details for a specific user in an organization. Returns detailed information about a user within the specified organization. The requesting user must be a member of the organization to access this endpoint. + Get details for a specific user in an organization. Returns detailed information about a user within the specified organization. The requesting user must be a member of the organization to access this endpoint. Rate limit: 60 requests per 30 seconds. :param org_id: (required) - :type org_id: str + :type org_id: int :param user_id: (required) - :type user_id: str + :type user_id: int :param authorization: :type authorization: object :param _request_timeout: timeout setting for this request. If one @@ -180,8 +989,10 @@ def get_user_v1_organizations_org_id_users_user_id_get_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "UserResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "UserNotFoundErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -197,8 +1008,8 @@ def get_user_v1_organizations_org_id_users_user_id_get_with_http_info( @validate_call def get_user_v1_organizations_org_id_users_user_id_get_without_preload_content( self, - org_id: StrictStr, - user_id: StrictStr, + org_id: StrictInt, + user_id: StrictInt, authorization: Optional[Any] = None, _request_timeout: Union[ None, @@ -215,12 +1026,12 @@ def get_user_v1_organizations_org_id_users_user_id_get_without_preload_content( ) -> RESTResponseType: """Get User - Get details for a specific user in an organization. Returns detailed information about a user within the specified organization. The requesting user must be a member of the organization to access this endpoint. + Get details for a specific user in an organization. Returns detailed information about a user within the specified organization. The requesting user must be a member of the organization to access this endpoint. Rate limit: 60 requests per 30 seconds. :param org_id: (required) - :type org_id: str + :type org_id: int :param user_id: (required) - :type user_id: str + :type user_id: int :param authorization: :type authorization: object :param _request_timeout: timeout setting for this request. If one @@ -257,8 +1068,10 @@ def get_user_v1_organizations_org_id_users_user_id_get_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "UserResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "UserNotFoundErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -339,8 +1152,8 @@ def _get_user_v1_organizations_org_id_users_user_id_get_serialize( @validate_call def get_user_v1_organizations_org_id_users_user_id_get_0( self, - org_id: StrictStr, - user_id: StrictStr, + org_id: StrictInt, + user_id: StrictInt, authorization: Optional[Any] = None, _request_timeout: Union[ None, @@ -357,12 +1170,12 @@ def get_user_v1_organizations_org_id_users_user_id_get_0( ) -> UserResponse: """Get User - Get details for a specific user in an organization. Returns detailed information about a user within the specified organization. The requesting user must be a member of the organization to access this endpoint. + Get details for a specific user in an organization. Returns detailed information about a user within the specified organization. The requesting user must be a member of the organization to access this endpoint. Rate limit: 60 requests per 30 seconds. :param org_id: (required) - :type org_id: str + :type org_id: int :param user_id: (required) - :type user_id: str + :type user_id: int :param authorization: :type authorization: object :param _request_timeout: timeout setting for this request. If one @@ -399,8 +1212,10 @@ def get_user_v1_organizations_org_id_users_user_id_get_0( _response_types_map: Dict[str, Optional[str]] = { '200': "UserResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "UserNotFoundErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -416,8 +1231,8 @@ def get_user_v1_organizations_org_id_users_user_id_get_0( @validate_call def get_user_v1_organizations_org_id_users_user_id_get_0_with_http_info( self, - org_id: StrictStr, - user_id: StrictStr, + org_id: StrictInt, + user_id: StrictInt, authorization: Optional[Any] = None, _request_timeout: Union[ None, @@ -434,12 +1249,12 @@ def get_user_v1_organizations_org_id_users_user_id_get_0_with_http_info( ) -> ApiResponse[UserResponse]: """Get User - Get details for a specific user in an organization. Returns detailed information about a user within the specified organization. The requesting user must be a member of the organization to access this endpoint. + Get details for a specific user in an organization. Returns detailed information about a user within the specified organization. The requesting user must be a member of the organization to access this endpoint. Rate limit: 60 requests per 30 seconds. :param org_id: (required) - :type org_id: str + :type org_id: int :param user_id: (required) - :type user_id: str + :type user_id: int :param authorization: :type authorization: object :param _request_timeout: timeout setting for this request. If one @@ -476,8 +1291,10 @@ def get_user_v1_organizations_org_id_users_user_id_get_0_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "UserResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "UserNotFoundErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -493,8 +1310,8 @@ def get_user_v1_organizations_org_id_users_user_id_get_0_with_http_info( @validate_call def get_user_v1_organizations_org_id_users_user_id_get_0_without_preload_content( self, - org_id: StrictStr, - user_id: StrictStr, + org_id: StrictInt, + user_id: StrictInt, authorization: Optional[Any] = None, _request_timeout: Union[ None, @@ -511,12 +1328,12 @@ def get_user_v1_organizations_org_id_users_user_id_get_0_without_preload_content ) -> RESTResponseType: """Get User - Get details for a specific user in an organization. Returns detailed information about a user within the specified organization. The requesting user must be a member of the organization to access this endpoint. + Get details for a specific user in an organization. Returns detailed information about a user within the specified organization. The requesting user must be a member of the organization to access this endpoint. Rate limit: 60 requests per 30 seconds. :param org_id: (required) - :type org_id: str + :type org_id: int :param user_id: (required) - :type user_id: str + :type user_id: int :param authorization: :type authorization: object :param _request_timeout: timeout setting for this request. If one @@ -553,8 +1370,10 @@ def get_user_v1_organizations_org_id_users_user_id_get_0_without_preload_content _response_types_map: Dict[str, Optional[str]] = { '200': "UserResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "UserNotFoundErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -635,8 +1454,8 @@ def _get_user_v1_organizations_org_id_users_user_id_get_0_serialize( @validate_call def get_user_v1_organizations_org_id_users_user_id_get_1( self, - org_id: StrictStr, - user_id: StrictStr, + org_id: StrictInt, + user_id: StrictInt, authorization: Optional[Any] = None, _request_timeout: Union[ None, @@ -653,12 +1472,12 @@ def get_user_v1_organizations_org_id_users_user_id_get_1( ) -> UserResponse: """Get User - Get details for a specific user in an organization. Returns detailed information about a user within the specified organization. The requesting user must be a member of the organization to access this endpoint. + Get details for a specific user in an organization. Returns detailed information about a user within the specified organization. The requesting user must be a member of the organization to access this endpoint. Rate limit: 60 requests per 30 seconds. :param org_id: (required) - :type org_id: str + :type org_id: int :param user_id: (required) - :type user_id: str + :type user_id: int :param authorization: :type authorization: object :param _request_timeout: timeout setting for this request. If one @@ -695,8 +1514,10 @@ def get_user_v1_organizations_org_id_users_user_id_get_1( _response_types_map: Dict[str, Optional[str]] = { '200': "UserResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "UserNotFoundErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -712,8 +1533,8 @@ def get_user_v1_organizations_org_id_users_user_id_get_1( @validate_call def get_user_v1_organizations_org_id_users_user_id_get_1_with_http_info( self, - org_id: StrictStr, - user_id: StrictStr, + org_id: StrictInt, + user_id: StrictInt, authorization: Optional[Any] = None, _request_timeout: Union[ None, @@ -730,12 +1551,12 @@ def get_user_v1_organizations_org_id_users_user_id_get_1_with_http_info( ) -> ApiResponse[UserResponse]: """Get User - Get details for a specific user in an organization. Returns detailed information about a user within the specified organization. The requesting user must be a member of the organization to access this endpoint. + Get details for a specific user in an organization. Returns detailed information about a user within the specified organization. The requesting user must be a member of the organization to access this endpoint. Rate limit: 60 requests per 30 seconds. :param org_id: (required) - :type org_id: str + :type org_id: int :param user_id: (required) - :type user_id: str + :type user_id: int :param authorization: :type authorization: object :param _request_timeout: timeout setting for this request. If one @@ -772,8 +1593,10 @@ def get_user_v1_organizations_org_id_users_user_id_get_1_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "UserResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "UserNotFoundErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -789,8 +1612,8 @@ def get_user_v1_organizations_org_id_users_user_id_get_1_with_http_info( @validate_call def get_user_v1_organizations_org_id_users_user_id_get_1_without_preload_content( self, - org_id: StrictStr, - user_id: StrictStr, + org_id: StrictInt, + user_id: StrictInt, authorization: Optional[Any] = None, _request_timeout: Union[ None, @@ -807,12 +1630,12 @@ def get_user_v1_organizations_org_id_users_user_id_get_1_without_preload_content ) -> RESTResponseType: """Get User - Get details for a specific user in an organization. Returns detailed information about a user within the specified organization. The requesting user must be a member of the organization to access this endpoint. + Get details for a specific user in an organization. Returns detailed information about a user within the specified organization. The requesting user must be a member of the organization to access this endpoint. Rate limit: 60 requests per 30 seconds. :param org_id: (required) - :type org_id: str + :type org_id: int :param user_id: (required) - :type user_id: str + :type user_id: int :param authorization: :type authorization: object :param _request_timeout: timeout setting for this request. If one @@ -849,8 +1672,10 @@ def get_user_v1_organizations_org_id_users_user_id_get_1_without_preload_content _response_types_map: Dict[str, Optional[str]] = { '200': "UserResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", + '404': "UserNotFoundErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -931,7 +1756,7 @@ def _get_user_v1_organizations_org_id_users_user_id_get_1_serialize( @validate_call def get_users_v1_organizations_org_id_users_get( self, - org_id: StrictStr, + org_id: StrictInt, skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, authorization: Optional[Any] = None, @@ -950,10 +1775,10 @@ def get_users_v1_organizations_org_id_users_get( ) -> PageUserResponse: """Get Users - Get paginated list of users for a specific organization. Returns a paginated list of all users associated with the specified organization. The requesting user must be a member of the organization to access this endpoint. + Get users for the specified organization. Returns a paginated list of all users that belong to the specified organization. Results include user details such as name, email, GitHub username, and avatar. Use pagination parameters to control the number of results returned. Rate limit: 60 requests per 30 seconds. :param org_id: (required) - :type org_id: str + :type org_id: int :param skip: :type skip: int :param limit: @@ -995,8 +1820,9 @@ def get_users_v1_organizations_org_id_users_get( _response_types_map: Dict[str, Optional[str]] = { '200': "PageUserResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -1012,7 +1838,7 @@ def get_users_v1_organizations_org_id_users_get( @validate_call def get_users_v1_organizations_org_id_users_get_with_http_info( self, - org_id: StrictStr, + org_id: StrictInt, skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, authorization: Optional[Any] = None, @@ -1031,10 +1857,10 @@ def get_users_v1_organizations_org_id_users_get_with_http_info( ) -> ApiResponse[PageUserResponse]: """Get Users - Get paginated list of users for a specific organization. Returns a paginated list of all users associated with the specified organization. The requesting user must be a member of the organization to access this endpoint. + Get users for the specified organization. Returns a paginated list of all users that belong to the specified organization. Results include user details such as name, email, GitHub username, and avatar. Use pagination parameters to control the number of results returned. Rate limit: 60 requests per 30 seconds. :param org_id: (required) - :type org_id: str + :type org_id: int :param skip: :type skip: int :param limit: @@ -1076,8 +1902,9 @@ def get_users_v1_organizations_org_id_users_get_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "PageUserResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -1093,7 +1920,7 @@ def get_users_v1_organizations_org_id_users_get_with_http_info( @validate_call def get_users_v1_organizations_org_id_users_get_without_preload_content( self, - org_id: StrictStr, + org_id: StrictInt, skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, authorization: Optional[Any] = None, @@ -1112,10 +1939,10 @@ def get_users_v1_organizations_org_id_users_get_without_preload_content( ) -> RESTResponseType: """Get Users - Get paginated list of users for a specific organization. Returns a paginated list of all users associated with the specified organization. The requesting user must be a member of the organization to access this endpoint. + Get users for the specified organization. Returns a paginated list of all users that belong to the specified organization. Results include user details such as name, email, GitHub username, and avatar. Use pagination parameters to control the number of results returned. Rate limit: 60 requests per 30 seconds. :param org_id: (required) - :type org_id: str + :type org_id: int :param skip: :type skip: int :param limit: @@ -1157,8 +1984,9 @@ def get_users_v1_organizations_org_id_users_get_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "PageUserResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -1246,7 +2074,7 @@ def _get_users_v1_organizations_org_id_users_get_serialize( @validate_call def get_users_v1_organizations_org_id_users_get_0( self, - org_id: StrictStr, + org_id: StrictInt, skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, authorization: Optional[Any] = None, @@ -1265,10 +2093,10 @@ def get_users_v1_organizations_org_id_users_get_0( ) -> PageUserResponse: """Get Users - Get paginated list of users for a specific organization. Returns a paginated list of all users associated with the specified organization. The requesting user must be a member of the organization to access this endpoint. + Get users for the specified organization. Returns a paginated list of all users that belong to the specified organization. Results include user details such as name, email, GitHub username, and avatar. Use pagination parameters to control the number of results returned. Rate limit: 60 requests per 30 seconds. :param org_id: (required) - :type org_id: str + :type org_id: int :param skip: :type skip: int :param limit: @@ -1310,8 +2138,9 @@ def get_users_v1_organizations_org_id_users_get_0( _response_types_map: Dict[str, Optional[str]] = { '200': "PageUserResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -1327,7 +2156,7 @@ def get_users_v1_organizations_org_id_users_get_0( @validate_call def get_users_v1_organizations_org_id_users_get_0_with_http_info( self, - org_id: StrictStr, + org_id: StrictInt, skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, authorization: Optional[Any] = None, @@ -1346,10 +2175,10 @@ def get_users_v1_organizations_org_id_users_get_0_with_http_info( ) -> ApiResponse[PageUserResponse]: """Get Users - Get paginated list of users for a specific organization. Returns a paginated list of all users associated with the specified organization. The requesting user must be a member of the organization to access this endpoint. + Get users for the specified organization. Returns a paginated list of all users that belong to the specified organization. Results include user details such as name, email, GitHub username, and avatar. Use pagination parameters to control the number of results returned. Rate limit: 60 requests per 30 seconds. :param org_id: (required) - :type org_id: str + :type org_id: int :param skip: :type skip: int :param limit: @@ -1391,8 +2220,9 @@ def get_users_v1_organizations_org_id_users_get_0_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "PageUserResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -1408,7 +2238,7 @@ def get_users_v1_organizations_org_id_users_get_0_with_http_info( @validate_call def get_users_v1_organizations_org_id_users_get_0_without_preload_content( self, - org_id: StrictStr, + org_id: StrictInt, skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, authorization: Optional[Any] = None, @@ -1427,10 +2257,10 @@ def get_users_v1_organizations_org_id_users_get_0_without_preload_content( ) -> RESTResponseType: """Get Users - Get paginated list of users for a specific organization. Returns a paginated list of all users associated with the specified organization. The requesting user must be a member of the organization to access this endpoint. + Get users for the specified organization. Returns a paginated list of all users that belong to the specified organization. Results include user details such as name, email, GitHub username, and avatar. Use pagination parameters to control the number of results returned. Rate limit: 60 requests per 30 seconds. :param org_id: (required) - :type org_id: str + :type org_id: int :param skip: :type skip: int :param limit: @@ -1472,8 +2302,9 @@ def get_users_v1_organizations_org_id_users_get_0_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "PageUserResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -1561,7 +2392,7 @@ def _get_users_v1_organizations_org_id_users_get_0_serialize( @validate_call def get_users_v1_organizations_org_id_users_get_1( self, - org_id: StrictStr, + org_id: StrictInt, skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, authorization: Optional[Any] = None, @@ -1580,10 +2411,10 @@ def get_users_v1_organizations_org_id_users_get_1( ) -> PageUserResponse: """Get Users - Get paginated list of users for a specific organization. Returns a paginated list of all users associated with the specified organization. The requesting user must be a member of the organization to access this endpoint. + Get users for the specified organization. Returns a paginated list of all users that belong to the specified organization. Results include user details such as name, email, GitHub username, and avatar. Use pagination parameters to control the number of results returned. Rate limit: 60 requests per 30 seconds. :param org_id: (required) - :type org_id: str + :type org_id: int :param skip: :type skip: int :param limit: @@ -1625,8 +2456,9 @@ def get_users_v1_organizations_org_id_users_get_1( _response_types_map: Dict[str, Optional[str]] = { '200': "PageUserResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -1642,7 +2474,7 @@ def get_users_v1_organizations_org_id_users_get_1( @validate_call def get_users_v1_organizations_org_id_users_get_1_with_http_info( self, - org_id: StrictStr, + org_id: StrictInt, skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, authorization: Optional[Any] = None, @@ -1661,10 +2493,10 @@ def get_users_v1_organizations_org_id_users_get_1_with_http_info( ) -> ApiResponse[PageUserResponse]: """Get Users - Get paginated list of users for a specific organization. Returns a paginated list of all users associated with the specified organization. The requesting user must be a member of the organization to access this endpoint. + Get users for the specified organization. Returns a paginated list of all users that belong to the specified organization. Results include user details such as name, email, GitHub username, and avatar. Use pagination parameters to control the number of results returned. Rate limit: 60 requests per 30 seconds. :param org_id: (required) - :type org_id: str + :type org_id: int :param skip: :type skip: int :param limit: @@ -1706,8 +2538,9 @@ def get_users_v1_organizations_org_id_users_get_1_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "PageUserResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, @@ -1723,7 +2556,7 @@ def get_users_v1_organizations_org_id_users_get_1_with_http_info( @validate_call def get_users_v1_organizations_org_id_users_get_1_without_preload_content( self, - org_id: StrictStr, + org_id: StrictInt, skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, authorization: Optional[Any] = None, @@ -1742,10 +2575,10 @@ def get_users_v1_organizations_org_id_users_get_1_without_preload_content( ) -> RESTResponseType: """Get Users - Get paginated list of users for a specific organization. Returns a paginated list of all users associated with the specified organization. The requesting user must be a member of the organization to access this endpoint. + Get users for the specified organization. Returns a paginated list of all users that belong to the specified organization. Results include user details such as name, email, GitHub username, and avatar. Use pagination parameters to control the number of results returned. Rate limit: 60 requests per 30 seconds. :param org_id: (required) - :type org_id: str + :type org_id: int :param skip: :type skip: int :param limit: @@ -1787,8 +2620,9 @@ def get_users_v1_organizations_org_id_users_get_1_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "PageUserResponse", + '429': "APIRateLimitErrorResponse", + '403': "PermissionsErrorResponse", '422': "HTTPValidationError", - '429': "FastAPIRateLimitResponse", } response_data = self.api_client.call_api( *_param, diff --git a/codegen_api_client/configuration.py b/codegen_api_client/configuration.py index 480f9db..9cfe695 100644 --- a/codegen_api_client/configuration.py +++ b/codegen_api_client/configuration.py @@ -188,7 +188,7 @@ def __init__( ) -> None: """Constructor """ - self._base_path = "http://localhost" if host is None else host + self._base_path = "https://api.codegen.com" 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 @@ -511,8 +511,8 @@ def get_host_settings(self) -> List[HostSetting]: """ return [ { - 'url': "", - 'description': "No description provided", + 'url': "https://api.codegen.com", + 'description': "Codegen API", } ] diff --git a/codegen_api_client/models/__init__.py b/codegen_api_client/models/__init__.py index 8611c8a..e06865c 100644 --- a/codegen_api_client/models/__init__.py +++ b/codegen_api_client/models/__init__.py @@ -14,14 +14,36 @@ # import models into model package +from codegen_api_client.models.api_rate_limit_error_response import APIRateLimitErrorResponse +from codegen_api_client.models.agent_run_limit_reached_error_response import AgentRunLimitReachedErrorResponse +from codegen_api_client.models.agent_run_log_response import AgentRunLogResponse +from codegen_api_client.models.agent_run_not_found_error_response import AgentRunNotFoundErrorResponse from codegen_api_client.models.agent_run_response import AgentRunResponse +from codegen_api_client.models.agent_run_with_logs_response import AgentRunWithLogsResponse +from codegen_api_client.models.api_agent_run_source_type import ApiAgentRunSourceType +from codegen_api_client.models.check_suite_retry_stats_response import CheckSuiteRetryStatsResponse +from codegen_api_client.models.check_suite_settings_response import CheckSuiteSettingsResponse from codegen_api_client.models.create_agent_run_input import CreateAgentRunInput -from codegen_api_client.models.fast_api_rate_limit_response import FastAPIRateLimitResponse +from codegen_api_client.models.github_pull_request_response import GithubPullRequestResponse from codegen_api_client.models.http_validation_error import HTTPValidationError +from codegen_api_client.models.integration_status import IntegrationStatus +from codegen_api_client.models.no_repos_found_in_org_error_response import NoReposFoundInOrgErrorResponse +from codegen_api_client.models.observation import Observation +from codegen_api_client.models.organization_integrations_response import OrganizationIntegrationsResponse from codegen_api_client.models.organization_response import OrganizationResponse from codegen_api_client.models.organization_settings import OrganizationSettings +from codegen_api_client.models.page_agent_run_response import PageAgentRunResponse from codegen_api_client.models.page_organization_response import PageOrganizationResponse +from codegen_api_client.models.page_repo_response import PageRepoResponse from codegen_api_client.models.page_user_response import PageUserResponse +from codegen_api_client.models.permissions_error_response import PermissionsErrorResponse +from codegen_api_client.models.repo_response import RepoResponse +from codegen_api_client.models.resume_agent_run_input import ResumeAgentRunInput +from codegen_api_client.models.stop_agent_run_input import StopAgentRunInput +from codegen_api_client.models.tool_execution_request import ToolExecutionRequest +from codegen_api_client.models.tool_execution_response import ToolExecutionResponse +from codegen_api_client.models.update_check_suite_settings_request import UpdateCheckSuiteSettingsRequest +from codegen_api_client.models.user_not_found_error_response import UserNotFoundErrorResponse from codegen_api_client.models.user_response import UserResponse from codegen_api_client.models.validation_error import ValidationError from codegen_api_client.models.validation_error_loc_inner import ValidationErrorLocInner diff --git a/codegen_api_client/models/agent_run_limit_reached_error_response.py b/codegen_api_client/models/agent_run_limit_reached_error_response.py new file mode 100644 index 0000000..1b8c254 --- /dev/null +++ b/codegen_api_client/models/agent_run_limit_reached_error_response.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + 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, Optional +from typing import Optional, Set +from typing_extensions import Self + +class AgentRunLimitReachedErrorResponse(BaseModel): + """ + AgentRunLimitReachedErrorResponse + """ # noqa: E501 + message: Optional[StrictStr] = 'Alloted agent runs for the current billing plan have been reached. Please upgrade your plan to continue.' + status_code: Optional[StrictInt] = 402 + __properties: ClassVar[List[str]] = ["message", "status_code"] + + 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 AgentRunLimitReachedErrorResponse 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 AgentRunLimitReachedErrorResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "message": obj.get("message") if obj.get("message") is not None else 'Alloted agent runs for the current billing plan have been reached. Please upgrade your plan to continue.', + "status_code": obj.get("status_code") if obj.get("status_code") is not None else 402 + }) + return _obj + + diff --git a/codegen_api_client/models/agent_run_log_response.py b/codegen_api_client/models/agent_run_log_response.py new file mode 100644 index 0000000..9e3cf1b --- /dev/null +++ b/codegen_api_client/models/agent_run_log_response.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + 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, Optional +from codegen_api_client.models.observation import Observation +from typing import Optional, Set +from typing_extensions import Self + +class AgentRunLogResponse(BaseModel): + """ + Represents an agent run log in API responses + """ # noqa: E501 + agent_run_id: StrictInt + created_at: Optional[StrictStr] = None + tool_name: Optional[StrictStr] = None + message_type: Optional[StrictStr] = None + thought: Optional[StrictStr] = None + observation: Optional[Observation] = None + tool_input: Optional[Dict[str, Any]] = None + tool_output: Optional[Dict[str, Any]] = None + __properties: ClassVar[List[str]] = ["agent_run_id", "created_at", "tool_name", "message_type", "thought", "observation", "tool_input", "tool_output"] + + 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 AgentRunLogResponse 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 observation + if self.observation: + _dict['observation'] = self.observation.to_dict() + # set to None if created_at (nullable) is None + # and model_fields_set contains the field + if self.created_at is None and "created_at" in self.model_fields_set: + _dict['created_at'] = None + + # set to None if tool_name (nullable) is None + # and model_fields_set contains the field + if self.tool_name is None and "tool_name" in self.model_fields_set: + _dict['tool_name'] = None + + # set to None if message_type (nullable) is None + # and model_fields_set contains the field + if self.message_type is None and "message_type" in self.model_fields_set: + _dict['message_type'] = None + + # set to None if thought (nullable) is None + # and model_fields_set contains the field + if self.thought is None and "thought" in self.model_fields_set: + _dict['thought'] = None + + # set to None if observation (nullable) is None + # and model_fields_set contains the field + if self.observation is None and "observation" in self.model_fields_set: + _dict['observation'] = None + + # set to None if tool_input (nullable) is None + # and model_fields_set contains the field + if self.tool_input is None and "tool_input" in self.model_fields_set: + _dict['tool_input'] = None + + # set to None if tool_output (nullable) is None + # and model_fields_set contains the field + if self.tool_output is None and "tool_output" in self.model_fields_set: + _dict['tool_output'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AgentRunLogResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agent_run_id": obj.get("agent_run_id"), + "created_at": obj.get("created_at"), + "tool_name": obj.get("tool_name"), + "message_type": obj.get("message_type"), + "thought": obj.get("thought"), + "observation": Observation.from_dict(obj["observation"]) if obj.get("observation") is not None else None, + "tool_input": obj.get("tool_input"), + "tool_output": obj.get("tool_output") + }) + return _obj + + diff --git a/codegen_api_client/models/agent_run_not_found_error_response.py b/codegen_api_client/models/agent_run_not_found_error_response.py new file mode 100644 index 0000000..8eb4eac --- /dev/null +++ b/codegen_api_client/models/agent_run_not_found_error_response.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + 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, Optional +from typing import Optional, Set +from typing_extensions import Self + +class AgentRunNotFoundErrorResponse(BaseModel): + """ + AgentRunNotFoundErrorResponse + """ # noqa: E501 + message: Optional[StrictStr] = 'Agent run not found.' + status_code: Optional[StrictInt] = 404 + __properties: ClassVar[List[str]] = ["message", "status_code"] + + 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 AgentRunNotFoundErrorResponse 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 AgentRunNotFoundErrorResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "message": obj.get("message") if obj.get("message") is not None else 'Agent run not found.', + "status_code": obj.get("status_code") if obj.get("status_code") is not None else 404 + }) + return _obj + + diff --git a/codegen_api_client/models/agent_run_response.py b/codegen_api_client/models/agent_run_response.py index 3ebca8c..a9acce5 100644 --- a/codegen_api_client/models/agent_run_response.py +++ b/codegen_api_client/models/agent_run_response.py @@ -19,6 +19,8 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from codegen_api_client.models.api_agent_run_source_type import ApiAgentRunSourceType +from codegen_api_client.models.github_pull_request_response import GithubPullRequestResponse from typing import Optional, Set from typing_extensions import Self @@ -32,7 +34,10 @@ class AgentRunResponse(BaseModel): created_at: Optional[StrictStr] = None web_url: Optional[StrictStr] = None result: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["id", "organization_id", "status", "created_at", "web_url", "result"] + source_type: Optional[ApiAgentRunSourceType] = None + github_pull_requests: Optional[List[GithubPullRequestResponse]] = None + metadata: Optional[Dict[str, Any]] = None + __properties: ClassVar[List[str]] = ["id", "organization_id", "status", "created_at", "web_url", "result", "source_type", "github_pull_requests", "metadata"] model_config = ConfigDict( populate_by_name=True, @@ -73,6 +78,13 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each item in github_pull_requests (list) + _items = [] + if self.github_pull_requests: + for _item_github_pull_requests in self.github_pull_requests: + if _item_github_pull_requests: + _items.append(_item_github_pull_requests.to_dict()) + _dict['github_pull_requests'] = _items # set to None if status (nullable) is None # and model_fields_set contains the field if self.status is None and "status" in self.model_fields_set: @@ -93,6 +105,21 @@ def to_dict(self) -> Dict[str, Any]: if self.result is None and "result" in self.model_fields_set: _dict['result'] = None + # set to None if source_type (nullable) is None + # and model_fields_set contains the field + if self.source_type is None and "source_type" in self.model_fields_set: + _dict['source_type'] = None + + # set to None if github_pull_requests (nullable) is None + # and model_fields_set contains the field + if self.github_pull_requests is None and "github_pull_requests" in self.model_fields_set: + _dict['github_pull_requests'] = None + + # set to None if metadata (nullable) is None + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: + _dict['metadata'] = None + return _dict @classmethod @@ -110,7 +137,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "status": obj.get("status"), "created_at": obj.get("created_at"), "web_url": obj.get("web_url"), - "result": obj.get("result") + "result": obj.get("result"), + "source_type": obj.get("source_type"), + "github_pull_requests": [GithubPullRequestResponse.from_dict(_item) for _item in obj["github_pull_requests"]] if obj.get("github_pull_requests") is not None else None, + "metadata": obj.get("metadata") }) return _obj diff --git a/codegen_api_client/models/agent_run_with_logs_response.py b/codegen_api_client/models/agent_run_with_logs_response.py new file mode 100644 index 0000000..1ff3c7a --- /dev/null +++ b/codegen_api_client/models/agent_run_with_logs_response.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + 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, Optional +from codegen_api_client.models.agent_run_log_response import AgentRunLogResponse +from typing import Optional, Set +from typing_extensions import Self + +class AgentRunWithLogsResponse(BaseModel): + """ + Represents an agent run in API responses + """ # noqa: E501 + id: StrictInt + organization_id: StrictInt + status: Optional[StrictStr] = None + created_at: Optional[StrictStr] = None + web_url: Optional[StrictStr] = None + result: Optional[StrictStr] = None + metadata: Optional[Dict[str, Any]] = None + logs: List[AgentRunLogResponse] + total_logs: Optional[StrictInt] = None + page: Optional[StrictInt] = None + size: Optional[StrictInt] = None + pages: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["id", "organization_id", "status", "created_at", "web_url", "result", "metadata", "logs", "total_logs", "page", "size", "pages"] + + 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 AgentRunWithLogsResponse 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 logs (list) + _items = [] + if self.logs: + for _item_logs in self.logs: + if _item_logs: + _items.append(_item_logs.to_dict()) + _dict['logs'] = _items + # set to None if status (nullable) is None + # and model_fields_set contains the field + if self.status is None and "status" in self.model_fields_set: + _dict['status'] = None + + # set to None if created_at (nullable) is None + # and model_fields_set contains the field + if self.created_at is None and "created_at" in self.model_fields_set: + _dict['created_at'] = None + + # set to None if web_url (nullable) is None + # and model_fields_set contains the field + if self.web_url is None and "web_url" in self.model_fields_set: + _dict['web_url'] = None + + # set to None if result (nullable) is None + # and model_fields_set contains the field + if self.result is None and "result" in self.model_fields_set: + _dict['result'] = None + + # set to None if metadata (nullable) is None + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: + _dict['metadata'] = None + + # set to None if total_logs (nullable) is None + # and model_fields_set contains the field + if self.total_logs is None and "total_logs" in self.model_fields_set: + _dict['total_logs'] = None + + # set to None if page (nullable) is None + # and model_fields_set contains the field + if self.page is None and "page" in self.model_fields_set: + _dict['page'] = None + + # set to None if size (nullable) is None + # and model_fields_set contains the field + if self.size is None and "size" in self.model_fields_set: + _dict['size'] = None + + # set to None if pages (nullable) is None + # and model_fields_set contains the field + if self.pages is None and "pages" in self.model_fields_set: + _dict['pages'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AgentRunWithLogsResponse 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"), + "organization_id": obj.get("organization_id"), + "status": obj.get("status"), + "created_at": obj.get("created_at"), + "web_url": obj.get("web_url"), + "result": obj.get("result"), + "metadata": obj.get("metadata"), + "logs": [AgentRunLogResponse.from_dict(_item) for _item in obj["logs"]] if obj.get("logs") is not None else None, + "total_logs": obj.get("total_logs"), + "page": obj.get("page"), + "size": obj.get("size"), + "pages": obj.get("pages") + }) + return _obj + + diff --git a/codegen_api_client/models/api_agent_run_source_type.py b/codegen_api_client/models/api_agent_run_source_type.py new file mode 100644 index 0000000..109f528 --- /dev/null +++ b/codegen_api_client/models/api_agent_run_source_type.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + 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 ApiAgentRunSourceType(str, Enum): + """ + ApiAgentRunSourceType + """ + + """ + allowed enum values + """ + LOCAL = 'LOCAL' + SLACK = 'SLACK' + GITHUB = 'GITHUB' + GITHUB_CHECK_SUITE = 'GITHUB_CHECK_SUITE' + LINEAR = 'LINEAR' + API = 'API' + CHAT = 'CHAT' + JIRA = 'JIRA' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ApiAgentRunSourceType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/codegen_api_client/models/api_rate_limit_error_response.py b/codegen_api_client/models/api_rate_limit_error_response.py new file mode 100644 index 0000000..f3a6355 --- /dev/null +++ b/codegen_api_client/models/api_rate_limit_error_response.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + 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, Optional +from typing import Optional, Set +from typing_extensions import Self + +class APIRateLimitErrorResponse(BaseModel): + """ + APIRateLimitErrorResponse + """ # noqa: E501 + message: Optional[StrictStr] = 'Rate limit exceeded. Please try again later.' + status_code: Optional[StrictInt] = 429 + __properties: ClassVar[List[str]] = ["message", "status_code"] + + 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 APIRateLimitErrorResponse 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 APIRateLimitErrorResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "message": obj.get("message") if obj.get("message") is not None else 'Rate limit exceeded. Please try again later.', + "status_code": obj.get("status_code") if obj.get("status_code") is not None else 429 + }) + return _obj + + diff --git a/codegen_api_client/models/check_suite_retry_stats_response.py b/codegen_api_client/models/check_suite_retry_stats_response.py new file mode 100644 index 0000000..44fbeab --- /dev/null +++ b/codegen_api_client/models/check_suite_retry_stats_response.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + 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 +from typing import Optional, Set +from typing_extensions import Self + +class CheckSuiteRetryStatsResponse(BaseModel): + """ + Response model for check suite retry statistics. + """ # noqa: E501 + repo_id: StrictInt = Field(description="Repository ID") + total_orchestrations: StrictInt = Field(description="Total number of orchestrations") + active_orchestrations: StrictInt = Field(description="Number of active orchestrations") + completed_orchestrations: StrictInt = Field(description="Number of completed orchestrations") + failed_orchestrations: StrictInt = Field(description="Number of failed orchestrations") + total_retry_attempts: StrictInt = Field(description="Total number of retry attempts across all checks") + checks_at_retry_limit: StrictInt = Field(description="Number of checks that have reached their retry limit") + __properties: ClassVar[List[str]] = ["repo_id", "total_orchestrations", "active_orchestrations", "completed_orchestrations", "failed_orchestrations", "total_retry_attempts", "checks_at_retry_limit"] + + 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 CheckSuiteRetryStatsResponse 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 CheckSuiteRetryStatsResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "repo_id": obj.get("repo_id"), + "total_orchestrations": obj.get("total_orchestrations"), + "active_orchestrations": obj.get("active_orchestrations"), + "completed_orchestrations": obj.get("completed_orchestrations"), + "failed_orchestrations": obj.get("failed_orchestrations"), + "total_retry_attempts": obj.get("total_retry_attempts"), + "checks_at_retry_limit": obj.get("checks_at_retry_limit") + }) + return _obj + + diff --git a/codegen_api_client/models/check_suite_settings_response.py b/codegen_api_client/models/check_suite_settings_response.py new file mode 100644 index 0000000..e8b91a8 --- /dev/null +++ b/codegen_api_client/models/check_suite_settings_response.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + 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_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class CheckSuiteSettingsResponse(BaseModel): + """ + Response model for check suite settings. + """ # noqa: E501 + retry_count: Annotated[int, Field(le=10, strict=True, ge=0)] = Field(description="Number of retry attempts for failed checks") + ignored_checks: List[StrictStr] = Field(description="List of check names to ignore") + __properties: ClassVar[List[str]] = ["retry_count", "ignored_checks"] + + 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 CheckSuiteSettingsResponse 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 CheckSuiteSettingsResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "retry_count": obj.get("retry_count"), + "ignored_checks": obj.get("ignored_checks") + }) + return _obj + + diff --git a/codegen_api_client/models/create_agent_run_input.py b/codegen_api_client/models/create_agent_run_input.py index 0f04f22..bc7c71e 100644 --- a/codegen_api_client/models/create_agent_run_input.py +++ b/codegen_api_client/models/create_agent_run_input.py @@ -17,8 +17,8 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self @@ -27,7 +27,11 @@ class CreateAgentRunInput(BaseModel): CreateAgentRunInput """ # noqa: E501 prompt: StrictStr - __properties: ClassVar[List[str]] = ["prompt"] + images: Optional[List[StrictStr]] = None + metadata: Optional[Dict[str, Any]] = None + repo_id: Optional[StrictInt] = None + model: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["prompt", "images", "metadata", "repo_id", "model"] model_config = ConfigDict( populate_by_name=True, @@ -68,6 +72,26 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # set to None if images (nullable) is None + # and model_fields_set contains the field + if self.images is None and "images" in self.model_fields_set: + _dict['images'] = None + + # set to None if metadata (nullable) is None + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: + _dict['metadata'] = None + + # set to None if repo_id (nullable) is None + # and model_fields_set contains the field + if self.repo_id is None and "repo_id" in self.model_fields_set: + _dict['repo_id'] = None + + # set to None if model (nullable) is None + # and model_fields_set contains the field + if self.model is None and "model" in self.model_fields_set: + _dict['model'] = None + return _dict @classmethod @@ -80,7 +104,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "prompt": obj.get("prompt") + "prompt": obj.get("prompt"), + "images": obj.get("images"), + "metadata": obj.get("metadata"), + "repo_id": obj.get("repo_id"), + "model": obj.get("model") }) return _obj diff --git a/codegen_api_client/models/github_pull_request_response.py b/codegen_api_client/models/github_pull_request_response.py new file mode 100644 index 0000000..941ef2d --- /dev/null +++ b/codegen_api_client/models/github_pull_request_response.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + 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 GithubPullRequestResponse(BaseModel): + """ + GithubPullRequestResponse + """ # noqa: E501 + id: StrictInt + title: StrictStr + url: StrictStr + created_at: StrictStr + __properties: ClassVar[List[str]] = ["id", "title", "url", "created_at"] + + 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 GithubPullRequestResponse 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 GithubPullRequestResponse 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"), + "title": obj.get("title"), + "url": obj.get("url"), + "created_at": obj.get("created_at") + }) + return _obj + + diff --git a/codegen_api_client/models/integration_status.py b/codegen_api_client/models/integration_status.py new file mode 100644 index 0000000..efb35ce --- /dev/null +++ b/codegen_api_client/models/integration_status.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + 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 IntegrationStatus(BaseModel): + """ + Status information for a single integration. + """ # noqa: E501 + integration_type: StrictStr = Field(description="Type of integration (e.g., 'github', 'slack', 'linear', etc.)") + active: StrictBool = Field(description="Whether the integration is currently active") + token_id: Optional[StrictInt] = None + installation_id: Optional[StrictInt] = None + metadata: Optional[Dict[str, Any]] = None + __properties: ClassVar[List[str]] = ["integration_type", "active", "token_id", "installation_id", "metadata"] + + 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 IntegrationStatus 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, + ) + # set to None if token_id (nullable) is None + # and model_fields_set contains the field + if self.token_id is None and "token_id" in self.model_fields_set: + _dict['token_id'] = None + + # set to None if installation_id (nullable) is None + # and model_fields_set contains the field + if self.installation_id is None and "installation_id" in self.model_fields_set: + _dict['installation_id'] = None + + # set to None if metadata (nullable) is None + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: + _dict['metadata'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IntegrationStatus from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "integration_type": obj.get("integration_type"), + "active": obj.get("active"), + "token_id": obj.get("token_id"), + "installation_id": obj.get("installation_id"), + "metadata": obj.get("metadata") + }) + return _obj + + diff --git a/codegen_api_client/models/no_repos_found_in_org_error_response.py b/codegen_api_client/models/no_repos_found_in_org_error_response.py new file mode 100644 index 0000000..f8db1ae --- /dev/null +++ b/codegen_api_client/models/no_repos_found_in_org_error_response.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + 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, Optional +from typing import Optional, Set +from typing_extensions import Self + +class NoReposFoundInOrgErrorResponse(BaseModel): + """ + NoReposFoundInOrgErrorResponse + """ # noqa: E501 + message: Optional[StrictStr] = 'No repos found in the organization. Please add some repos and try again.' + status_code: Optional[StrictInt] = 404 + __properties: ClassVar[List[str]] = ["message", "status_code"] + + 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 NoReposFoundInOrgErrorResponse 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 NoReposFoundInOrgErrorResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "message": obj.get("message") if obj.get("message") is not None else 'No repos found in the organization. Please add some repos and try again.', + "status_code": obj.get("status_code") if obj.get("status_code") is not None else 404 + }) + return _obj + + diff --git a/codegen_api_client/models/observation.py b/codegen_api_client/models/observation.py new file mode 100644 index 0000000..18b0995 --- /dev/null +++ b/codegen_api_client/models/observation.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Dict, Optional +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +OBSERVATION_ANY_OF_SCHEMAS = ["Dict[str, object]", "str"] + +class Observation(BaseModel): + """ + Observation + """ + + # data type: Dict[str, object] + anyof_schema_1_validator: Optional[Dict[str, Any]] = None + # data type: str + anyof_schema_2_validator: Optional[StrictStr] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[Dict[str, object], str]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "Dict[str, object]", "str" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + if v is None: + return v + + instance = Observation.model_construct() + error_messages = [] + # validate data type: Dict[str, object] + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: str + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Observation with anyOf schemas: Dict[str, object], str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + if json_str is None: + return instance + + error_messages = [] + # deserialize data into Dict[str, object] + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into str + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Observation with anyOf schemas: Dict[str, object], str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], Dict[str, object], str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/codegen_api_client/models/organization_integrations_response.py b/codegen_api_client/models/organization_integrations_response.py new file mode 100644 index 0000000..2cdc982 --- /dev/null +++ b/codegen_api_client/models/organization_integrations_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + 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 codegen_api_client.models.integration_status import IntegrationStatus +from typing import Optional, Set +from typing_extensions import Self + +class OrganizationIntegrationsResponse(BaseModel): + """ + Response schema for organization integrations. + """ # noqa: E501 + organization_id: StrictInt = Field(description="ID of the organization") + organization_name: StrictStr = Field(description="Name of the organization") + integrations: List[IntegrationStatus] = Field(description="List of integration statuses") + total_active_integrations: StrictInt = Field(description="Total number of active integrations") + __properties: ClassVar[List[str]] = ["organization_id", "organization_name", "integrations", "total_active_integrations"] + + 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 OrganizationIntegrationsResponse 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 integrations (list) + _items = [] + if self.integrations: + for _item_integrations in self.integrations: + if _item_integrations: + _items.append(_item_integrations.to_dict()) + _dict['integrations'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OrganizationIntegrationsResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "organization_id": obj.get("organization_id"), + "organization_name": obj.get("organization_name"), + "integrations": [IntegrationStatus.from_dict(_item) for _item in obj["integrations"]] if obj.get("integrations") is not None else None, + "total_active_integrations": obj.get("total_active_integrations") + }) + return _obj + + diff --git a/codegen_api_client/models/page_agent_run_response.py b/codegen_api_client/models/page_agent_run_response.py new file mode 100644 index 0000000..d5b4ff1 --- /dev/null +++ b/codegen_api_client/models/page_agent_run_response.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + 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 codegen_api_client.models.agent_run_response import AgentRunResponse +from typing import Optional, Set +from typing_extensions import Self + +class PageAgentRunResponse(BaseModel): + """ + PageAgentRunResponse + """ # noqa: E501 + items: List[AgentRunResponse] + total: StrictInt + page: StrictInt + size: StrictInt + pages: StrictInt + __properties: ClassVar[List[str]] = ["items", "total", "page", "size", "pages"] + + 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 PageAgentRunResponse 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 PageAgentRunResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "items": [AgentRunResponse.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, + "total": obj.get("total"), + "page": obj.get("page"), + "size": obj.get("size"), + "pages": obj.get("pages") + }) + return _obj + + diff --git a/codegen_api_client/models/page_repo_response.py b/codegen_api_client/models/page_repo_response.py new file mode 100644 index 0000000..5146a60 --- /dev/null +++ b/codegen_api_client/models/page_repo_response.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + 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 codegen_api_client.models.repo_response import RepoResponse +from typing import Optional, Set +from typing_extensions import Self + +class PageRepoResponse(BaseModel): + """ + PageRepoResponse + """ # noqa: E501 + items: List[RepoResponse] + total: StrictInt + page: StrictInt + size: StrictInt + pages: StrictInt + __properties: ClassVar[List[str]] = ["items", "total", "page", "size", "pages"] + + 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 PageRepoResponse 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 PageRepoResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "items": [RepoResponse.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, + "total": obj.get("total"), + "page": obj.get("page"), + "size": obj.get("size"), + "pages": obj.get("pages") + }) + return _obj + + diff --git a/codegen_api_client/models/permissions_error_response.py b/codegen_api_client/models/permissions_error_response.py new file mode 100644 index 0000000..9666ae4 --- /dev/null +++ b/codegen_api_client/models/permissions_error_response.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + 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, Optional +from typing import Optional, Set +from typing_extensions import Self + +class PermissionsErrorResponse(BaseModel): + """ + PermissionsErrorResponse + """ # noqa: E501 + message: Optional[StrictStr] = 'You do not have access to this organization.' + status_code: Optional[StrictInt] = 403 + __properties: ClassVar[List[str]] = ["message", "status_code"] + + 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 PermissionsErrorResponse 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 PermissionsErrorResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "message": obj.get("message") if obj.get("message") is not None else 'You do not have access to this organization.', + "status_code": obj.get("status_code") if obj.get("status_code") is not None else 403 + }) + return _obj + + diff --git a/codegen_api_client/models/repo_response.py b/codegen_api_client/models/repo_response.py new file mode 100644 index 0000000..99e74c5 --- /dev/null +++ b/codegen_api_client/models/repo_response.py @@ -0,0 +1,125 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + 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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class RepoResponse(BaseModel): + """ + Represents a repository in API responses + """ # noqa: E501 + id: StrictInt + name: StrictStr + full_name: StrictStr + description: Optional[StrictStr] + github_id: StrictStr + organization_id: StrictInt + visibility: Optional[StrictStr] + archived: Optional[StrictBool] + setup_status: StrictStr + language: Optional[StrictStr] + __properties: ClassVar[List[str]] = ["id", "name", "full_name", "description", "github_id", "organization_id", "visibility", "archived", "setup_status", "language"] + + 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 RepoResponse 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, + ) + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if visibility (nullable) is None + # and model_fields_set contains the field + if self.visibility is None and "visibility" in self.model_fields_set: + _dict['visibility'] = None + + # set to None if archived (nullable) is None + # and model_fields_set contains the field + if self.archived is None and "archived" in self.model_fields_set: + _dict['archived'] = None + + # set to None if language (nullable) is None + # and model_fields_set contains the field + if self.language is None and "language" in self.model_fields_set: + _dict['language'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RepoResponse 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"), + "full_name": obj.get("full_name"), + "description": obj.get("description"), + "github_id": obj.get("github_id"), + "organization_id": obj.get("organization_id"), + "visibility": obj.get("visibility"), + "archived": obj.get("archived"), + "setup_status": obj.get("setup_status"), + "language": obj.get("language") + }) + return _obj + + diff --git a/codegen_api_client/models/resume_agent_run_input.py b/codegen_api_client/models/resume_agent_run_input.py new file mode 100644 index 0000000..84a8213 --- /dev/null +++ b/codegen_api_client/models/resume_agent_run_input.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + 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, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ResumeAgentRunInput(BaseModel): + """ + ResumeAgentRunInput + """ # noqa: E501 + agent_run_id: StrictInt + prompt: StrictStr + images: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["agent_run_id", "prompt", "images"] + + 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 ResumeAgentRunInput 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, + ) + # set to None if images (nullable) is None + # and model_fields_set contains the field + if self.images is None and "images" in self.model_fields_set: + _dict['images'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ResumeAgentRunInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agent_run_id": obj.get("agent_run_id"), + "prompt": obj.get("prompt"), + "images": obj.get("images") + }) + return _obj + + diff --git a/codegen_api_client/models/stop_agent_run_input.py b/codegen_api_client/models/stop_agent_run_input.py new file mode 100644 index 0000000..8df9f80 --- /dev/null +++ b/codegen_api_client/models/stop_agent_run_input.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + 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 StopAgentRunInput(BaseModel): + """ + StopAgentRunInput + """ # noqa: E501 + agent_run_id: StrictInt + __properties: ClassVar[List[str]] = ["agent_run_id"] + + 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 StopAgentRunInput 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 StopAgentRunInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agent_run_id": obj.get("agent_run_id") + }) + return _obj + + diff --git a/codegen_api_client/models/tool_execution_request.py b/codegen_api_client/models/tool_execution_request.py new file mode 100644 index 0000000..61640d8 --- /dev/null +++ b/codegen_api_client/models/tool_execution_request.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + 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 ToolExecutionRequest(BaseModel): + """ + Request schema for tool execution. + """ # noqa: E501 + tool_name: StrictStr = Field(description="Name of the tool to execute") + arguments: Dict[str, Any] = Field(description="JSON arguments to pass to the tool") + repo_id: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["tool_name", "arguments", "repo_id"] + + 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 ToolExecutionRequest 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, + ) + # set to None if repo_id (nullable) is None + # and model_fields_set contains the field + if self.repo_id is None and "repo_id" in self.model_fields_set: + _dict['repo_id'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ToolExecutionRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tool_name": obj.get("tool_name"), + "arguments": obj.get("arguments"), + "repo_id": obj.get("repo_id") + }) + return _obj + + diff --git a/codegen_api_client/models/tool_execution_response.py b/codegen_api_client/models/tool_execution_response.py new file mode 100644 index 0000000..68c0dd5 --- /dev/null +++ b/codegen_api_client/models/tool_execution_response.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + 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, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self + +class ToolExecutionResponse(BaseModel): + """ + Response schema for tool execution. + """ # noqa: E501 + success: StrictBool = Field(description="Whether the tool execution was successful") + result: Optional[Any] = None + error: Optional[StrictStr] = None + tool_name: StrictStr = Field(description="Name of the executed tool") + execution_time_ms: Optional[Union[StrictFloat, StrictInt]] = None + __properties: ClassVar[List[str]] = ["success", "result", "error", "tool_name", "execution_time_ms"] + + 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 ToolExecutionResponse 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, + ) + # set to None if result (nullable) is None + # and model_fields_set contains the field + if self.result is None and "result" in self.model_fields_set: + _dict['result'] = None + + # set to None if error (nullable) is None + # and model_fields_set contains the field + if self.error is None and "error" in self.model_fields_set: + _dict['error'] = None + + # set to None if execution_time_ms (nullable) is None + # and model_fields_set contains the field + if self.execution_time_ms is None and "execution_time_ms" in self.model_fields_set: + _dict['execution_time_ms'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ToolExecutionResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "success": obj.get("success"), + "result": obj.get("result"), + "error": obj.get("error"), + "tool_name": obj.get("tool_name"), + "execution_time_ms": obj.get("execution_time_ms") + }) + return _obj + + diff --git a/codegen_api_client/models/update_check_suite_settings_request.py b/codegen_api_client/models/update_check_suite_settings_request.py new file mode 100644 index 0000000..48604ed --- /dev/null +++ b/codegen_api_client/models/update_check_suite_settings_request.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + 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_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class UpdateCheckSuiteSettingsRequest(BaseModel): + """ + Request model for updating check suite settings. + """ # noqa: E501 + retry_count: Optional[Annotated[int, Field(le=10, strict=True, ge=0)]] = None + ignored_checks: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["retry_count", "ignored_checks"] + + 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 UpdateCheckSuiteSettingsRequest 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, + ) + # set to None if retry_count (nullable) is None + # and model_fields_set contains the field + if self.retry_count is None and "retry_count" in self.model_fields_set: + _dict['retry_count'] = None + + # set to None if ignored_checks (nullable) is None + # and model_fields_set contains the field + if self.ignored_checks is None and "ignored_checks" in self.model_fields_set: + _dict['ignored_checks'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateCheckSuiteSettingsRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "retry_count": obj.get("retry_count"), + "ignored_checks": obj.get("ignored_checks") + }) + return _obj + + diff --git a/codegen_api_client/models/user_not_found_error_response.py b/codegen_api_client/models/user_not_found_error_response.py new file mode 100644 index 0000000..a820d48 --- /dev/null +++ b/codegen_api_client/models/user_not_found_error_response.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + 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, Optional +from typing import Optional, Set +from typing_extensions import Self + +class UserNotFoundErrorResponse(BaseModel): + """ + UserNotFoundErrorResponse + """ # noqa: E501 + message: Optional[StrictStr] = 'User not found.' + status_code: Optional[StrictInt] = 404 + __properties: ClassVar[List[str]] = ["message", "status_code"] + + 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 UserNotFoundErrorResponse 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 UserNotFoundErrorResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "message": obj.get("message") if obj.get("message") is not None else 'User not found.', + "status_code": obj.get("status_code") if obj.get("status_code") is not None else 404 + }) + return _obj + + diff --git a/codegen_api_client/models/user_response.py b/codegen_api_client/models/user_response.py index ea9d4a8..3c44d28 100644 --- a/codegen_api_client/models/user_response.py +++ b/codegen_api_client/models/user_response.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +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 @@ -26,13 +26,15 @@ class UserResponse(BaseModel): """ Represents a user in API responses """ # noqa: E501 - id: StrictInt - email: Optional[StrictStr] - github_user_id: StrictStr - github_username: StrictStr - avatar_url: Optional[StrictStr] - full_name: Optional[StrictStr] - __properties: ClassVar[List[str]] = ["id", "email", "github_user_id", "github_username", "avatar_url", "full_name"] + id: StrictInt = Field(description="Unique user ID") + email: Optional[StrictStr] = None + github_user_id: StrictStr = Field(description="GitHub user ID") + github_username: StrictStr = Field(description="GitHub username") + avatar_url: Optional[StrictStr] = None + full_name: Optional[StrictStr] = None + role: Optional[StrictStr] = None + is_admin: Optional[StrictBool] = None + __properties: ClassVar[List[str]] = ["id", "email", "github_user_id", "github_username", "avatar_url", "full_name", "role", "is_admin"] model_config = ConfigDict( populate_by_name=True, @@ -88,6 +90,16 @@ def to_dict(self) -> Dict[str, Any]: if self.full_name is None and "full_name" in self.model_fields_set: _dict['full_name'] = None + # set to None if role (nullable) is None + # and model_fields_set contains the field + if self.role is None and "role" in self.model_fields_set: + _dict['role'] = None + + # set to None if is_admin (nullable) is None + # and model_fields_set contains the field + if self.is_admin is None and "is_admin" in self.model_fields_set: + _dict['is_admin'] = None + return _dict @classmethod @@ -105,7 +117,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "github_user_id": obj.get("github_user_id"), "github_username": obj.get("github_username"), "avatar_url": obj.get("avatar_url"), - "full_name": obj.get("full_name") + "full_name": obj.get("full_name"), + "role": obj.get("role"), + "is_admin": obj.get("is_admin") }) return _obj diff --git a/docs/APIRateLimitErrorResponse.md b/docs/APIRateLimitErrorResponse.md new file mode 100644 index 0000000..11e3e10 --- /dev/null +++ b/docs/APIRateLimitErrorResponse.md @@ -0,0 +1,30 @@ +# APIRateLimitErrorResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **str** | | [optional] [default to 'Rate limit exceeded. Please try again later.'] +**status_code** | **int** | | [optional] [default to 429] + +## Example + +```python +from codegen_api_client.models.api_rate_limit_error_response import APIRateLimitErrorResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of APIRateLimitErrorResponse from a JSON string +api_rate_limit_error_response_instance = APIRateLimitErrorResponse.from_json(json) +# print the JSON string representation of the object +print(APIRateLimitErrorResponse.to_json()) + +# convert the object into a dict +api_rate_limit_error_response_dict = api_rate_limit_error_response_instance.to_dict() +# create an instance of APIRateLimitErrorResponse from a dict +api_rate_limit_error_response_from_dict = APIRateLimitErrorResponse.from_dict(api_rate_limit_error_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/docs/AgentRunLimitReachedErrorResponse.md b/docs/AgentRunLimitReachedErrorResponse.md new file mode 100644 index 0000000..d70a572 --- /dev/null +++ b/docs/AgentRunLimitReachedErrorResponse.md @@ -0,0 +1,30 @@ +# AgentRunLimitReachedErrorResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **str** | | [optional] [default to 'Alloted agent runs for the current billing plan have been reached. Please upgrade your plan to continue.'] +**status_code** | **int** | | [optional] [default to 402] + +## Example + +```python +from codegen_api_client.models.agent_run_limit_reached_error_response import AgentRunLimitReachedErrorResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentRunLimitReachedErrorResponse from a JSON string +agent_run_limit_reached_error_response_instance = AgentRunLimitReachedErrorResponse.from_json(json) +# print the JSON string representation of the object +print(AgentRunLimitReachedErrorResponse.to_json()) + +# convert the object into a dict +agent_run_limit_reached_error_response_dict = agent_run_limit_reached_error_response_instance.to_dict() +# create an instance of AgentRunLimitReachedErrorResponse from a dict +agent_run_limit_reached_error_response_from_dict = AgentRunLimitReachedErrorResponse.from_dict(agent_run_limit_reached_error_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/docs/AgentRunLogResponse.md b/docs/AgentRunLogResponse.md new file mode 100644 index 0000000..6bb880d --- /dev/null +++ b/docs/AgentRunLogResponse.md @@ -0,0 +1,37 @@ +# AgentRunLogResponse + +Represents an agent run log in API responses + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_run_id** | **int** | | +**created_at** | **str** | | [optional] +**tool_name** | **str** | | [optional] +**message_type** | **str** | | [optional] +**thought** | **str** | | [optional] +**observation** | [**Observation**](Observation.md) | | [optional] +**tool_input** | **Dict[str, object]** | | [optional] +**tool_output** | **Dict[str, object]** | | [optional] + +## Example + +```python +from codegen_api_client.models.agent_run_log_response import AgentRunLogResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentRunLogResponse from a JSON string +agent_run_log_response_instance = AgentRunLogResponse.from_json(json) +# print the JSON string representation of the object +print(AgentRunLogResponse.to_json()) + +# convert the object into a dict +agent_run_log_response_dict = agent_run_log_response_instance.to_dict() +# create an instance of AgentRunLogResponse from a dict +agent_run_log_response_from_dict = AgentRunLogResponse.from_dict(agent_run_log_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/docs/AgentRunNotFoundErrorResponse.md b/docs/AgentRunNotFoundErrorResponse.md new file mode 100644 index 0000000..0b70f0d --- /dev/null +++ b/docs/AgentRunNotFoundErrorResponse.md @@ -0,0 +1,30 @@ +# AgentRunNotFoundErrorResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **str** | | [optional] [default to 'Agent run not found.'] +**status_code** | **int** | | [optional] [default to 404] + +## Example + +```python +from codegen_api_client.models.agent_run_not_found_error_response import AgentRunNotFoundErrorResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentRunNotFoundErrorResponse from a JSON string +agent_run_not_found_error_response_instance = AgentRunNotFoundErrorResponse.from_json(json) +# print the JSON string representation of the object +print(AgentRunNotFoundErrorResponse.to_json()) + +# convert the object into a dict +agent_run_not_found_error_response_dict = agent_run_not_found_error_response_instance.to_dict() +# create an instance of AgentRunNotFoundErrorResponse from a dict +agent_run_not_found_error_response_from_dict = AgentRunNotFoundErrorResponse.from_dict(agent_run_not_found_error_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/docs/AgentRunResponse.md b/docs/AgentRunResponse.md index c20a290..5da62f3 100644 --- a/docs/AgentRunResponse.md +++ b/docs/AgentRunResponse.md @@ -12,6 +12,9 @@ Name | Type | Description | Notes **created_at** | **str** | | [optional] **web_url** | **str** | | [optional] **result** | **str** | | [optional] +**source_type** | [**ApiAgentRunSourceType**](ApiAgentRunSourceType.md) | | [optional] +**github_pull_requests** | [**List[GithubPullRequestResponse]**](GithubPullRequestResponse.md) | | [optional] +**metadata** | **Dict[str, object]** | | [optional] ## Example diff --git a/docs/AgentRunWithLogsResponse.md b/docs/AgentRunWithLogsResponse.md new file mode 100644 index 0000000..8f6bc84 --- /dev/null +++ b/docs/AgentRunWithLogsResponse.md @@ -0,0 +1,41 @@ +# AgentRunWithLogsResponse + +Represents an agent run in API responses + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | +**organization_id** | **int** | | +**status** | **str** | | [optional] +**created_at** | **str** | | [optional] +**web_url** | **str** | | [optional] +**result** | **str** | | [optional] +**metadata** | **Dict[str, object]** | | [optional] +**logs** | [**List[AgentRunLogResponse]**](AgentRunLogResponse.md) | | +**total_logs** | **int** | | [optional] +**page** | **int** | | [optional] +**size** | **int** | | [optional] +**pages** | **int** | | [optional] + +## Example + +```python +from codegen_api_client.models.agent_run_with_logs_response import AgentRunWithLogsResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentRunWithLogsResponse from a JSON string +agent_run_with_logs_response_instance = AgentRunWithLogsResponse.from_json(json) +# print the JSON string representation of the object +print(AgentRunWithLogsResponse.to_json()) + +# convert the object into a dict +agent_run_with_logs_response_dict = agent_run_with_logs_response_instance.to_dict() +# create an instance of AgentRunWithLogsResponse from a dict +agent_run_with_logs_response_from_dict = AgentRunWithLogsResponse.from_dict(agent_run_with_logs_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/docs/AgentsAlphaApi.md b/docs/AgentsAlphaApi.md new file mode 100644 index 0000000..054ee30 --- /dev/null +++ b/docs/AgentsAlphaApi.md @@ -0,0 +1,182 @@ +# codegen_api_client.AgentsAlphaApi + +All URIs are relative to *https://api.codegen.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get**](AgentsAlphaApi.md#get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get) | **GET** /v1/alpha/organizations/{org_id}/agent/run/{agent_run_id}/logs | Get Agent Run Logs +[**get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get_0**](AgentsAlphaApi.md#get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get_0) | **GET** /v1/alpha/organizations/{org_id}/agent/run/{agent_run_id}/logs | Get Agent Run Logs + + +# **get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get** +> AgentRunWithLogsResponse get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get(agent_run_id, org_id, skip=skip, limit=limit, authorization=authorization) + +Get Agent Run Logs + +Retrieve an agent run with its logs using pagination. This endpoint is currently in ALPHA and IS subject to change. + +Returns the agent run details along with a paginated list of logs for the specified agent run. +The agent run must belong to the specified organization. Logs are returned in chronological order. +Uses standard pagination parameters (skip and limit) and includes pagination metadata in the response. + +Rate limit: 60 requests per 60 seconds. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.agent_run_with_logs_response import AgentRunWithLogsResponse +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.AgentsAlphaApi(api_client) + agent_run_id = 56 # int | + org_id = 56 # int | + skip = 0 # int | (optional) (default to 0) + limit = 100 # int | (optional) (default to 100) + authorization = None # object | (optional) + + try: + # Get Agent Run Logs + api_response = api_instance.get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get(agent_run_id, org_id, skip=skip, limit=limit, authorization=authorization) + print("The response of AgentsAlphaApi->get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentsAlphaApi->get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **agent_run_id** | **int**| | + **org_id** | **int**| | + **skip** | **int**| | [optional] [default to 0] + **limit** | **int**| | [optional] [default to 100] + **authorization** | [**object**](.md)| | [optional] + +### Return type + +[**AgentRunWithLogsResponse**](AgentRunWithLogsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get_0** +> AgentRunWithLogsResponse get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get_0(agent_run_id, org_id, skip=skip, limit=limit, authorization=authorization) + +Get Agent Run Logs + +Retrieve an agent run with its logs using pagination. This endpoint is currently in ALPHA and IS subject to change. + +Returns the agent run details along with a paginated list of logs for the specified agent run. +The agent run must belong to the specified organization. Logs are returned in chronological order. +Uses standard pagination parameters (skip and limit) and includes pagination metadata in the response. + +Rate limit: 60 requests per 60 seconds. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.agent_run_with_logs_response import AgentRunWithLogsResponse +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.AgentsAlphaApi(api_client) + agent_run_id = 56 # int | + org_id = 56 # int | + skip = 0 # int | (optional) (default to 0) + limit = 100 # int | (optional) (default to 100) + authorization = None # object | (optional) + + try: + # Get Agent Run Logs + api_response = api_instance.get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get_0(agent_run_id, org_id, skip=skip, limit=limit, authorization=authorization) + print("The response of AgentsAlphaApi->get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get_0:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentsAlphaApi->get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get_0: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **agent_run_id** | **int**| | + **org_id** | **int**| | + **skip** | **int**| | [optional] [default to 0] + **limit** | **int**| | [optional] [default to 100] + **authorization** | [**object**](.md)| | [optional] + +### Return type + +[**AgentRunWithLogsResponse**](AgentRunWithLogsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/AgentsApi.md b/docs/AgentsApi.md index fb87b27..3e30c1f 100644 --- a/docs/AgentsApi.md +++ b/docs/AgentsApi.md @@ -1,17 +1,272 @@ # codegen_api_client.AgentsApi -All URIs are relative to *http://localhost* +All URIs are relative to *https://api.codegen.com* Method | HTTP request | Description ------------- | ------------- | ------------- +[**ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post**](AgentsApi.md#ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post) | **POST** /v1/organizations/{org_id}/agent/run/ban | Ban All Checks For Agent Run +[**ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_0**](AgentsApi.md#ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_0) | **POST** /v1/organizations/{org_id}/agent/run/ban | Ban All Checks For Agent Run +[**ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_1**](AgentsApi.md#ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_1) | **POST** /v1/organizations/{org_id}/agent/run/ban | Ban All Checks For Agent Run [**create_agent_run_v1_organizations_org_id_agent_run_post**](AgentsApi.md#create_agent_run_v1_organizations_org_id_agent_run_post) | **POST** /v1/organizations/{org_id}/agent/run | Create Agent Run [**create_agent_run_v1_organizations_org_id_agent_run_post_0**](AgentsApi.md#create_agent_run_v1_organizations_org_id_agent_run_post_0) | **POST** /v1/organizations/{org_id}/agent/run | Create Agent Run [**create_agent_run_v1_organizations_org_id_agent_run_post_1**](AgentsApi.md#create_agent_run_v1_organizations_org_id_agent_run_post_1) | **POST** /v1/organizations/{org_id}/agent/run | Create Agent Run [**get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get**](AgentsApi.md#get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get) | **GET** /v1/organizations/{org_id}/agent/run/{agent_run_id} | Get Agent Run [**get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_0**](AgentsApi.md#get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_0) | **GET** /v1/organizations/{org_id}/agent/run/{agent_run_id} | Get Agent Run [**get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_1**](AgentsApi.md#get_agent_run_v1_organizations_org_id_agent_run_agent_run_id_get_1) | **GET** /v1/organizations/{org_id}/agent/run/{agent_run_id} | Get Agent Run +[**list_agent_runs_v1_organizations_org_id_agent_runs_get**](AgentsApi.md#list_agent_runs_v1_organizations_org_id_agent_runs_get) | **GET** /v1/organizations/{org_id}/agent/runs | List Agent Runs +[**list_agent_runs_v1_organizations_org_id_agent_runs_get_0**](AgentsApi.md#list_agent_runs_v1_organizations_org_id_agent_runs_get_0) | **GET** /v1/organizations/{org_id}/agent/runs | List Agent Runs +[**list_agent_runs_v1_organizations_org_id_agent_runs_get_1**](AgentsApi.md#list_agent_runs_v1_organizations_org_id_agent_runs_get_1) | **GET** /v1/organizations/{org_id}/agent/runs | List Agent Runs +[**remove_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post**](AgentsApi.md#remove_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post) | **POST** /v1/organizations/{org_id}/agent/run/remove-from-pr | Remove Codegen From Pr +[**remove_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_0**](AgentsApi.md#remove_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_0) | **POST** /v1/organizations/{org_id}/agent/run/remove-from-pr | Remove Codegen From Pr +[**remove_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_1**](AgentsApi.md#remove_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_1) | **POST** /v1/organizations/{org_id}/agent/run/remove-from-pr | Remove Codegen From Pr +[**resume_agent_run_v1_organizations_org_id_agent_run_resume_post**](AgentsApi.md#resume_agent_run_v1_organizations_org_id_agent_run_resume_post) | **POST** /v1/organizations/{org_id}/agent/run/resume | Resume Agent Run +[**resume_agent_run_v1_organizations_org_id_agent_run_resume_post_0**](AgentsApi.md#resume_agent_run_v1_organizations_org_id_agent_run_resume_post_0) | **POST** /v1/organizations/{org_id}/agent/run/resume | Resume Agent Run +[**resume_agent_run_v1_organizations_org_id_agent_run_resume_post_1**](AgentsApi.md#resume_agent_run_v1_organizations_org_id_agent_run_resume_post_1) | **POST** /v1/organizations/{org_id}/agent/run/resume | Resume Agent Run +[**unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post**](AgentsApi.md#unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post) | **POST** /v1/organizations/{org_id}/agent/run/unban | Unban All Checks For Agent Run +[**unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_0**](AgentsApi.md#unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_0) | **POST** /v1/organizations/{org_id}/agent/run/unban | Unban All Checks For Agent Run +[**unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_1**](AgentsApi.md#unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_1) | **POST** /v1/organizations/{org_id}/agent/run/unban | Unban All Checks For Agent Run +# **ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post** +> object ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post(org_id, stop_agent_run_input, authorization=authorization) + +Ban All Checks For Agent Run + +Ban all checks for a PR and stop all related agents. + +This endpoint: +1. Flags the PR to prevent future CI/CD check suite events from being processed +2. Stops all current agents for that PR + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.stop_agent_run_input import StopAgentRunInput +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.AgentsApi(api_client) + org_id = 56 # int | + stop_agent_run_input = codegen_api_client.StopAgentRunInput() # StopAgentRunInput | + authorization = None # object | (optional) + + try: + # Ban All Checks For Agent Run + api_response = api_instance.ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post(org_id, stop_agent_run_input, authorization=authorization) + print("The response of AgentsApi->ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentsApi->ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **stop_agent_run_input** | [**StopAgentRunInput**](StopAgentRunInput.md)| | + **authorization** | [**object**](.md)| | [optional] + +### Return type + +**object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_0** +> object ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_0(org_id, stop_agent_run_input, authorization=authorization) + +Ban All Checks For Agent Run + +Ban all checks for a PR and stop all related agents. + +This endpoint: +1. Flags the PR to prevent future CI/CD check suite events from being processed +2. Stops all current agents for that PR + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.stop_agent_run_input import StopAgentRunInput +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.AgentsApi(api_client) + org_id = 56 # int | + stop_agent_run_input = codegen_api_client.StopAgentRunInput() # StopAgentRunInput | + authorization = None # object | (optional) + + try: + # Ban All Checks For Agent Run + api_response = api_instance.ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_0(org_id, stop_agent_run_input, authorization=authorization) + print("The response of AgentsApi->ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_0:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentsApi->ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_0: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **stop_agent_run_input** | [**StopAgentRunInput**](StopAgentRunInput.md)| | + **authorization** | [**object**](.md)| | [optional] + +### Return type + +**object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_1** +> object ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_1(org_id, stop_agent_run_input, authorization=authorization) + +Ban All Checks For Agent Run + +Ban all checks for a PR and stop all related agents. + +This endpoint: +1. Flags the PR to prevent future CI/CD check suite events from being processed +2. Stops all current agents for that PR + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.stop_agent_run_input import StopAgentRunInput +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.AgentsApi(api_client) + org_id = 56 # int | + stop_agent_run_input = codegen_api_client.StopAgentRunInput() # StopAgentRunInput | + authorization = None # object | (optional) + + try: + # Ban All Checks For Agent Run + api_response = api_instance.ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_1(org_id, stop_agent_run_input, authorization=authorization) + print("The response of AgentsApi->ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_1:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentsApi->ban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_ban_post_1: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **stop_agent_run_input** | [**StopAgentRunInput**](StopAgentRunInput.md)| | + **authorization** | [**object**](.md)| | [optional] + +### Return type + +**object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **create_agent_run_v1_organizations_org_id_agent_run_post** > AgentRunResponse create_agent_run_v1_organizations_org_id_agent_run_post(org_id, create_agent_run_input, authorization=authorization) @@ -24,6 +279,10 @@ The process will complete asynchronously, and the response contains the agent ru which can be used to check the status later. The requesting user must be a member of the specified organization. +This endpoint accepts both a text prompt and an optional image file upload. + +Rate limit: 10 requests per minute. + ### Example @@ -34,10 +293,10 @@ from codegen_api_client.models.create_agent_run_input import CreateAgentRunInput from codegen_api_client.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to http://localhost +# Defining the host is optional and defaults to https://api.codegen.com # See configuration.py for a list of all supported configuration parameters. configuration = codegen_api_client.Configuration( - host = "http://localhost" + host = "https://api.codegen.com" ) @@ -87,8 +346,11 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Successful Response | - | -**422** | Validation Error | - | **429** | Too Many Requests | - | +**402** | Payment Required | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Validation Error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -104,6 +366,10 @@ The process will complete asynchronously, and the response contains the agent ru which can be used to check the status later. The requesting user must be a member of the specified organization. +This endpoint accepts both a text prompt and an optional image file upload. + +Rate limit: 10 requests per minute. + ### Example @@ -114,10 +380,10 @@ from codegen_api_client.models.create_agent_run_input import CreateAgentRunInput from codegen_api_client.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to http://localhost +# Defining the host is optional and defaults to https://api.codegen.com # See configuration.py for a list of all supported configuration parameters. configuration = codegen_api_client.Configuration( - host = "http://localhost" + host = "https://api.codegen.com" ) @@ -167,8 +433,11 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Successful Response | - | -**422** | Validation Error | - | **429** | Too Many Requests | - | +**402** | Payment Required | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Validation Error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -184,6 +453,10 @@ The process will complete asynchronously, and the response contains the agent ru which can be used to check the status later. The requesting user must be a member of the specified organization. +This endpoint accepts both a text prompt and an optional image file upload. + +Rate limit: 10 requests per minute. + ### Example @@ -194,10 +467,10 @@ from codegen_api_client.models.create_agent_run_input import CreateAgentRunInput from codegen_api_client.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to http://localhost +# Defining the host is optional and defaults to https://api.codegen.com # See configuration.py for a list of all supported configuration parameters. configuration = codegen_api_client.Configuration( - host = "http://localhost" + host = "https://api.codegen.com" ) @@ -247,8 +520,11 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Successful Response | - | -**422** | Validation Error | - | **429** | Too Many Requests | - | +**402** | Payment Required | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Validation Error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -263,6 +539,8 @@ Returns the current status, progress, and any available results for the specifie The agent run must belong to the specified organization. If the agent run is still in progress, this endpoint can be polled to check for completion. +Rate limit: 60 requests per 30 seconds. + ### Example @@ -272,10 +550,10 @@ from codegen_api_client.models.agent_run_response import AgentRunResponse from codegen_api_client.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to http://localhost +# Defining the host is optional and defaults to https://api.codegen.com # See configuration.py for a list of all supported configuration parameters. configuration = codegen_api_client.Configuration( - host = "http://localhost" + host = "https://api.codegen.com" ) @@ -325,8 +603,10 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Successful Response | - | -**422** | Validation Error | - | **429** | Too Many Requests | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Validation Error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -341,6 +621,8 @@ Returns the current status, progress, and any available results for the specifie The agent run must belong to the specified organization. If the agent run is still in progress, this endpoint can be polled to check for completion. +Rate limit: 60 requests per 30 seconds. + ### Example @@ -350,10 +632,10 @@ from codegen_api_client.models.agent_run_response import AgentRunResponse from codegen_api_client.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to http://localhost +# Defining the host is optional and defaults to https://api.codegen.com # See configuration.py for a list of all supported configuration parameters. configuration = codegen_api_client.Configuration( - host = "http://localhost" + host = "https://api.codegen.com" ) @@ -403,8 +685,10 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Successful Response | - | -**422** | Validation Error | - | **429** | Too Many Requests | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Validation Error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -419,6 +703,8 @@ Returns the current status, progress, and any available results for the specifie The agent run must belong to the specified organization. If the agent run is still in progress, this endpoint can be polled to check for completion. +Rate limit: 60 requests per 30 seconds. + ### Example @@ -428,10 +714,10 @@ from codegen_api_client.models.agent_run_response import AgentRunResponse from codegen_api_client.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to http://localhost +# Defining the host is optional and defaults to https://api.codegen.com # See configuration.py for a list of all supported configuration parameters. configuration = codegen_api_client.Configuration( - host = "http://localhost" + host = "https://api.codegen.com" ) @@ -481,8 +767,994 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Successful Response | - | -**422** | Validation Error | - | **429** | Too Many Requests | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_agent_runs_v1_organizations_org_id_agent_runs_get** +> PageAgentRunResponse list_agent_runs_v1_organizations_org_id_agent_runs_get(org_id, user_id=user_id, source_type=source_type, skip=skip, limit=limit, authorization=authorization) + +List Agent Runs + +List agent runs for an organization with optional user filtering. + +Returns a paginated list of agent runs for the specified organization. +Optionally filter by user_id to get only agent runs initiated by a specific user. +Results are ordered by creation date (newest first). + +Rate limit: 60 requests per 30 seconds. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.api_agent_run_source_type import ApiAgentRunSourceType +from codegen_api_client.models.page_agent_run_response import PageAgentRunResponse +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.AgentsApi(api_client) + org_id = 56 # int | + user_id = 56 # int | Filter by user ID who initiated the agent runs (optional) + source_type = codegen_api_client.ApiAgentRunSourceType() # ApiAgentRunSourceType | Filter by source type of the agent runs (optional) + skip = 0 # int | (optional) (default to 0) + limit = 100 # int | (optional) (default to 100) + authorization = None # object | (optional) + + try: + # List Agent Runs + api_response = api_instance.list_agent_runs_v1_organizations_org_id_agent_runs_get(org_id, user_id=user_id, source_type=source_type, skip=skip, limit=limit, authorization=authorization) + print("The response of AgentsApi->list_agent_runs_v1_organizations_org_id_agent_runs_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentsApi->list_agent_runs_v1_organizations_org_id_agent_runs_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **user_id** | **int**| Filter by user ID who initiated the agent runs | [optional] + **source_type** | [**ApiAgentRunSourceType**](.md)| Filter by source type of the agent runs | [optional] + **skip** | **int**| | [optional] [default to 0] + **limit** | **int**| | [optional] [default to 100] + **authorization** | [**object**](.md)| | [optional] + +### Return type + +[**PageAgentRunResponse**](PageAgentRunResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**403** | Forbidden | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_agent_runs_v1_organizations_org_id_agent_runs_get_0** +> PageAgentRunResponse list_agent_runs_v1_organizations_org_id_agent_runs_get_0(org_id, user_id=user_id, source_type=source_type, skip=skip, limit=limit, authorization=authorization) + +List Agent Runs + +List agent runs for an organization with optional user filtering. + +Returns a paginated list of agent runs for the specified organization. +Optionally filter by user_id to get only agent runs initiated by a specific user. +Results are ordered by creation date (newest first). + +Rate limit: 60 requests per 30 seconds. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.api_agent_run_source_type import ApiAgentRunSourceType +from codegen_api_client.models.page_agent_run_response import PageAgentRunResponse +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.AgentsApi(api_client) + org_id = 56 # int | + user_id = 56 # int | Filter by user ID who initiated the agent runs (optional) + source_type = codegen_api_client.ApiAgentRunSourceType() # ApiAgentRunSourceType | Filter by source type of the agent runs (optional) + skip = 0 # int | (optional) (default to 0) + limit = 100 # int | (optional) (default to 100) + authorization = None # object | (optional) + + try: + # List Agent Runs + api_response = api_instance.list_agent_runs_v1_organizations_org_id_agent_runs_get_0(org_id, user_id=user_id, source_type=source_type, skip=skip, limit=limit, authorization=authorization) + print("The response of AgentsApi->list_agent_runs_v1_organizations_org_id_agent_runs_get_0:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentsApi->list_agent_runs_v1_organizations_org_id_agent_runs_get_0: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **user_id** | **int**| Filter by user ID who initiated the agent runs | [optional] + **source_type** | [**ApiAgentRunSourceType**](.md)| Filter by source type of the agent runs | [optional] + **skip** | **int**| | [optional] [default to 0] + **limit** | **int**| | [optional] [default to 100] + **authorization** | [**object**](.md)| | [optional] + +### Return type + +[**PageAgentRunResponse**](PageAgentRunResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**403** | Forbidden | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_agent_runs_v1_organizations_org_id_agent_runs_get_1** +> PageAgentRunResponse list_agent_runs_v1_organizations_org_id_agent_runs_get_1(org_id, user_id=user_id, source_type=source_type, skip=skip, limit=limit, authorization=authorization) + +List Agent Runs + +List agent runs for an organization with optional user filtering. + +Returns a paginated list of agent runs for the specified organization. +Optionally filter by user_id to get only agent runs initiated by a specific user. +Results are ordered by creation date (newest first). + +Rate limit: 60 requests per 30 seconds. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.api_agent_run_source_type import ApiAgentRunSourceType +from codegen_api_client.models.page_agent_run_response import PageAgentRunResponse +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.AgentsApi(api_client) + org_id = 56 # int | + user_id = 56 # int | Filter by user ID who initiated the agent runs (optional) + source_type = codegen_api_client.ApiAgentRunSourceType() # ApiAgentRunSourceType | Filter by source type of the agent runs (optional) + skip = 0 # int | (optional) (default to 0) + limit = 100 # int | (optional) (default to 100) + authorization = None # object | (optional) + + try: + # List Agent Runs + api_response = api_instance.list_agent_runs_v1_organizations_org_id_agent_runs_get_1(org_id, user_id=user_id, source_type=source_type, skip=skip, limit=limit, authorization=authorization) + print("The response of AgentsApi->list_agent_runs_v1_organizations_org_id_agent_runs_get_1:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentsApi->list_agent_runs_v1_organizations_org_id_agent_runs_get_1: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **user_id** | **int**| Filter by user ID who initiated the agent runs | [optional] + **source_type** | [**ApiAgentRunSourceType**](.md)| Filter by source type of the agent runs | [optional] + **skip** | **int**| | [optional] [default to 0] + **limit** | **int**| | [optional] [default to 100] + **authorization** | [**object**](.md)| | [optional] + +### Return type + +[**PageAgentRunResponse**](PageAgentRunResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**403** | Forbidden | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **remove_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post** +> object remove_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post(org_id, stop_agent_run_input, authorization=authorization) + +Remove Codegen From Pr + +Remove Codegen from a PR. + +This endpoint performs the same action as banning all checks but with more user-friendly naming. +It: +1. Flags the PR to prevent future CI/CD check suite events from being processed +2. Stops all current agents for that PR + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.stop_agent_run_input import StopAgentRunInput +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.AgentsApi(api_client) + org_id = 56 # int | + stop_agent_run_input = codegen_api_client.StopAgentRunInput() # StopAgentRunInput | + authorization = None # object | (optional) + + try: + # Remove Codegen From Pr + api_response = api_instance.remove_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post(org_id, stop_agent_run_input, authorization=authorization) + print("The response of AgentsApi->remove_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentsApi->remove_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **stop_agent_run_input** | [**StopAgentRunInput**](StopAgentRunInput.md)| | + **authorization** | [**object**](.md)| | [optional] + +### Return type + +**object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **remove_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_0** +> object remove_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_0(org_id, stop_agent_run_input, authorization=authorization) + +Remove Codegen From Pr + +Remove Codegen from a PR. + +This endpoint performs the same action as banning all checks but with more user-friendly naming. +It: +1. Flags the PR to prevent future CI/CD check suite events from being processed +2. Stops all current agents for that PR + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.stop_agent_run_input import StopAgentRunInput +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.AgentsApi(api_client) + org_id = 56 # int | + stop_agent_run_input = codegen_api_client.StopAgentRunInput() # StopAgentRunInput | + authorization = None # object | (optional) + + try: + # Remove Codegen From Pr + api_response = api_instance.remove_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_0(org_id, stop_agent_run_input, authorization=authorization) + print("The response of AgentsApi->remove_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_0:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentsApi->remove_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_0: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **stop_agent_run_input** | [**StopAgentRunInput**](StopAgentRunInput.md)| | + **authorization** | [**object**](.md)| | [optional] + +### Return type + +**object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **remove_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_1** +> object remove_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_1(org_id, stop_agent_run_input, authorization=authorization) + +Remove Codegen From Pr + +Remove Codegen from a PR. + +This endpoint performs the same action as banning all checks but with more user-friendly naming. +It: +1. Flags the PR to prevent future CI/CD check suite events from being processed +2. Stops all current agents for that PR + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.stop_agent_run_input import StopAgentRunInput +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.AgentsApi(api_client) + org_id = 56 # int | + stop_agent_run_input = codegen_api_client.StopAgentRunInput() # StopAgentRunInput | + authorization = None # object | (optional) + + try: + # Remove Codegen From Pr + api_response = api_instance.remove_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_1(org_id, stop_agent_run_input, authorization=authorization) + print("The response of AgentsApi->remove_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_1:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentsApi->remove_codegen_from_pr_v1_organizations_org_id_agent_run_remove_from_pr_post_1: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **stop_agent_run_input** | [**StopAgentRunInput**](StopAgentRunInput.md)| | + **authorization** | [**object**](.md)| | [optional] + +### Return type + +**object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **resume_agent_run_v1_organizations_org_id_agent_run_resume_post** +> AgentRunResponse resume_agent_run_v1_organizations_org_id_agent_run_resume_post(org_id, resume_agent_run_input, authorization=authorization) + +Resume Agent Run + +Resume a paused agent run. + +Resumes a paused agent run, allowing it to continue processing. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.agent_run_response import AgentRunResponse +from codegen_api_client.models.resume_agent_run_input import ResumeAgentRunInput +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.AgentsApi(api_client) + org_id = 56 # int | + resume_agent_run_input = codegen_api_client.ResumeAgentRunInput() # ResumeAgentRunInput | + authorization = None # object | (optional) + + try: + # Resume Agent Run + api_response = api_instance.resume_agent_run_v1_organizations_org_id_agent_run_resume_post(org_id, resume_agent_run_input, authorization=authorization) + print("The response of AgentsApi->resume_agent_run_v1_organizations_org_id_agent_run_resume_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentsApi->resume_agent_run_v1_organizations_org_id_agent_run_resume_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **resume_agent_run_input** | [**ResumeAgentRunInput**](ResumeAgentRunInput.md)| | + **authorization** | [**object**](.md)| | [optional] + +### Return type + +[**AgentRunResponse**](AgentRunResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **resume_agent_run_v1_organizations_org_id_agent_run_resume_post_0** +> AgentRunResponse resume_agent_run_v1_organizations_org_id_agent_run_resume_post_0(org_id, resume_agent_run_input, authorization=authorization) + +Resume Agent Run + +Resume a paused agent run. + +Resumes a paused agent run, allowing it to continue processing. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.agent_run_response import AgentRunResponse +from codegen_api_client.models.resume_agent_run_input import ResumeAgentRunInput +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.AgentsApi(api_client) + org_id = 56 # int | + resume_agent_run_input = codegen_api_client.ResumeAgentRunInput() # ResumeAgentRunInput | + authorization = None # object | (optional) + + try: + # Resume Agent Run + api_response = api_instance.resume_agent_run_v1_organizations_org_id_agent_run_resume_post_0(org_id, resume_agent_run_input, authorization=authorization) + print("The response of AgentsApi->resume_agent_run_v1_organizations_org_id_agent_run_resume_post_0:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentsApi->resume_agent_run_v1_organizations_org_id_agent_run_resume_post_0: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **resume_agent_run_input** | [**ResumeAgentRunInput**](ResumeAgentRunInput.md)| | + **authorization** | [**object**](.md)| | [optional] + +### Return type + +[**AgentRunResponse**](AgentRunResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **resume_agent_run_v1_organizations_org_id_agent_run_resume_post_1** +> AgentRunResponse resume_agent_run_v1_organizations_org_id_agent_run_resume_post_1(org_id, resume_agent_run_input, authorization=authorization) + +Resume Agent Run + +Resume a paused agent run. + +Resumes a paused agent run, allowing it to continue processing. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.agent_run_response import AgentRunResponse +from codegen_api_client.models.resume_agent_run_input import ResumeAgentRunInput +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.AgentsApi(api_client) + org_id = 56 # int | + resume_agent_run_input = codegen_api_client.ResumeAgentRunInput() # ResumeAgentRunInput | + authorization = None # object | (optional) + + try: + # Resume Agent Run + api_response = api_instance.resume_agent_run_v1_organizations_org_id_agent_run_resume_post_1(org_id, resume_agent_run_input, authorization=authorization) + print("The response of AgentsApi->resume_agent_run_v1_organizations_org_id_agent_run_resume_post_1:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentsApi->resume_agent_run_v1_organizations_org_id_agent_run_resume_post_1: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **resume_agent_run_input** | [**ResumeAgentRunInput**](ResumeAgentRunInput.md)| | + **authorization** | [**object**](.md)| | [optional] + +### Return type + +[**AgentRunResponse**](AgentRunResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post** +> object unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post(org_id, stop_agent_run_input, authorization=authorization) + +Unban All Checks For Agent Run + +Unban all checks for a PR. + +This endpoint: +1. Removes the ban flag from the PR to allow future CI/CD check suite events to be processed +2. Handles both URL-based bans and parent-agent-run-based bans + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.stop_agent_run_input import StopAgentRunInput +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.AgentsApi(api_client) + org_id = 56 # int | + stop_agent_run_input = codegen_api_client.StopAgentRunInput() # StopAgentRunInput | + authorization = None # object | (optional) + + try: + # Unban All Checks For Agent Run + api_response = api_instance.unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post(org_id, stop_agent_run_input, authorization=authorization) + print("The response of AgentsApi->unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentsApi->unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **stop_agent_run_input** | [**StopAgentRunInput**](StopAgentRunInput.md)| | + **authorization** | [**object**](.md)| | [optional] + +### Return type + +**object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_0** +> object unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_0(org_id, stop_agent_run_input, authorization=authorization) + +Unban All Checks For Agent Run + +Unban all checks for a PR. + +This endpoint: +1. Removes the ban flag from the PR to allow future CI/CD check suite events to be processed +2. Handles both URL-based bans and parent-agent-run-based bans + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.stop_agent_run_input import StopAgentRunInput +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.AgentsApi(api_client) + org_id = 56 # int | + stop_agent_run_input = codegen_api_client.StopAgentRunInput() # StopAgentRunInput | + authorization = None # object | (optional) + + try: + # Unban All Checks For Agent Run + api_response = api_instance.unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_0(org_id, stop_agent_run_input, authorization=authorization) + print("The response of AgentsApi->unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_0:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentsApi->unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_0: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **stop_agent_run_input** | [**StopAgentRunInput**](StopAgentRunInput.md)| | + **authorization** | [**object**](.md)| | [optional] + +### Return type + +**object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_1** +> object unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_1(org_id, stop_agent_run_input, authorization=authorization) + +Unban All Checks For Agent Run + +Unban all checks for a PR. + +This endpoint: +1. Removes the ban flag from the PR to allow future CI/CD check suite events to be processed +2. Handles both URL-based bans and parent-agent-run-based bans + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.stop_agent_run_input import StopAgentRunInput +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.AgentsApi(api_client) + org_id = 56 # int | + stop_agent_run_input = codegen_api_client.StopAgentRunInput() # StopAgentRunInput | + authorization = None # object | (optional) + + try: + # Unban All Checks For Agent Run + api_response = api_instance.unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_1(org_id, stop_agent_run_input, authorization=authorization) + print("The response of AgentsApi->unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_1:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentsApi->unban_all_checks_for_agent_run_v1_organizations_org_id_agent_run_unban_post_1: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **stop_agent_run_input** | [**StopAgentRunInput**](StopAgentRunInput.md)| | + **authorization** | [**object**](.md)| | [optional] + +### Return type + +**object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Validation Error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/AgentsBetaApi.md b/docs/AgentsBetaApi.md new file mode 100644 index 0000000..91d8948 --- /dev/null +++ b/docs/AgentsBetaApi.md @@ -0,0 +1,95 @@ +# codegen_api_client.AgentsBetaApi + +All URIs are relative to *https://api.codegen.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get**](AgentsBetaApi.md#get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get) | **GET** /v1/alpha/organizations/{org_id}/agent/run/{agent_run_id}/logs | Get Agent Run Logs + + +# **get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get** +> AgentRunWithLogsResponse get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get(agent_run_id, org_id, skip=skip, limit=limit, authorization=authorization) + +Get Agent Run Logs + +Retrieve an agent run with its logs using pagination. This endpoint is currently in ALPHA and IS subject to change. + +Returns the agent run details along with a paginated list of logs for the specified agent run. +The agent run must belong to the specified organization. Logs are returned in chronological order. +Uses standard pagination parameters (skip and limit) and includes pagination metadata in the response. + +Rate limit: 60 requests per 60 seconds. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.agent_run_with_logs_response import AgentRunWithLogsResponse +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.AgentsBetaApi(api_client) + agent_run_id = 56 # int | + org_id = 56 # int | + skip = 0 # int | (optional) (default to 0) + limit = 100 # int | (optional) (default to 100) + authorization = None # object | (optional) + + try: + # Get Agent Run Logs + api_response = api_instance.get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get(agent_run_id, org_id, skip=skip, limit=limit, authorization=authorization) + print("The response of AgentsBetaApi->get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentsBetaApi->get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **agent_run_id** | **int**| | + **org_id** | **int**| | + **skip** | **int**| | [optional] [default to 0] + **limit** | **int**| | [optional] [default to 100] + **authorization** | [**object**](.md)| | [optional] + +### Return type + +[**AgentRunWithLogsResponse**](AgentRunWithLogsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/ApiAgentRunSourceType.md b/docs/ApiAgentRunSourceType.md new file mode 100644 index 0000000..00cbca9 --- /dev/null +++ b/docs/ApiAgentRunSourceType.md @@ -0,0 +1,24 @@ +# ApiAgentRunSourceType + + +## Enum + +* `LOCAL` (value: `'LOCAL'`) + +* `SLACK` (value: `'SLACK'`) + +* `GITHUB` (value: `'GITHUB'`) + +* `GITHUB_CHECK_SUITE` (value: `'GITHUB_CHECK_SUITE'`) + +* `LINEAR` (value: `'LINEAR'`) + +* `API` (value: `'API'`) + +* `CHAT` (value: `'CHAT'`) + +* `JIRA` (value: `'JIRA'`) + +[[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/docs/CheckSuiteRetryStatsResponse.md b/docs/CheckSuiteRetryStatsResponse.md new file mode 100644 index 0000000..b59cba1 --- /dev/null +++ b/docs/CheckSuiteRetryStatsResponse.md @@ -0,0 +1,36 @@ +# CheckSuiteRetryStatsResponse + +Response model for check suite retry statistics. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**repo_id** | **int** | Repository ID | +**total_orchestrations** | **int** | Total number of orchestrations | +**active_orchestrations** | **int** | Number of active orchestrations | +**completed_orchestrations** | **int** | Number of completed orchestrations | +**failed_orchestrations** | **int** | Number of failed orchestrations | +**total_retry_attempts** | **int** | Total number of retry attempts across all checks | +**checks_at_retry_limit** | **int** | Number of checks that have reached their retry limit | + +## Example + +```python +from codegen_api_client.models.check_suite_retry_stats_response import CheckSuiteRetryStatsResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of CheckSuiteRetryStatsResponse from a JSON string +check_suite_retry_stats_response_instance = CheckSuiteRetryStatsResponse.from_json(json) +# print the JSON string representation of the object +print(CheckSuiteRetryStatsResponse.to_json()) + +# convert the object into a dict +check_suite_retry_stats_response_dict = check_suite_retry_stats_response_instance.to_dict() +# create an instance of CheckSuiteRetryStatsResponse from a dict +check_suite_retry_stats_response_from_dict = CheckSuiteRetryStatsResponse.from_dict(check_suite_retry_stats_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/docs/CheckSuiteSettingsResponse.md b/docs/CheckSuiteSettingsResponse.md new file mode 100644 index 0000000..38f78da --- /dev/null +++ b/docs/CheckSuiteSettingsResponse.md @@ -0,0 +1,31 @@ +# CheckSuiteSettingsResponse + +Response model for check suite settings. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**retry_count** | **int** | Number of retry attempts for failed checks | +**ignored_checks** | **List[str]** | List of check names to ignore | + +## Example + +```python +from codegen_api_client.models.check_suite_settings_response import CheckSuiteSettingsResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of CheckSuiteSettingsResponse from a JSON string +check_suite_settings_response_instance = CheckSuiteSettingsResponse.from_json(json) +# print the JSON string representation of the object +print(CheckSuiteSettingsResponse.to_json()) + +# convert the object into a dict +check_suite_settings_response_dict = check_suite_settings_response_instance.to_dict() +# create an instance of CheckSuiteSettingsResponse from a dict +check_suite_settings_response_from_dict = CheckSuiteSettingsResponse.from_dict(check_suite_settings_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/docs/CreateAgentRunInput.md b/docs/CreateAgentRunInput.md index a9d24a3..b78e229 100644 --- a/docs/CreateAgentRunInput.md +++ b/docs/CreateAgentRunInput.md @@ -6,6 +6,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **prompt** | **str** | | +**images** | **List[str]** | | [optional] +**metadata** | **Dict[str, object]** | | [optional] +**repo_id** | **int** | | [optional] +**model** | **str** | | [optional] ## Example diff --git a/docs/GithubPullRequestResponse.md b/docs/GithubPullRequestResponse.md new file mode 100644 index 0000000..3361c9d --- /dev/null +++ b/docs/GithubPullRequestResponse.md @@ -0,0 +1,32 @@ +# GithubPullRequestResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | +**title** | **str** | | +**url** | **str** | | +**created_at** | **str** | | + +## Example + +```python +from codegen_api_client.models.github_pull_request_response import GithubPullRequestResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of GithubPullRequestResponse from a JSON string +github_pull_request_response_instance = GithubPullRequestResponse.from_json(json) +# print the JSON string representation of the object +print(GithubPullRequestResponse.to_json()) + +# convert the object into a dict +github_pull_request_response_dict = github_pull_request_response_instance.to_dict() +# create an instance of GithubPullRequestResponse from a dict +github_pull_request_response_from_dict = GithubPullRequestResponse.from_dict(github_pull_request_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/docs/IntegrationStatus.md b/docs/IntegrationStatus.md new file mode 100644 index 0000000..db13f91 --- /dev/null +++ b/docs/IntegrationStatus.md @@ -0,0 +1,34 @@ +# IntegrationStatus + +Status information for a single integration. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integration_type** | **str** | Type of integration (e.g., 'github', 'slack', 'linear', etc.) | +**active** | **bool** | Whether the integration is currently active | +**token_id** | **int** | | [optional] +**installation_id** | **int** | | [optional] +**metadata** | **Dict[str, object]** | | [optional] + +## Example + +```python +from codegen_api_client.models.integration_status import IntegrationStatus + +# TODO update the JSON string below +json = "{}" +# create an instance of IntegrationStatus from a JSON string +integration_status_instance = IntegrationStatus.from_json(json) +# print the JSON string representation of the object +print(IntegrationStatus.to_json()) + +# convert the object into a dict +integration_status_dict = integration_status_instance.to_dict() +# create an instance of IntegrationStatus from a dict +integration_status_from_dict = IntegrationStatus.from_dict(integration_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/docs/IntegrationsApi.md b/docs/IntegrationsApi.md new file mode 100644 index 0000000..091dda1 --- /dev/null +++ b/docs/IntegrationsApi.md @@ -0,0 +1,266 @@ +# codegen_api_client.IntegrationsApi + +All URIs are relative to *https://api.codegen.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get**](IntegrationsApi.md#get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get) | **GET** /v1/organizations/{org_id}/integrations | Get Organization Integrations Endpoint +[**get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_0**](IntegrationsApi.md#get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_0) | **GET** /v1/organizations/{org_id}/integrations | Get Organization Integrations Endpoint +[**get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_1**](IntegrationsApi.md#get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_1) | **GET** /v1/organizations/{org_id}/integrations | Get Organization Integrations Endpoint + + +# **get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get** +> OrganizationIntegrationsResponse get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get(org_id, authorization=authorization) + +Get Organization Integrations Endpoint + +Get all integration statuses for the given organization. + +Returns a comprehensive overview of all integrations configured for the organization, +including: +- OAuth-based integrations (Slack, Linear, Notion, Figma, ClickUp, Jira, Sentry, Monday.com) +- GitHub app installations +- API key-based integrations (CircleCI) +- Database connections (PostgreSQL) + +Each integration includes its current status (active/inactive), associated token/installation IDs, +and relevant metadata such as app names, organization names, etc. + +Rate limit: 60 requests per 30 seconds. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.organization_integrations_response import OrganizationIntegrationsResponse +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.IntegrationsApi(api_client) + org_id = 56 # int | + authorization = None # object | (optional) + + try: + # Get Organization Integrations Endpoint + api_response = api_instance.get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get(org_id, authorization=authorization) + print("The response of IntegrationsApi->get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling IntegrationsApi->get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **authorization** | [**object**](.md)| | [optional] + +### Return type + +[**OrganizationIntegrationsResponse**](OrganizationIntegrationsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**403** | Forbidden | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_0** +> OrganizationIntegrationsResponse get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_0(org_id, authorization=authorization) + +Get Organization Integrations Endpoint + +Get all integration statuses for the given organization. + +Returns a comprehensive overview of all integrations configured for the organization, +including: +- OAuth-based integrations (Slack, Linear, Notion, Figma, ClickUp, Jira, Sentry, Monday.com) +- GitHub app installations +- API key-based integrations (CircleCI) +- Database connections (PostgreSQL) + +Each integration includes its current status (active/inactive), associated token/installation IDs, +and relevant metadata such as app names, organization names, etc. + +Rate limit: 60 requests per 30 seconds. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.organization_integrations_response import OrganizationIntegrationsResponse +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.IntegrationsApi(api_client) + org_id = 56 # int | + authorization = None # object | (optional) + + try: + # Get Organization Integrations Endpoint + api_response = api_instance.get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_0(org_id, authorization=authorization) + print("The response of IntegrationsApi->get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_0:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling IntegrationsApi->get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_0: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **authorization** | [**object**](.md)| | [optional] + +### Return type + +[**OrganizationIntegrationsResponse**](OrganizationIntegrationsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**403** | Forbidden | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_1** +> OrganizationIntegrationsResponse get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_1(org_id, authorization=authorization) + +Get Organization Integrations Endpoint + +Get all integration statuses for the given organization. + +Returns a comprehensive overview of all integrations configured for the organization, +including: +- OAuth-based integrations (Slack, Linear, Notion, Figma, ClickUp, Jira, Sentry, Monday.com) +- GitHub app installations +- API key-based integrations (CircleCI) +- Database connections (PostgreSQL) + +Each integration includes its current status (active/inactive), associated token/installation IDs, +and relevant metadata such as app names, organization names, etc. + +Rate limit: 60 requests per 30 seconds. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.organization_integrations_response import OrganizationIntegrationsResponse +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.IntegrationsApi(api_client) + org_id = 56 # int | + authorization = None # object | (optional) + + try: + # Get Organization Integrations Endpoint + api_response = api_instance.get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_1(org_id, authorization=authorization) + print("The response of IntegrationsApi->get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_1:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling IntegrationsApi->get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_1: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **authorization** | [**object**](.md)| | [optional] + +### Return type + +[**OrganizationIntegrationsResponse**](OrganizationIntegrationsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**403** | Forbidden | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/LinearApi.md b/docs/LinearApi.md new file mode 100644 index 0000000..56893e9 --- /dev/null +++ b/docs/LinearApi.md @@ -0,0 +1,476 @@ +# codegen_api_client.LinearApi + +All URIs are relative to *https://api.codegen.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_linear_projects_v1_linear_projects_get**](LinearApi.md#get_linear_projects_v1_linear_projects_get) | **GET** /v1/linear/projects | Get Linear Projects +[**get_linear_projects_v1_linear_projects_get_0**](LinearApi.md#get_linear_projects_v1_linear_projects_get_0) | **GET** /v1/linear/projects | Get Linear Projects +[**get_linear_projects_v1_linear_projects_get_1**](LinearApi.md#get_linear_projects_v1_linear_projects_get_1) | **GET** /v1/linear/projects | Get Linear Projects +[**get_linear_teams_v1_linear_teams_get**](LinearApi.md#get_linear_teams_v1_linear_teams_get) | **GET** /v1/linear/teams | Get Linear Teams +[**get_linear_teams_v1_linear_teams_get_0**](LinearApi.md#get_linear_teams_v1_linear_teams_get_0) | **GET** /v1/linear/teams | Get Linear Teams +[**get_linear_teams_v1_linear_teams_get_1**](LinearApi.md#get_linear_teams_v1_linear_teams_get_1) | **GET** /v1/linear/teams | Get Linear Teams + + +# **get_linear_projects_v1_linear_projects_get** +> object get_linear_projects_v1_linear_projects_get(authorization=authorization, x_organization_id=x_organization_id) + +Get Linear Projects + +Get Linear projects for the authenticated user's organization. + +Returns a list of all Linear projects that the authenticated user has access to +within the specified organization. This endpoint is used to populate project +selection dropdowns in repository settings. + +Rate limit: 60 requests per 30 seconds. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.LinearApi(api_client) + authorization = None # object | (optional) + x_organization_id = None # object | (optional) + + try: + # Get Linear Projects + api_response = api_instance.get_linear_projects_v1_linear_projects_get(authorization=authorization, x_organization_id=x_organization_id) + print("The response of LinearApi->get_linear_projects_v1_linear_projects_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling LinearApi->get_linear_projects_v1_linear_projects_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **authorization** | [**object**](.md)| | [optional] + **x_organization_id** | [**object**](.md)| | [optional] + +### Return type + +**object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_linear_projects_v1_linear_projects_get_0** +> object get_linear_projects_v1_linear_projects_get_0(authorization=authorization, x_organization_id=x_organization_id) + +Get Linear Projects + +Get Linear projects for the authenticated user's organization. + +Returns a list of all Linear projects that the authenticated user has access to +within the specified organization. This endpoint is used to populate project +selection dropdowns in repository settings. + +Rate limit: 60 requests per 30 seconds. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.LinearApi(api_client) + authorization = None # object | (optional) + x_organization_id = None # object | (optional) + + try: + # Get Linear Projects + api_response = api_instance.get_linear_projects_v1_linear_projects_get_0(authorization=authorization, x_organization_id=x_organization_id) + print("The response of LinearApi->get_linear_projects_v1_linear_projects_get_0:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling LinearApi->get_linear_projects_v1_linear_projects_get_0: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **authorization** | [**object**](.md)| | [optional] + **x_organization_id** | [**object**](.md)| | [optional] + +### Return type + +**object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_linear_projects_v1_linear_projects_get_1** +> object get_linear_projects_v1_linear_projects_get_1(authorization=authorization, x_organization_id=x_organization_id) + +Get Linear Projects + +Get Linear projects for the authenticated user's organization. + +Returns a list of all Linear projects that the authenticated user has access to +within the specified organization. This endpoint is used to populate project +selection dropdowns in repository settings. + +Rate limit: 60 requests per 30 seconds. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.LinearApi(api_client) + authorization = None # object | (optional) + x_organization_id = None # object | (optional) + + try: + # Get Linear Projects + api_response = api_instance.get_linear_projects_v1_linear_projects_get_1(authorization=authorization, x_organization_id=x_organization_id) + print("The response of LinearApi->get_linear_projects_v1_linear_projects_get_1:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling LinearApi->get_linear_projects_v1_linear_projects_get_1: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **authorization** | [**object**](.md)| | [optional] + **x_organization_id** | [**object**](.md)| | [optional] + +### Return type + +**object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_linear_teams_v1_linear_teams_get** +> object get_linear_teams_v1_linear_teams_get(authorization=authorization, x_organization_id=x_organization_id) + +Get Linear Teams + +Get Linear teams for the authenticated user's organization. + +Returns a list of all Linear teams that the authenticated user has access to +within the specified organization. This endpoint is used to populate team +selection dropdowns in repository settings. + +Rate limit: 60 requests per 30 seconds. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.LinearApi(api_client) + authorization = None # object | (optional) + x_organization_id = None # object | (optional) + + try: + # Get Linear Teams + api_response = api_instance.get_linear_teams_v1_linear_teams_get(authorization=authorization, x_organization_id=x_organization_id) + print("The response of LinearApi->get_linear_teams_v1_linear_teams_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling LinearApi->get_linear_teams_v1_linear_teams_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **authorization** | [**object**](.md)| | [optional] + **x_organization_id** | [**object**](.md)| | [optional] + +### Return type + +**object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_linear_teams_v1_linear_teams_get_0** +> object get_linear_teams_v1_linear_teams_get_0(authorization=authorization, x_organization_id=x_organization_id) + +Get Linear Teams + +Get Linear teams for the authenticated user's organization. + +Returns a list of all Linear teams that the authenticated user has access to +within the specified organization. This endpoint is used to populate team +selection dropdowns in repository settings. + +Rate limit: 60 requests per 30 seconds. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.LinearApi(api_client) + authorization = None # object | (optional) + x_organization_id = None # object | (optional) + + try: + # Get Linear Teams + api_response = api_instance.get_linear_teams_v1_linear_teams_get_0(authorization=authorization, x_organization_id=x_organization_id) + print("The response of LinearApi->get_linear_teams_v1_linear_teams_get_0:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling LinearApi->get_linear_teams_v1_linear_teams_get_0: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **authorization** | [**object**](.md)| | [optional] + **x_organization_id** | [**object**](.md)| | [optional] + +### Return type + +**object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_linear_teams_v1_linear_teams_get_1** +> object get_linear_teams_v1_linear_teams_get_1(authorization=authorization, x_organization_id=x_organization_id) + +Get Linear Teams + +Get Linear teams for the authenticated user's organization. + +Returns a list of all Linear teams that the authenticated user has access to +within the specified organization. This endpoint is used to populate team +selection dropdowns in repository settings. + +Rate limit: 60 requests per 30 seconds. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.LinearApi(api_client) + authorization = None # object | (optional) + x_organization_id = None # object | (optional) + + try: + # Get Linear Teams + api_response = api_instance.get_linear_teams_v1_linear_teams_get_1(authorization=authorization, x_organization_id=x_organization_id) + print("The response of LinearApi->get_linear_teams_v1_linear_teams_get_1:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling LinearApi->get_linear_teams_v1_linear_teams_get_1: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **authorization** | [**object**](.md)| | [optional] + **x_organization_id** | [**object**](.md)| | [optional] + +### Return type + +**object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/NoReposFoundInOrgErrorResponse.md b/docs/NoReposFoundInOrgErrorResponse.md new file mode 100644 index 0000000..60c6f5d --- /dev/null +++ b/docs/NoReposFoundInOrgErrorResponse.md @@ -0,0 +1,30 @@ +# NoReposFoundInOrgErrorResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **str** | | [optional] [default to 'No repos found in the organization. Please add some repos and try again.'] +**status_code** | **int** | | [optional] [default to 404] + +## Example + +```python +from codegen_api_client.models.no_repos_found_in_org_error_response import NoReposFoundInOrgErrorResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of NoReposFoundInOrgErrorResponse from a JSON string +no_repos_found_in_org_error_response_instance = NoReposFoundInOrgErrorResponse.from_json(json) +# print the JSON string representation of the object +print(NoReposFoundInOrgErrorResponse.to_json()) + +# convert the object into a dict +no_repos_found_in_org_error_response_dict = no_repos_found_in_org_error_response_instance.to_dict() +# create an instance of NoReposFoundInOrgErrorResponse from a dict +no_repos_found_in_org_error_response_from_dict = NoReposFoundInOrgErrorResponse.from_dict(no_repos_found_in_org_error_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/docs/Observation.md b/docs/Observation.md new file mode 100644 index 0000000..4d4a6c8 --- /dev/null +++ b/docs/Observation.md @@ -0,0 +1,28 @@ +# Observation + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from codegen_api_client.models.observation import Observation + +# TODO update the JSON string below +json = "{}" +# create an instance of Observation from a JSON string +observation_instance = Observation.from_json(json) +# print the JSON string representation of the object +print(Observation.to_json()) + +# convert the object into a dict +observation_dict = observation_instance.to_dict() +# create an instance of Observation from a dict +observation_from_dict = Observation.from_dict(observation_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/docs/OrganizationIntegrationsResponse.md b/docs/OrganizationIntegrationsResponse.md new file mode 100644 index 0000000..64b08ab --- /dev/null +++ b/docs/OrganizationIntegrationsResponse.md @@ -0,0 +1,33 @@ +# OrganizationIntegrationsResponse + +Response schema for organization integrations. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**organization_id** | **int** | ID of the organization | +**organization_name** | **str** | Name of the organization | +**integrations** | [**List[IntegrationStatus]**](IntegrationStatus.md) | List of integration statuses | +**total_active_integrations** | **int** | Total number of active integrations | + +## Example + +```python +from codegen_api_client.models.organization_integrations_response import OrganizationIntegrationsResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of OrganizationIntegrationsResponse from a JSON string +organization_integrations_response_instance = OrganizationIntegrationsResponse.from_json(json) +# print the JSON string representation of the object +print(OrganizationIntegrationsResponse.to_json()) + +# convert the object into a dict +organization_integrations_response_dict = organization_integrations_response_instance.to_dict() +# create an instance of OrganizationIntegrationsResponse from a dict +organization_integrations_response_from_dict = OrganizationIntegrationsResponse.from_dict(organization_integrations_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/docs/OrganizationsApi.md b/docs/OrganizationsApi.md index 94d5ff9..8f2025b 100644 --- a/docs/OrganizationsApi.md +++ b/docs/OrganizationsApi.md @@ -1,6 +1,6 @@ # codegen_api_client.OrganizationsApi -All URIs are relative to *http://localhost* +All URIs are relative to *https://api.codegen.com* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -20,6 +20,8 @@ Returns a paginated list of all organizations that the authenticated user is a m Results include basic organization details such as name, ID, and membership information. Use pagination parameters to control the number of results returned. +Rate limit: 60 requests per 30 seconds. + ### Example @@ -29,10 +31,10 @@ from codegen_api_client.models.page_organization_response import PageOrganizatio from codegen_api_client.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to http://localhost +# Defining the host is optional and defaults to https://api.codegen.com # See configuration.py for a list of all supported configuration parameters. configuration = codegen_api_client.Configuration( - host = "http://localhost" + host = "https://api.codegen.com" ) @@ -82,8 +84,8 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Successful Response | - | -**422** | Validation Error | - | **429** | Too Many Requests | - | +**422** | Validation Error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -98,6 +100,8 @@ Returns a paginated list of all organizations that the authenticated user is a m Results include basic organization details such as name, ID, and membership information. Use pagination parameters to control the number of results returned. +Rate limit: 60 requests per 30 seconds. + ### Example @@ -107,10 +111,10 @@ from codegen_api_client.models.page_organization_response import PageOrganizatio from codegen_api_client.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to http://localhost +# Defining the host is optional and defaults to https://api.codegen.com # See configuration.py for a list of all supported configuration parameters. configuration = codegen_api_client.Configuration( - host = "http://localhost" + host = "https://api.codegen.com" ) @@ -160,8 +164,8 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Successful Response | - | -**422** | Validation Error | - | **429** | Too Many Requests | - | +**422** | Validation Error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -176,6 +180,8 @@ Returns a paginated list of all organizations that the authenticated user is a m Results include basic organization details such as name, ID, and membership information. Use pagination parameters to control the number of results returned. +Rate limit: 60 requests per 30 seconds. + ### Example @@ -185,10 +191,10 @@ from codegen_api_client.models.page_organization_response import PageOrganizatio from codegen_api_client.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to http://localhost +# Defining the host is optional and defaults to https://api.codegen.com # See configuration.py for a list of all supported configuration parameters. configuration = codegen_api_client.Configuration( - host = "http://localhost" + host = "https://api.codegen.com" ) @@ -238,8 +244,8 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Successful Response | - | -**422** | Validation Error | - | **429** | Too Many Requests | - | +**422** | Validation Error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/PageAgentRunResponse.md b/docs/PageAgentRunResponse.md new file mode 100644 index 0000000..adace64 --- /dev/null +++ b/docs/PageAgentRunResponse.md @@ -0,0 +1,33 @@ +# PageAgentRunResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**items** | [**List[AgentRunResponse]**](AgentRunResponse.md) | | +**total** | **int** | | +**page** | **int** | | +**size** | **int** | | +**pages** | **int** | | + +## Example + +```python +from codegen_api_client.models.page_agent_run_response import PageAgentRunResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of PageAgentRunResponse from a JSON string +page_agent_run_response_instance = PageAgentRunResponse.from_json(json) +# print the JSON string representation of the object +print(PageAgentRunResponse.to_json()) + +# convert the object into a dict +page_agent_run_response_dict = page_agent_run_response_instance.to_dict() +# create an instance of PageAgentRunResponse from a dict +page_agent_run_response_from_dict = PageAgentRunResponse.from_dict(page_agent_run_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/docs/PageRepoResponse.md b/docs/PageRepoResponse.md new file mode 100644 index 0000000..b2f5fa8 --- /dev/null +++ b/docs/PageRepoResponse.md @@ -0,0 +1,33 @@ +# PageRepoResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**items** | [**List[RepoResponse]**](RepoResponse.md) | | +**total** | **int** | | +**page** | **int** | | +**size** | **int** | | +**pages** | **int** | | + +## Example + +```python +from codegen_api_client.models.page_repo_response import PageRepoResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of PageRepoResponse from a JSON string +page_repo_response_instance = PageRepoResponse.from_json(json) +# print the JSON string representation of the object +print(PageRepoResponse.to_json()) + +# convert the object into a dict +page_repo_response_dict = page_repo_response_instance.to_dict() +# create an instance of PageRepoResponse from a dict +page_repo_response_from_dict = PageRepoResponse.from_dict(page_repo_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/docs/PermissionsErrorResponse.md b/docs/PermissionsErrorResponse.md new file mode 100644 index 0000000..81e56b3 --- /dev/null +++ b/docs/PermissionsErrorResponse.md @@ -0,0 +1,30 @@ +# PermissionsErrorResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **str** | | [optional] [default to 'You do not have access to this organization.'] +**status_code** | **int** | | [optional] [default to 403] + +## Example + +```python +from codegen_api_client.models.permissions_error_response import PermissionsErrorResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of PermissionsErrorResponse from a JSON string +permissions_error_response_instance = PermissionsErrorResponse.from_json(json) +# print the JSON string representation of the object +print(PermissionsErrorResponse.to_json()) + +# convert the object into a dict +permissions_error_response_dict = permissions_error_response_instance.to_dict() +# create an instance of PermissionsErrorResponse from a dict +permissions_error_response_from_dict = PermissionsErrorResponse.from_dict(permissions_error_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/docs/RepoResponse.md b/docs/RepoResponse.md new file mode 100644 index 0000000..9cdd496 --- /dev/null +++ b/docs/RepoResponse.md @@ -0,0 +1,39 @@ +# RepoResponse + +Represents a repository in API responses + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | +**name** | **str** | | +**full_name** | **str** | | +**description** | **str** | | +**github_id** | **str** | | +**organization_id** | **int** | | +**visibility** | **str** | | +**archived** | **bool** | | +**setup_status** | **str** | | +**language** | **str** | | + +## Example + +```python +from codegen_api_client.models.repo_response import RepoResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of RepoResponse from a JSON string +repo_response_instance = RepoResponse.from_json(json) +# print the JSON string representation of the object +print(RepoResponse.to_json()) + +# convert the object into a dict +repo_response_dict = repo_response_instance.to_dict() +# create an instance of RepoResponse from a dict +repo_response_from_dict = RepoResponse.from_dict(repo_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/docs/RepositoriesApi.md b/docs/RepositoriesApi.md new file mode 100644 index 0000000..ee6bbc4 --- /dev/null +++ b/docs/RepositoriesApi.md @@ -0,0 +1,989 @@ +# codegen_api_client.RepositoriesApi + +All URIs are relative to *https://api.codegen.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get**](RepositoriesApi.md#get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get) | **GET** /v1/organizations/{org_id}/repos/{repo_id}/check-suite/stats | Get Check Suite Retry Stats +[**get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_0**](RepositoriesApi.md#get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_0) | **GET** /v1/organizations/{org_id}/repos/{repo_id}/check-suite/stats | Get Check Suite Retry Stats +[**get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_1**](RepositoriesApi.md#get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_1) | **GET** /v1/organizations/{org_id}/repos/{repo_id}/check-suite/stats | Get Check Suite Retry Stats +[**get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get**](RepositoriesApi.md#get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get) | **GET** /v1/organizations/{org_id}/repos/{repo_id}/check-suite/settings | Get Check Suite Settings +[**get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_0**](RepositoriesApi.md#get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_0) | **GET** /v1/organizations/{org_id}/repos/{repo_id}/check-suite/settings | Get Check Suite Settings +[**get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_1**](RepositoriesApi.md#get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_1) | **GET** /v1/organizations/{org_id}/repos/{repo_id}/check-suite/settings | Get Check Suite Settings +[**get_repositories_v1_organizations_org_id_repos_get**](RepositoriesApi.md#get_repositories_v1_organizations_org_id_repos_get) | **GET** /v1/organizations/{org_id}/repos | Get Repositories +[**get_repositories_v1_organizations_org_id_repos_get_0**](RepositoriesApi.md#get_repositories_v1_organizations_org_id_repos_get_0) | **GET** /v1/organizations/{org_id}/repos | Get Repositories +[**get_repositories_v1_organizations_org_id_repos_get_1**](RepositoriesApi.md#get_repositories_v1_organizations_org_id_repos_get_1) | **GET** /v1/organizations/{org_id}/repos | Get Repositories +[**update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put**](RepositoriesApi.md#update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put) | **PUT** /v1/organizations/{org_id}/repos/{repo_id}/check-suite/settings | Update Check Suite Settings +[**update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_0**](RepositoriesApi.md#update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_0) | **PUT** /v1/organizations/{org_id}/repos/{repo_id}/check-suite/settings | Update Check Suite Settings +[**update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_1**](RepositoriesApi.md#update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_1) | **PUT** /v1/organizations/{org_id}/repos/{repo_id}/check-suite/settings | Update Check Suite Settings + + +# **get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get** +> CheckSuiteRetryStatsResponse get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get(org_id, repo_id, authorization=authorization) + +Get Check Suite Retry Stats + +Get check suite retry statistics for a repository. + +Returns comprehensive statistics about check suite orchestrations and retry attempts: +- Total, active, completed, and failed orchestrations +- Total retry attempts across all checks +- Number of checks that have reached their retry limit + +Rate limit: 60 requests per 30 seconds. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.check_suite_retry_stats_response import CheckSuiteRetryStatsResponse +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.RepositoriesApi(api_client) + org_id = 56 # int | + repo_id = 56 # int | + authorization = None # object | (optional) + + try: + # Get Check Suite Retry Stats + api_response = api_instance.get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get(org_id, repo_id, authorization=authorization) + print("The response of RepositoriesApi->get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RepositoriesApi->get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **repo_id** | **int**| | + **authorization** | [**object**](.md)| | [optional] + +### Return type + +[**CheckSuiteRetryStatsResponse**](CheckSuiteRetryStatsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_0** +> CheckSuiteRetryStatsResponse get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_0(org_id, repo_id, authorization=authorization) + +Get Check Suite Retry Stats + +Get check suite retry statistics for a repository. + +Returns comprehensive statistics about check suite orchestrations and retry attempts: +- Total, active, completed, and failed orchestrations +- Total retry attempts across all checks +- Number of checks that have reached their retry limit + +Rate limit: 60 requests per 30 seconds. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.check_suite_retry_stats_response import CheckSuiteRetryStatsResponse +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.RepositoriesApi(api_client) + org_id = 56 # int | + repo_id = 56 # int | + authorization = None # object | (optional) + + try: + # Get Check Suite Retry Stats + api_response = api_instance.get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_0(org_id, repo_id, authorization=authorization) + print("The response of RepositoriesApi->get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_0:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RepositoriesApi->get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_0: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **repo_id** | **int**| | + **authorization** | [**object**](.md)| | [optional] + +### Return type + +[**CheckSuiteRetryStatsResponse**](CheckSuiteRetryStatsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_1** +> CheckSuiteRetryStatsResponse get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_1(org_id, repo_id, authorization=authorization) + +Get Check Suite Retry Stats + +Get check suite retry statistics for a repository. + +Returns comprehensive statistics about check suite orchestrations and retry attempts: +- Total, active, completed, and failed orchestrations +- Total retry attempts across all checks +- Number of checks that have reached their retry limit + +Rate limit: 60 requests per 30 seconds. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.check_suite_retry_stats_response import CheckSuiteRetryStatsResponse +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.RepositoriesApi(api_client) + org_id = 56 # int | + repo_id = 56 # int | + authorization = None # object | (optional) + + try: + # Get Check Suite Retry Stats + api_response = api_instance.get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_1(org_id, repo_id, authorization=authorization) + print("The response of RepositoriesApi->get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_1:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RepositoriesApi->get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_1: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **repo_id** | **int**| | + **authorization** | [**object**](.md)| | [optional] + +### Return type + +[**CheckSuiteRetryStatsResponse**](CheckSuiteRetryStatsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get** +> CheckSuiteSettingsResponse get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get(org_id, repo_id, authorization=authorization) + +Get Check Suite Settings + +Get check suite retry settings for a repository. + +Returns the current configuration for check suite retry logic including: +- retry_count: Maximum number of retry attempts per failed check +- ignored_checks: List of check names that should be ignored + +Rate limit: 60 requests per 30 seconds. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.check_suite_settings_response import CheckSuiteSettingsResponse +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.RepositoriesApi(api_client) + org_id = 56 # int | + repo_id = 56 # int | + authorization = None # object | (optional) + + try: + # Get Check Suite Settings + api_response = api_instance.get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get(org_id, repo_id, authorization=authorization) + print("The response of RepositoriesApi->get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RepositoriesApi->get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **repo_id** | **int**| | + **authorization** | [**object**](.md)| | [optional] + +### Return type + +[**CheckSuiteSettingsResponse**](CheckSuiteSettingsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_0** +> CheckSuiteSettingsResponse get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_0(org_id, repo_id, authorization=authorization) + +Get Check Suite Settings + +Get check suite retry settings for a repository. + +Returns the current configuration for check suite retry logic including: +- retry_count: Maximum number of retry attempts per failed check +- ignored_checks: List of check names that should be ignored + +Rate limit: 60 requests per 30 seconds. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.check_suite_settings_response import CheckSuiteSettingsResponse +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.RepositoriesApi(api_client) + org_id = 56 # int | + repo_id = 56 # int | + authorization = None # object | (optional) + + try: + # Get Check Suite Settings + api_response = api_instance.get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_0(org_id, repo_id, authorization=authorization) + print("The response of RepositoriesApi->get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_0:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RepositoriesApi->get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_0: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **repo_id** | **int**| | + **authorization** | [**object**](.md)| | [optional] + +### Return type + +[**CheckSuiteSettingsResponse**](CheckSuiteSettingsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_1** +> CheckSuiteSettingsResponse get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_1(org_id, repo_id, authorization=authorization) + +Get Check Suite Settings + +Get check suite retry settings for a repository. + +Returns the current configuration for check suite retry logic including: +- retry_count: Maximum number of retry attempts per failed check +- ignored_checks: List of check names that should be ignored + +Rate limit: 60 requests per 30 seconds. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.check_suite_settings_response import CheckSuiteSettingsResponse +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.RepositoriesApi(api_client) + org_id = 56 # int | + repo_id = 56 # int | + authorization = None # object | (optional) + + try: + # Get Check Suite Settings + api_response = api_instance.get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_1(org_id, repo_id, authorization=authorization) + print("The response of RepositoriesApi->get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_1:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RepositoriesApi->get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_1: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **repo_id** | **int**| | + **authorization** | [**object**](.md)| | [optional] + +### Return type + +[**CheckSuiteSettingsResponse**](CheckSuiteSettingsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_repositories_v1_organizations_org_id_repos_get** +> PageRepoResponse get_repositories_v1_organizations_org_id_repos_get(org_id, skip=skip, limit=limit, authorization=authorization) + +Get Repositories + +Get repositories for the specified organization. + +Returns a paginated list of all repositories that belong to the specified organization. +Results include repository details such as name, ID, description, visibility, and setup status. +Use pagination parameters to control the number of results returned. + +Rate limit: 60 requests per 30 seconds. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.page_repo_response import PageRepoResponse +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.RepositoriesApi(api_client) + org_id = 56 # int | + skip = 0 # int | (optional) (default to 0) + limit = 100 # int | (optional) (default to 100) + authorization = None # object | (optional) + + try: + # Get Repositories + api_response = api_instance.get_repositories_v1_organizations_org_id_repos_get(org_id, skip=skip, limit=limit, authorization=authorization) + print("The response of RepositoriesApi->get_repositories_v1_organizations_org_id_repos_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RepositoriesApi->get_repositories_v1_organizations_org_id_repos_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **skip** | **int**| | [optional] [default to 0] + **limit** | **int**| | [optional] [default to 100] + **authorization** | [**object**](.md)| | [optional] + +### Return type + +[**PageRepoResponse**](PageRepoResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_repositories_v1_organizations_org_id_repos_get_0** +> PageRepoResponse get_repositories_v1_organizations_org_id_repos_get_0(org_id, skip=skip, limit=limit, authorization=authorization) + +Get Repositories + +Get repositories for the specified organization. + +Returns a paginated list of all repositories that belong to the specified organization. +Results include repository details such as name, ID, description, visibility, and setup status. +Use pagination parameters to control the number of results returned. + +Rate limit: 60 requests per 30 seconds. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.page_repo_response import PageRepoResponse +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.RepositoriesApi(api_client) + org_id = 56 # int | + skip = 0 # int | (optional) (default to 0) + limit = 100 # int | (optional) (default to 100) + authorization = None # object | (optional) + + try: + # Get Repositories + api_response = api_instance.get_repositories_v1_organizations_org_id_repos_get_0(org_id, skip=skip, limit=limit, authorization=authorization) + print("The response of RepositoriesApi->get_repositories_v1_organizations_org_id_repos_get_0:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RepositoriesApi->get_repositories_v1_organizations_org_id_repos_get_0: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **skip** | **int**| | [optional] [default to 0] + **limit** | **int**| | [optional] [default to 100] + **authorization** | [**object**](.md)| | [optional] + +### Return type + +[**PageRepoResponse**](PageRepoResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_repositories_v1_organizations_org_id_repos_get_1** +> PageRepoResponse get_repositories_v1_organizations_org_id_repos_get_1(org_id, skip=skip, limit=limit, authorization=authorization) + +Get Repositories + +Get repositories for the specified organization. + +Returns a paginated list of all repositories that belong to the specified organization. +Results include repository details such as name, ID, description, visibility, and setup status. +Use pagination parameters to control the number of results returned. + +Rate limit: 60 requests per 30 seconds. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.page_repo_response import PageRepoResponse +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.RepositoriesApi(api_client) + org_id = 56 # int | + skip = 0 # int | (optional) (default to 0) + limit = 100 # int | (optional) (default to 100) + authorization = None # object | (optional) + + try: + # Get Repositories + api_response = api_instance.get_repositories_v1_organizations_org_id_repos_get_1(org_id, skip=skip, limit=limit, authorization=authorization) + print("The response of RepositoriesApi->get_repositories_v1_organizations_org_id_repos_get_1:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RepositoriesApi->get_repositories_v1_organizations_org_id_repos_get_1: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **skip** | **int**| | [optional] [default to 0] + **limit** | **int**| | [optional] [default to 100] + **authorization** | [**object**](.md)| | [optional] + +### Return type + +[**PageRepoResponse**](PageRepoResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put** +> CheckSuiteSettingsResponse update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put(org_id, repo_id, update_check_suite_settings_request, authorization=authorization) + +Update Check Suite Settings + +Update check suite retry settings for a repository. + +Updates the configuration for check suite retry logic. You can update: +- retry_count: Maximum number of retry attempts per failed check (0-10) +- ignored_checks: List of check names that should be ignored + +Rate limit: 30 requests per 60 seconds. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.check_suite_settings_response import CheckSuiteSettingsResponse +from codegen_api_client.models.update_check_suite_settings_request import UpdateCheckSuiteSettingsRequest +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.RepositoriesApi(api_client) + org_id = 56 # int | + repo_id = 56 # int | + update_check_suite_settings_request = codegen_api_client.UpdateCheckSuiteSettingsRequest() # UpdateCheckSuiteSettingsRequest | + authorization = None # object | (optional) + + try: + # Update Check Suite Settings + api_response = api_instance.update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put(org_id, repo_id, update_check_suite_settings_request, authorization=authorization) + print("The response of RepositoriesApi->update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RepositoriesApi->update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **repo_id** | **int**| | + **update_check_suite_settings_request** | [**UpdateCheckSuiteSettingsRequest**](UpdateCheckSuiteSettingsRequest.md)| | + **authorization** | [**object**](.md)| | [optional] + +### Return type + +[**CheckSuiteSettingsResponse**](CheckSuiteSettingsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_0** +> CheckSuiteSettingsResponse update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_0(org_id, repo_id, update_check_suite_settings_request, authorization=authorization) + +Update Check Suite Settings + +Update check suite retry settings for a repository. + +Updates the configuration for check suite retry logic. You can update: +- retry_count: Maximum number of retry attempts per failed check (0-10) +- ignored_checks: List of check names that should be ignored + +Rate limit: 30 requests per 60 seconds. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.check_suite_settings_response import CheckSuiteSettingsResponse +from codegen_api_client.models.update_check_suite_settings_request import UpdateCheckSuiteSettingsRequest +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.RepositoriesApi(api_client) + org_id = 56 # int | + repo_id = 56 # int | + update_check_suite_settings_request = codegen_api_client.UpdateCheckSuiteSettingsRequest() # UpdateCheckSuiteSettingsRequest | + authorization = None # object | (optional) + + try: + # Update Check Suite Settings + api_response = api_instance.update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_0(org_id, repo_id, update_check_suite_settings_request, authorization=authorization) + print("The response of RepositoriesApi->update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_0:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RepositoriesApi->update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_0: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **repo_id** | **int**| | + **update_check_suite_settings_request** | [**UpdateCheckSuiteSettingsRequest**](UpdateCheckSuiteSettingsRequest.md)| | + **authorization** | [**object**](.md)| | [optional] + +### Return type + +[**CheckSuiteSettingsResponse**](CheckSuiteSettingsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_1** +> CheckSuiteSettingsResponse update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_1(org_id, repo_id, update_check_suite_settings_request, authorization=authorization) + +Update Check Suite Settings + +Update check suite retry settings for a repository. + +Updates the configuration for check suite retry logic. You can update: +- retry_count: Maximum number of retry attempts per failed check (0-10) +- ignored_checks: List of check names that should be ignored + +Rate limit: 30 requests per 60 seconds. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.check_suite_settings_response import CheckSuiteSettingsResponse +from codegen_api_client.models.update_check_suite_settings_request import UpdateCheckSuiteSettingsRequest +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.RepositoriesApi(api_client) + org_id = 56 # int | + repo_id = 56 # int | + update_check_suite_settings_request = codegen_api_client.UpdateCheckSuiteSettingsRequest() # UpdateCheckSuiteSettingsRequest | + authorization = None # object | (optional) + + try: + # Update Check Suite Settings + api_response = api_instance.update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_1(org_id, repo_id, update_check_suite_settings_request, authorization=authorization) + print("The response of RepositoriesApi->update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_1:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RepositoriesApi->update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_1: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **repo_id** | **int**| | + **update_check_suite_settings_request** | [**UpdateCheckSuiteSettingsRequest**](UpdateCheckSuiteSettingsRequest.md)| | + **authorization** | [**object**](.md)| | [optional] + +### Return type + +[**CheckSuiteSettingsResponse**](CheckSuiteSettingsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/ResumeAgentRunInput.md b/docs/ResumeAgentRunInput.md new file mode 100644 index 0000000..0a12425 --- /dev/null +++ b/docs/ResumeAgentRunInput.md @@ -0,0 +1,31 @@ +# ResumeAgentRunInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_run_id** | **int** | | +**prompt** | **str** | | +**images** | **List[str]** | | [optional] + +## Example + +```python +from codegen_api_client.models.resume_agent_run_input import ResumeAgentRunInput + +# TODO update the JSON string below +json = "{}" +# create an instance of ResumeAgentRunInput from a JSON string +resume_agent_run_input_instance = ResumeAgentRunInput.from_json(json) +# print the JSON string representation of the object +print(ResumeAgentRunInput.to_json()) + +# convert the object into a dict +resume_agent_run_input_dict = resume_agent_run_input_instance.to_dict() +# create an instance of ResumeAgentRunInput from a dict +resume_agent_run_input_from_dict = ResumeAgentRunInput.from_dict(resume_agent_run_input_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/docs/StopAgentRunInput.md b/docs/StopAgentRunInput.md new file mode 100644 index 0000000..f6f2307 --- /dev/null +++ b/docs/StopAgentRunInput.md @@ -0,0 +1,29 @@ +# StopAgentRunInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_run_id** | **int** | | + +## Example + +```python +from codegen_api_client.models.stop_agent_run_input import StopAgentRunInput + +# TODO update the JSON string below +json = "{}" +# create an instance of StopAgentRunInput from a JSON string +stop_agent_run_input_instance = StopAgentRunInput.from_json(json) +# print the JSON string representation of the object +print(StopAgentRunInput.to_json()) + +# convert the object into a dict +stop_agent_run_input_dict = stop_agent_run_input_instance.to_dict() +# create an instance of StopAgentRunInput from a dict +stop_agent_run_input_from_dict = StopAgentRunInput.from_dict(stop_agent_run_input_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/docs/ToolExecutionRequest.md b/docs/ToolExecutionRequest.md new file mode 100644 index 0000000..a8f3590 --- /dev/null +++ b/docs/ToolExecutionRequest.md @@ -0,0 +1,32 @@ +# ToolExecutionRequest + +Request schema for tool execution. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tool_name** | **str** | Name of the tool to execute | +**arguments** | **Dict[str, object]** | JSON arguments to pass to the tool | +**repo_id** | **int** | | [optional] + +## Example + +```python +from codegen_api_client.models.tool_execution_request import ToolExecutionRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of ToolExecutionRequest from a JSON string +tool_execution_request_instance = ToolExecutionRequest.from_json(json) +# print the JSON string representation of the object +print(ToolExecutionRequest.to_json()) + +# convert the object into a dict +tool_execution_request_dict = tool_execution_request_instance.to_dict() +# create an instance of ToolExecutionRequest from a dict +tool_execution_request_from_dict = ToolExecutionRequest.from_dict(tool_execution_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/docs/ToolExecutionResponse.md b/docs/ToolExecutionResponse.md new file mode 100644 index 0000000..b3acc6a --- /dev/null +++ b/docs/ToolExecutionResponse.md @@ -0,0 +1,34 @@ +# ToolExecutionResponse + +Response schema for tool execution. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | Whether the tool execution was successful | +**result** | **object** | | [optional] +**error** | **str** | | [optional] +**tool_name** | **str** | Name of the executed tool | +**execution_time_ms** | **float** | | [optional] + +## Example + +```python +from codegen_api_client.models.tool_execution_response import ToolExecutionResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ToolExecutionResponse from a JSON string +tool_execution_response_instance = ToolExecutionResponse.from_json(json) +# print the JSON string representation of the object +print(ToolExecutionResponse.to_json()) + +# convert the object into a dict +tool_execution_response_dict = tool_execution_response_instance.to_dict() +# create an instance of ToolExecutionResponse from a dict +tool_execution_response_from_dict = ToolExecutionResponse.from_dict(tool_execution_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/docs/ToolsApi.md b/docs/ToolsApi.md new file mode 100644 index 0000000..3b9c69c --- /dev/null +++ b/docs/ToolsApi.md @@ -0,0 +1,527 @@ +# codegen_api_client.ToolsApi + +All URIs are relative to *https://api.codegen.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**execute_tool_v1_organizations_org_id_tools_execute_post**](ToolsApi.md#execute_tool_v1_organizations_org_id_tools_execute_post) | **POST** /v1/organizations/{org_id}/tools/execute | Execute Tool +[**execute_tool_v1_organizations_org_id_tools_execute_post_0**](ToolsApi.md#execute_tool_v1_organizations_org_id_tools_execute_post_0) | **POST** /v1/organizations/{org_id}/tools/execute | Execute Tool +[**execute_tool_v1_organizations_org_id_tools_execute_post_1**](ToolsApi.md#execute_tool_v1_organizations_org_id_tools_execute_post_1) | **POST** /v1/organizations/{org_id}/tools/execute | Execute Tool +[**get_available_tools_v1_organizations_org_id_tools_get**](ToolsApi.md#get_available_tools_v1_organizations_org_id_tools_get) | **GET** /v1/organizations/{org_id}/tools | Get Available Tools +[**get_available_tools_v1_organizations_org_id_tools_get_0**](ToolsApi.md#get_available_tools_v1_organizations_org_id_tools_get_0) | **GET** /v1/organizations/{org_id}/tools | Get Available Tools +[**get_available_tools_v1_organizations_org_id_tools_get_1**](ToolsApi.md#get_available_tools_v1_organizations_org_id_tools_get_1) | **GET** /v1/organizations/{org_id}/tools | Get Available Tools + + +# **execute_tool_v1_organizations_org_id_tools_execute_post** +> ToolExecutionResponse execute_tool_v1_organizations_org_id_tools_execute_post(org_id, tool_execution_request, authorization=authorization) + +Execute Tool + +Execute a specific tool with the provided arguments. + +This endpoint allows direct execution of available tools by providing the tool name +and arguments as JSON. The tool will be executed in the context of the authenticated +user's organization and permissions. + +The tool execution happens with the same permissions and context as if the tool +were called by an agent, ensuring proper security and access control. + +Rate limit: 30 requests per minute. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.tool_execution_request import ToolExecutionRequest +from codegen_api_client.models.tool_execution_response import ToolExecutionResponse +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.ToolsApi(api_client) + org_id = 56 # int | + tool_execution_request = codegen_api_client.ToolExecutionRequest() # ToolExecutionRequest | + authorization = None # object | (optional) + + try: + # Execute Tool + api_response = api_instance.execute_tool_v1_organizations_org_id_tools_execute_post(org_id, tool_execution_request, authorization=authorization) + print("The response of ToolsApi->execute_tool_v1_organizations_org_id_tools_execute_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ToolsApi->execute_tool_v1_organizations_org_id_tools_execute_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **tool_execution_request** | [**ToolExecutionRequest**](ToolExecutionRequest.md)| | + **authorization** | [**object**](.md)| | [optional] + +### Return type + +[**ToolExecutionResponse**](ToolExecutionResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**403** | Forbidden | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **execute_tool_v1_organizations_org_id_tools_execute_post_0** +> ToolExecutionResponse execute_tool_v1_organizations_org_id_tools_execute_post_0(org_id, tool_execution_request, authorization=authorization) + +Execute Tool + +Execute a specific tool with the provided arguments. + +This endpoint allows direct execution of available tools by providing the tool name +and arguments as JSON. The tool will be executed in the context of the authenticated +user's organization and permissions. + +The tool execution happens with the same permissions and context as if the tool +were called by an agent, ensuring proper security and access control. + +Rate limit: 30 requests per minute. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.tool_execution_request import ToolExecutionRequest +from codegen_api_client.models.tool_execution_response import ToolExecutionResponse +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.ToolsApi(api_client) + org_id = 56 # int | + tool_execution_request = codegen_api_client.ToolExecutionRequest() # ToolExecutionRequest | + authorization = None # object | (optional) + + try: + # Execute Tool + api_response = api_instance.execute_tool_v1_organizations_org_id_tools_execute_post_0(org_id, tool_execution_request, authorization=authorization) + print("The response of ToolsApi->execute_tool_v1_organizations_org_id_tools_execute_post_0:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ToolsApi->execute_tool_v1_organizations_org_id_tools_execute_post_0: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **tool_execution_request** | [**ToolExecutionRequest**](ToolExecutionRequest.md)| | + **authorization** | [**object**](.md)| | [optional] + +### Return type + +[**ToolExecutionResponse**](ToolExecutionResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**403** | Forbidden | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **execute_tool_v1_organizations_org_id_tools_execute_post_1** +> ToolExecutionResponse execute_tool_v1_organizations_org_id_tools_execute_post_1(org_id, tool_execution_request, authorization=authorization) + +Execute Tool + +Execute a specific tool with the provided arguments. + +This endpoint allows direct execution of available tools by providing the tool name +and arguments as JSON. The tool will be executed in the context of the authenticated +user's organization and permissions. + +The tool execution happens with the same permissions and context as if the tool +were called by an agent, ensuring proper security and access control. + +Rate limit: 30 requests per minute. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.tool_execution_request import ToolExecutionRequest +from codegen_api_client.models.tool_execution_response import ToolExecutionResponse +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.ToolsApi(api_client) + org_id = 56 # int | + tool_execution_request = codegen_api_client.ToolExecutionRequest() # ToolExecutionRequest | + authorization = None # object | (optional) + + try: + # Execute Tool + api_response = api_instance.execute_tool_v1_organizations_org_id_tools_execute_post_1(org_id, tool_execution_request, authorization=authorization) + print("The response of ToolsApi->execute_tool_v1_organizations_org_id_tools_execute_post_1:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ToolsApi->execute_tool_v1_organizations_org_id_tools_execute_post_1: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **tool_execution_request** | [**ToolExecutionRequest**](ToolExecutionRequest.md)| | + **authorization** | [**object**](.md)| | [optional] + +### Return type + +[**ToolExecutionResponse**](ToolExecutionResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**403** | Forbidden | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_available_tools_v1_organizations_org_id_tools_get** +> Dict[str, object] get_available_tools_v1_organizations_org_id_tools_get(org_id, repo_id=repo_id, authorization=authorization) + +Get Available Tools + +Get a list of all available tools for the given API token and organization. + +Returns a comprehensive list of tools that can be used with the current API token, +including their names, descriptions, and parameter specifications. Tools are filtered +based on the organization's permissions and enabled integrations. + +The response includes tool schemas that can be used to understand: +- Tool name and description +- Required and optional parameters +- Parameter types and constraints +- Default values where applicable + +Rate limit: 60 requests per 30 seconds. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.ToolsApi(api_client) + org_id = 56 # int | + repo_id = 56 # int | Optional repository ID to filter tools for specific repository context (optional) + authorization = None # object | (optional) + + try: + # Get Available Tools + api_response = api_instance.get_available_tools_v1_organizations_org_id_tools_get(org_id, repo_id=repo_id, authorization=authorization) + print("The response of ToolsApi->get_available_tools_v1_organizations_org_id_tools_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ToolsApi->get_available_tools_v1_organizations_org_id_tools_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **repo_id** | **int**| Optional repository ID to filter tools for specific repository context | [optional] + **authorization** | [**object**](.md)| | [optional] + +### Return type + +**Dict[str, object]** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**403** | Forbidden | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_available_tools_v1_organizations_org_id_tools_get_0** +> Dict[str, object] get_available_tools_v1_organizations_org_id_tools_get_0(org_id, repo_id=repo_id, authorization=authorization) + +Get Available Tools + +Get a list of all available tools for the given API token and organization. + +Returns a comprehensive list of tools that can be used with the current API token, +including their names, descriptions, and parameter specifications. Tools are filtered +based on the organization's permissions and enabled integrations. + +The response includes tool schemas that can be used to understand: +- Tool name and description +- Required and optional parameters +- Parameter types and constraints +- Default values where applicable + +Rate limit: 60 requests per 30 seconds. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.ToolsApi(api_client) + org_id = 56 # int | + repo_id = 56 # int | Optional repository ID to filter tools for specific repository context (optional) + authorization = None # object | (optional) + + try: + # Get Available Tools + api_response = api_instance.get_available_tools_v1_organizations_org_id_tools_get_0(org_id, repo_id=repo_id, authorization=authorization) + print("The response of ToolsApi->get_available_tools_v1_organizations_org_id_tools_get_0:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ToolsApi->get_available_tools_v1_organizations_org_id_tools_get_0: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **repo_id** | **int**| Optional repository ID to filter tools for specific repository context | [optional] + **authorization** | [**object**](.md)| | [optional] + +### Return type + +**Dict[str, object]** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**403** | Forbidden | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_available_tools_v1_organizations_org_id_tools_get_1** +> Dict[str, object] get_available_tools_v1_organizations_org_id_tools_get_1(org_id, repo_id=repo_id, authorization=authorization) + +Get Available Tools + +Get a list of all available tools for the given API token and organization. + +Returns a comprehensive list of tools that can be used with the current API token, +including their names, descriptions, and parameter specifications. Tools are filtered +based on the organization's permissions and enabled integrations. + +The response includes tool schemas that can be used to understand: +- Tool name and description +- Required and optional parameters +- Parameter types and constraints +- Default values where applicable + +Rate limit: 60 requests per 30 seconds. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.ToolsApi(api_client) + org_id = 56 # int | + repo_id = 56 # int | Optional repository ID to filter tools for specific repository context (optional) + authorization = None # object | (optional) + + try: + # Get Available Tools + api_response = api_instance.get_available_tools_v1_organizations_org_id_tools_get_1(org_id, repo_id=repo_id, authorization=authorization) + print("The response of ToolsApi->get_available_tools_v1_organizations_org_id_tools_get_1:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ToolsApi->get_available_tools_v1_organizations_org_id_tools_get_1: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| | + **repo_id** | **int**| Optional repository ID to filter tools for specific repository context | [optional] + **authorization** | [**object**](.md)| | [optional] + +### Return type + +**Dict[str, object]** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**403** | Forbidden | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/UpdateCheckSuiteSettingsRequest.md b/docs/UpdateCheckSuiteSettingsRequest.md new file mode 100644 index 0000000..b652b4a --- /dev/null +++ b/docs/UpdateCheckSuiteSettingsRequest.md @@ -0,0 +1,31 @@ +# UpdateCheckSuiteSettingsRequest + +Request model for updating check suite settings. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**retry_count** | **int** | | [optional] +**ignored_checks** | **List[str]** | | [optional] + +## Example + +```python +from codegen_api_client.models.update_check_suite_settings_request import UpdateCheckSuiteSettingsRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateCheckSuiteSettingsRequest from a JSON string +update_check_suite_settings_request_instance = UpdateCheckSuiteSettingsRequest.from_json(json) +# print the JSON string representation of the object +print(UpdateCheckSuiteSettingsRequest.to_json()) + +# convert the object into a dict +update_check_suite_settings_request_dict = update_check_suite_settings_request_instance.to_dict() +# create an instance of UpdateCheckSuiteSettingsRequest from a dict +update_check_suite_settings_request_from_dict = UpdateCheckSuiteSettingsRequest.from_dict(update_check_suite_settings_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/docs/UserNotFoundErrorResponse.md b/docs/UserNotFoundErrorResponse.md new file mode 100644 index 0000000..cd19ff0 --- /dev/null +++ b/docs/UserNotFoundErrorResponse.md @@ -0,0 +1,30 @@ +# UserNotFoundErrorResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **str** | | [optional] [default to 'User not found.'] +**status_code** | **int** | | [optional] [default to 404] + +## Example + +```python +from codegen_api_client.models.user_not_found_error_response import UserNotFoundErrorResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of UserNotFoundErrorResponse from a JSON string +user_not_found_error_response_instance = UserNotFoundErrorResponse.from_json(json) +# print the JSON string representation of the object +print(UserNotFoundErrorResponse.to_json()) + +# convert the object into a dict +user_not_found_error_response_dict = user_not_found_error_response_instance.to_dict() +# create an instance of UserNotFoundErrorResponse from a dict +user_not_found_error_response_from_dict = UserNotFoundErrorResponse.from_dict(user_not_found_error_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/docs/UserResponse.md b/docs/UserResponse.md index fc2f56d..052dd8f 100644 --- a/docs/UserResponse.md +++ b/docs/UserResponse.md @@ -6,12 +6,14 @@ Represents a user in API responses Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | -**email** | **str** | | -**github_user_id** | **str** | | -**github_username** | **str** | | -**avatar_url** | **str** | | -**full_name** | **str** | | +**id** | **int** | Unique user ID | +**email** | **str** | | [optional] +**github_user_id** | **str** | GitHub user ID | +**github_username** | **str** | GitHub username | +**avatar_url** | **str** | | [optional] +**full_name** | **str** | | [optional] +**role** | **str** | | [optional] +**is_admin** | **bool** | | [optional] ## Example diff --git a/docs/UsersApi.md b/docs/UsersApi.md index a288359..38df3a1 100644 --- a/docs/UsersApi.md +++ b/docs/UsersApi.md @@ -1,9 +1,12 @@ # codegen_api_client.UsersApi -All URIs are relative to *http://localhost* +All URIs are relative to *https://api.codegen.com* Method | HTTP request | Description ------------- | ------------- | ------------- +[**get_current_user_info_v1_users_me_get**](UsersApi.md#get_current_user_info_v1_users_me_get) | **GET** /v1/users/me | Get Current User Info +[**get_current_user_info_v1_users_me_get_0**](UsersApi.md#get_current_user_info_v1_users_me_get_0) | **GET** /v1/users/me | Get Current User Info +[**get_current_user_info_v1_users_me_get_1**](UsersApi.md#get_current_user_info_v1_users_me_get_1) | **GET** /v1/users/me | Get Current User Info [**get_user_v1_organizations_org_id_users_user_id_get**](UsersApi.md#get_user_v1_organizations_org_id_users_user_id_get) | **GET** /v1/organizations/{org_id}/users/{user_id} | Get User [**get_user_v1_organizations_org_id_users_user_id_get_0**](UsersApi.md#get_user_v1_organizations_org_id_users_user_id_get_0) | **GET** /v1/organizations/{org_id}/users/{user_id} | Get User [**get_user_v1_organizations_org_id_users_user_id_get_1**](UsersApi.md#get_user_v1_organizations_org_id_users_user_id_get_1) | **GET** /v1/organizations/{org_id}/users/{user_id} | Get User @@ -12,6 +15,234 @@ Method | HTTP request | Description [**get_users_v1_organizations_org_id_users_get_1**](UsersApi.md#get_users_v1_organizations_org_id_users_get_1) | **GET** /v1/organizations/{org_id}/users | Get Users +# **get_current_user_info_v1_users_me_get** +> UserResponse get_current_user_info_v1_users_me_get(authorization=authorization) + +Get Current User Info + +Get current user information from API token. + +Returns detailed information about the user associated with the provided API token. +This is useful for applications that need to identify the current user from their API token. + +Rate limit: 60 requests per 30 seconds. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.user_response import UserResponse +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.UsersApi(api_client) + authorization = None # object | (optional) + + try: + # Get Current User Info + api_response = api_instance.get_current_user_info_v1_users_me_get(authorization=authorization) + print("The response of UsersApi->get_current_user_info_v1_users_me_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UsersApi->get_current_user_info_v1_users_me_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **authorization** | [**object**](.md)| | [optional] + +### Return type + +[**UserResponse**](UserResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**403** | Forbidden | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_current_user_info_v1_users_me_get_0** +> UserResponse get_current_user_info_v1_users_me_get_0(authorization=authorization) + +Get Current User Info + +Get current user information from API token. + +Returns detailed information about the user associated with the provided API token. +This is useful for applications that need to identify the current user from their API token. + +Rate limit: 60 requests per 30 seconds. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.user_response import UserResponse +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.UsersApi(api_client) + authorization = None # object | (optional) + + try: + # Get Current User Info + api_response = api_instance.get_current_user_info_v1_users_me_get_0(authorization=authorization) + print("The response of UsersApi->get_current_user_info_v1_users_me_get_0:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UsersApi->get_current_user_info_v1_users_me_get_0: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **authorization** | [**object**](.md)| | [optional] + +### Return type + +[**UserResponse**](UserResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**403** | Forbidden | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_current_user_info_v1_users_me_get_1** +> UserResponse get_current_user_info_v1_users_me_get_1(authorization=authorization) + +Get Current User Info + +Get current user information from API token. + +Returns detailed information about the user associated with the provided API token. +This is useful for applications that need to identify the current user from their API token. + +Rate limit: 60 requests per 30 seconds. + +### Example + + +```python +import codegen_api_client +from codegen_api_client.models.user_response import UserResponse +from codegen_api_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.codegen.com +# See configuration.py for a list of all supported configuration parameters. +configuration = codegen_api_client.Configuration( + host = "https://api.codegen.com" +) + + +# Enter a context with an instance of the API client +with codegen_api_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = codegen_api_client.UsersApi(api_client) + authorization = None # object | (optional) + + try: + # Get Current User Info + api_response = api_instance.get_current_user_info_v1_users_me_get_1(authorization=authorization) + print("The response of UsersApi->get_current_user_info_v1_users_me_get_1:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UsersApi->get_current_user_info_v1_users_me_get_1: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **authorization** | [**object**](.md)| | [optional] + +### Return type + +[**UserResponse**](UserResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**429** | Too Many Requests | - | +**403** | Forbidden | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **get_user_v1_organizations_org_id_users_user_id_get** > UserResponse get_user_v1_organizations_org_id_users_user_id_get(org_id, user_id, authorization=authorization) @@ -22,6 +253,8 @@ Get details for a specific user in an organization. Returns detailed information about a user within the specified organization. The requesting user must be a member of the organization to access this endpoint. +Rate limit: 60 requests per 30 seconds. + ### Example @@ -31,10 +264,10 @@ from codegen_api_client.models.user_response import UserResponse from codegen_api_client.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to http://localhost +# Defining the host is optional and defaults to https://api.codegen.com # See configuration.py for a list of all supported configuration parameters. configuration = codegen_api_client.Configuration( - host = "http://localhost" + host = "https://api.codegen.com" ) @@ -42,8 +275,8 @@ configuration = codegen_api_client.Configuration( with codegen_api_client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = codegen_api_client.UsersApi(api_client) - org_id = 'org_id_example' # str | - user_id = 'user_id_example' # str | + org_id = 56 # int | + user_id = 56 # int | authorization = None # object | (optional) try: @@ -62,8 +295,8 @@ with codegen_api_client.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **org_id** | **str**| | - **user_id** | **str**| | + **org_id** | **int**| | + **user_id** | **int**| | **authorization** | [**object**](.md)| | [optional] ### Return type @@ -84,8 +317,10 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Successful Response | - | -**422** | Validation Error | - | **429** | Too Many Requests | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Validation Error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -99,6 +334,8 @@ Get details for a specific user in an organization. Returns detailed information about a user within the specified organization. The requesting user must be a member of the organization to access this endpoint. +Rate limit: 60 requests per 30 seconds. + ### Example @@ -108,10 +345,10 @@ from codegen_api_client.models.user_response import UserResponse from codegen_api_client.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to http://localhost +# Defining the host is optional and defaults to https://api.codegen.com # See configuration.py for a list of all supported configuration parameters. configuration = codegen_api_client.Configuration( - host = "http://localhost" + host = "https://api.codegen.com" ) @@ -119,8 +356,8 @@ configuration = codegen_api_client.Configuration( with codegen_api_client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = codegen_api_client.UsersApi(api_client) - org_id = 'org_id_example' # str | - user_id = 'user_id_example' # str | + org_id = 56 # int | + user_id = 56 # int | authorization = None # object | (optional) try: @@ -139,8 +376,8 @@ with codegen_api_client.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **org_id** | **str**| | - **user_id** | **str**| | + **org_id** | **int**| | + **user_id** | **int**| | **authorization** | [**object**](.md)| | [optional] ### Return type @@ -161,8 +398,10 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Successful Response | - | -**422** | Validation Error | - | **429** | Too Many Requests | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Validation Error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -176,6 +415,8 @@ Get details for a specific user in an organization. Returns detailed information about a user within the specified organization. The requesting user must be a member of the organization to access this endpoint. +Rate limit: 60 requests per 30 seconds. + ### Example @@ -185,10 +426,10 @@ from codegen_api_client.models.user_response import UserResponse from codegen_api_client.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to http://localhost +# Defining the host is optional and defaults to https://api.codegen.com # See configuration.py for a list of all supported configuration parameters. configuration = codegen_api_client.Configuration( - host = "http://localhost" + host = "https://api.codegen.com" ) @@ -196,8 +437,8 @@ configuration = codegen_api_client.Configuration( with codegen_api_client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = codegen_api_client.UsersApi(api_client) - org_id = 'org_id_example' # str | - user_id = 'user_id_example' # str | + org_id = 56 # int | + user_id = 56 # int | authorization = None # object | (optional) try: @@ -216,8 +457,8 @@ with codegen_api_client.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **org_id** | **str**| | - **user_id** | **str**| | + **org_id** | **int**| | + **user_id** | **int**| | **authorization** | [**object**](.md)| | [optional] ### Return type @@ -238,8 +479,10 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Successful Response | - | -**422** | Validation Error | - | **429** | Too Many Requests | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Validation Error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -248,10 +491,13 @@ No authorization required Get Users -Get paginated list of users for a specific organization. +Get users for the specified organization. -Returns a paginated list of all users associated with the specified organization. -The requesting user must be a member of the organization to access this endpoint. +Returns a paginated list of all users that belong to the specified organization. +Results include user details such as name, email, GitHub username, and avatar. +Use pagination parameters to control the number of results returned. + +Rate limit: 60 requests per 30 seconds. ### Example @@ -262,10 +508,10 @@ from codegen_api_client.models.page_user_response import PageUserResponse from codegen_api_client.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to http://localhost +# Defining the host is optional and defaults to https://api.codegen.com # See configuration.py for a list of all supported configuration parameters. configuration = codegen_api_client.Configuration( - host = "http://localhost" + host = "https://api.codegen.com" ) @@ -273,7 +519,7 @@ configuration = codegen_api_client.Configuration( with codegen_api_client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = codegen_api_client.UsersApi(api_client) - org_id = 'org_id_example' # str | + org_id = 56 # int | skip = 0 # int | (optional) (default to 0) limit = 100 # int | (optional) (default to 100) authorization = None # object | (optional) @@ -294,7 +540,7 @@ with codegen_api_client.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **org_id** | **str**| | + **org_id** | **int**| | **skip** | **int**| | [optional] [default to 0] **limit** | **int**| | [optional] [default to 100] **authorization** | [**object**](.md)| | [optional] @@ -317,8 +563,9 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Successful Response | - | -**422** | Validation Error | - | **429** | Too Many Requests | - | +**403** | Forbidden | - | +**422** | Validation Error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -327,10 +574,13 @@ No authorization required Get Users -Get paginated list of users for a specific organization. +Get users for the specified organization. -Returns a paginated list of all users associated with the specified organization. -The requesting user must be a member of the organization to access this endpoint. +Returns a paginated list of all users that belong to the specified organization. +Results include user details such as name, email, GitHub username, and avatar. +Use pagination parameters to control the number of results returned. + +Rate limit: 60 requests per 30 seconds. ### Example @@ -341,10 +591,10 @@ from codegen_api_client.models.page_user_response import PageUserResponse from codegen_api_client.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to http://localhost +# Defining the host is optional and defaults to https://api.codegen.com # See configuration.py for a list of all supported configuration parameters. configuration = codegen_api_client.Configuration( - host = "http://localhost" + host = "https://api.codegen.com" ) @@ -352,7 +602,7 @@ configuration = codegen_api_client.Configuration( with codegen_api_client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = codegen_api_client.UsersApi(api_client) - org_id = 'org_id_example' # str | + org_id = 56 # int | skip = 0 # int | (optional) (default to 0) limit = 100 # int | (optional) (default to 100) authorization = None # object | (optional) @@ -373,7 +623,7 @@ with codegen_api_client.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **org_id** | **str**| | + **org_id** | **int**| | **skip** | **int**| | [optional] [default to 0] **limit** | **int**| | [optional] [default to 100] **authorization** | [**object**](.md)| | [optional] @@ -396,8 +646,9 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Successful Response | - | -**422** | Validation Error | - | **429** | Too Many Requests | - | +**403** | Forbidden | - | +**422** | Validation Error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -406,10 +657,13 @@ No authorization required Get Users -Get paginated list of users for a specific organization. +Get users for the specified organization. -Returns a paginated list of all users associated with the specified organization. -The requesting user must be a member of the organization to access this endpoint. +Returns a paginated list of all users that belong to the specified organization. +Results include user details such as name, email, GitHub username, and avatar. +Use pagination parameters to control the number of results returned. + +Rate limit: 60 requests per 30 seconds. ### Example @@ -420,10 +674,10 @@ from codegen_api_client.models.page_user_response import PageUserResponse from codegen_api_client.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to http://localhost +# Defining the host is optional and defaults to https://api.codegen.com # See configuration.py for a list of all supported configuration parameters. configuration = codegen_api_client.Configuration( - host = "http://localhost" + host = "https://api.codegen.com" ) @@ -431,7 +685,7 @@ configuration = codegen_api_client.Configuration( with codegen_api_client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = codegen_api_client.UsersApi(api_client) - org_id = 'org_id_example' # str | + org_id = 56 # int | skip = 0 # int | (optional) (default to 0) limit = 100 # int | (optional) (default to 100) authorization = None # object | (optional) @@ -452,7 +706,7 @@ with codegen_api_client.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **org_id** | **str**| | + **org_id** | **int**| | **skip** | **int**| | [optional] [default to 0] **limit** | **int**| | [optional] [default to 100] **authorization** | [**object**](.md)| | [optional] @@ -475,8 +729,9 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Successful Response | - | -**422** | Validation Error | - | **429** | Too Many Requests | - | +**403** | Forbidden | - | +**422** | Validation Error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/gen/developer-api-client/developer_api_client/api/agents_alpha/__init__.py b/gen/developer-api-client/developer_api_client/api/agents_alpha/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/api/agents_alpha/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/gen/developer-api-client/developer_api_client/api/integrations/__init__.py b/gen/developer-api-client/developer_api_client/api/integrations/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/api/integrations/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/gen/developer-api-client/developer_api_client/api/linear/__init__.py b/gen/developer-api-client/developer_api_client/api/linear/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/api/linear/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/gen/developer-api-client/developer_api_client/api/repositories/__init__.py b/gen/developer-api-client/developer_api_client/api/repositories/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/api/repositories/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/gen/developer-api-client/developer_api_client/api/tools/__init__.py b/gen/developer-api-client/developer_api_client/api/tools/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/api/tools/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/gen/developer-api-client/developer_api_client/models/__init__.py b/gen/developer-api-client/developer_api_client/models/__init__.py index 7be2b72..9b59835 100644 --- a/gen/developer-api-client/developer_api_client/models/__init__.py +++ b/gen/developer-api-client/developer_api_client/models/__init__.py @@ -1,25 +1,83 @@ """Contains all the data models used in inputs/outputs""" +from .agent_run_limit_reached_error_response import AgentRunLimitReachedErrorResponse +from .agent_run_log_response import AgentRunLogResponse +from .agent_run_log_response_observation_type_0 import AgentRunLogResponseObservationType0 +from .agent_run_log_response_tool_input_type_0 import AgentRunLogResponseToolInputType0 +from .agent_run_log_response_tool_output_type_0 import AgentRunLogResponseToolOutputType0 +from .agent_run_not_found_error_response import AgentRunNotFoundErrorResponse from .agent_run_response import AgentRunResponse +from .agent_run_response_metadata_type_0 import AgentRunResponseMetadataType0 +from .agent_run_with_logs_response import AgentRunWithLogsResponse +from .agent_run_with_logs_response_metadata_type_0 import AgentRunWithLogsResponseMetadataType0 +from .api_agent_run_source_type import ApiAgentRunSourceType +from .api_rate_limit_error_response import APIRateLimitErrorResponse +from .check_suite_retry_stats_response import CheckSuiteRetryStatsResponse +from .check_suite_settings_response import CheckSuiteSettingsResponse from .create_agent_run_input import CreateAgentRunInput -from .fast_api_rate_limit_response import FastAPIRateLimitResponse +from .create_agent_run_input_metadata_type_0 import CreateAgentRunInputMetadataType0 +from .github_pull_request_response import GithubPullRequestResponse from .http_validation_error import HTTPValidationError +from .integration_status import IntegrationStatus +from .integration_status_metadata_type_0 import IntegrationStatusMetadataType0 +from .no_repos_found_in_org_error_response import NoReposFoundInOrgErrorResponse +from .organization_integrations_response import OrganizationIntegrationsResponse from .organization_response import OrganizationResponse from .organization_settings import OrganizationSettings +from .page_agent_run_response import PageAgentRunResponse from .page_organization_response import PageOrganizationResponse +from .page_repo_response import PageRepoResponse from .page_user_response import PageUserResponse +from .permissions_error_response import PermissionsErrorResponse +from .repo_response import RepoResponse +from .resume_agent_run_input import ResumeAgentRunInput +from .stop_agent_run_input import StopAgentRunInput +from .tool_execution_request import ToolExecutionRequest +from .tool_execution_request_arguments import ToolExecutionRequestArguments +from .tool_execution_response import ToolExecutionResponse +from .update_check_suite_settings_request import UpdateCheckSuiteSettingsRequest +from .user_not_found_error_response import UserNotFoundErrorResponse from .user_response import UserResponse from .validation_error import ValidationError __all__ = ( + "AgentRunLimitReachedErrorResponse", + "AgentRunLogResponse", + "AgentRunLogResponseObservationType0", + "AgentRunLogResponseToolInputType0", + "AgentRunLogResponseToolOutputType0", + "AgentRunNotFoundErrorResponse", "AgentRunResponse", + "AgentRunResponseMetadataType0", + "AgentRunWithLogsResponse", + "AgentRunWithLogsResponseMetadataType0", + "ApiAgentRunSourceType", + "APIRateLimitErrorResponse", + "CheckSuiteRetryStatsResponse", + "CheckSuiteSettingsResponse", "CreateAgentRunInput", - "FastAPIRateLimitResponse", + "CreateAgentRunInputMetadataType0", + "GithubPullRequestResponse", "HTTPValidationError", + "IntegrationStatus", + "IntegrationStatusMetadataType0", + "NoReposFoundInOrgErrorResponse", + "OrganizationIntegrationsResponse", "OrganizationResponse", "OrganizationSettings", + "PageAgentRunResponse", "PageOrganizationResponse", + "PageRepoResponse", "PageUserResponse", + "PermissionsErrorResponse", + "RepoResponse", + "ResumeAgentRunInput", + "StopAgentRunInput", + "ToolExecutionRequest", + "ToolExecutionRequestArguments", + "ToolExecutionResponse", + "UpdateCheckSuiteSettingsRequest", + "UserNotFoundErrorResponse", "UserResponse", "ValidationError", ) diff --git a/gen/developer-api-client/developer_api_client/models/agent_run_limit_reached_error_response.py b/gen/developer-api-client/developer_api_client/models/agent_run_limit_reached_error_response.py new file mode 100644 index 0000000..d6f13b1 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/agent_run_limit_reached_error_response.py @@ -0,0 +1,71 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AgentRunLimitReachedErrorResponse") + + +@_attrs_define +class AgentRunLimitReachedErrorResponse: + """ + Attributes: + message (Union[Unset, str]): Default: 'Alloted agent runs for the current billing plan have been reached. + Please upgrade your plan to continue.'. + status_code (Union[Unset, int]): Default: 402. + """ + + message: Union[Unset, str] = ( + "Alloted agent runs for the current billing plan have been reached. Please upgrade your plan to continue." + ) + status_code: Union[Unset, int] = 402 + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status_code = self.status_code + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status_code is not UNSET: + field_dict["status_code"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + message = d.pop("message", UNSET) + + status_code = d.pop("status_code", UNSET) + + agent_run_limit_reached_error_response = cls( + message=message, + status_code=status_code, + ) + + agent_run_limit_reached_error_response.additional_properties = d + return agent_run_limit_reached_error_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/agent_run_log_response.py b/gen/developer-api-client/developer_api_client/models/agent_run_log_response.py new file mode 100644 index 0000000..f348635 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/agent_run_log_response.py @@ -0,0 +1,246 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.agent_run_log_response_observation_type_0 import AgentRunLogResponseObservationType0 + from ..models.agent_run_log_response_tool_input_type_0 import AgentRunLogResponseToolInputType0 + from ..models.agent_run_log_response_tool_output_type_0 import AgentRunLogResponseToolOutputType0 + + +T = TypeVar("T", bound="AgentRunLogResponse") + + +@_attrs_define +class AgentRunLogResponse: + """Represents an agent run log in API responses + + Attributes: + agent_run_id (int): + created_at (Union[None, Unset, str]): + tool_name (Union[None, Unset, str]): + message_type (Union[None, Unset, str]): + thought (Union[None, Unset, str]): + observation (Union['AgentRunLogResponseObservationType0', None, Unset, str]): + tool_input (Union['AgentRunLogResponseToolInputType0', None, Unset]): + tool_output (Union['AgentRunLogResponseToolOutputType0', None, Unset]): + """ + + agent_run_id: int + created_at: Union[None, Unset, str] = UNSET + tool_name: Union[None, Unset, str] = UNSET + message_type: Union[None, Unset, str] = UNSET + thought: Union[None, Unset, str] = UNSET + observation: Union["AgentRunLogResponseObservationType0", None, Unset, str] = UNSET + tool_input: Union["AgentRunLogResponseToolInputType0", None, Unset] = UNSET + tool_output: Union["AgentRunLogResponseToolOutputType0", None, Unset] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.agent_run_log_response_observation_type_0 import AgentRunLogResponseObservationType0 + from ..models.agent_run_log_response_tool_input_type_0 import AgentRunLogResponseToolInputType0 + from ..models.agent_run_log_response_tool_output_type_0 import AgentRunLogResponseToolOutputType0 + + agent_run_id = self.agent_run_id + + created_at: Union[None, Unset, str] + if isinstance(self.created_at, Unset): + created_at = UNSET + else: + created_at = self.created_at + + tool_name: Union[None, Unset, str] + if isinstance(self.tool_name, Unset): + tool_name = UNSET + else: + tool_name = self.tool_name + + message_type: Union[None, Unset, str] + if isinstance(self.message_type, Unset): + message_type = UNSET + else: + message_type = self.message_type + + thought: Union[None, Unset, str] + if isinstance(self.thought, Unset): + thought = UNSET + else: + thought = self.thought + + observation: Union[None, Unset, dict[str, Any], str] + if isinstance(self.observation, Unset): + observation = UNSET + elif isinstance(self.observation, AgentRunLogResponseObservationType0): + observation = self.observation.to_dict() + else: + observation = self.observation + + tool_input: Union[None, Unset, dict[str, Any]] + if isinstance(self.tool_input, Unset): + tool_input = UNSET + elif isinstance(self.tool_input, AgentRunLogResponseToolInputType0): + tool_input = self.tool_input.to_dict() + else: + tool_input = self.tool_input + + tool_output: Union[None, Unset, dict[str, Any]] + if isinstance(self.tool_output, Unset): + tool_output = UNSET + elif isinstance(self.tool_output, AgentRunLogResponseToolOutputType0): + tool_output = self.tool_output.to_dict() + else: + tool_output = self.tool_output + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "agent_run_id": agent_run_id, + } + ) + if created_at is not UNSET: + field_dict["created_at"] = created_at + if tool_name is not UNSET: + field_dict["tool_name"] = tool_name + if message_type is not UNSET: + field_dict["message_type"] = message_type + if thought is not UNSET: + field_dict["thought"] = thought + if observation is not UNSET: + field_dict["observation"] = observation + if tool_input is not UNSET: + field_dict["tool_input"] = tool_input + if tool_output is not UNSET: + field_dict["tool_output"] = tool_output + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.agent_run_log_response_observation_type_0 import AgentRunLogResponseObservationType0 + from ..models.agent_run_log_response_tool_input_type_0 import AgentRunLogResponseToolInputType0 + from ..models.agent_run_log_response_tool_output_type_0 import AgentRunLogResponseToolOutputType0 + + d = dict(src_dict) + agent_run_id = d.pop("agent_run_id") + + def _parse_created_at(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + created_at = _parse_created_at(d.pop("created_at", UNSET)) + + def _parse_tool_name(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + tool_name = _parse_tool_name(d.pop("tool_name", UNSET)) + + def _parse_message_type(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + message_type = _parse_message_type(d.pop("message_type", UNSET)) + + def _parse_thought(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + thought = _parse_thought(d.pop("thought", UNSET)) + + def _parse_observation(data: object) -> Union["AgentRunLogResponseObservationType0", None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + observation_type_0 = AgentRunLogResponseObservationType0.from_dict(data) + + return observation_type_0 + except: # noqa: E722 + pass + return cast(Union["AgentRunLogResponseObservationType0", None, Unset, str], data) + + observation = _parse_observation(d.pop("observation", UNSET)) + + def _parse_tool_input(data: object) -> Union["AgentRunLogResponseToolInputType0", None, Unset]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + tool_input_type_0 = AgentRunLogResponseToolInputType0.from_dict(data) + + return tool_input_type_0 + except: # noqa: E722 + pass + return cast(Union["AgentRunLogResponseToolInputType0", None, Unset], data) + + tool_input = _parse_tool_input(d.pop("tool_input", UNSET)) + + def _parse_tool_output(data: object) -> Union["AgentRunLogResponseToolOutputType0", None, Unset]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + tool_output_type_0 = AgentRunLogResponseToolOutputType0.from_dict(data) + + return tool_output_type_0 + except: # noqa: E722 + pass + return cast(Union["AgentRunLogResponseToolOutputType0", None, Unset], data) + + tool_output = _parse_tool_output(d.pop("tool_output", UNSET)) + + agent_run_log_response = cls( + agent_run_id=agent_run_id, + created_at=created_at, + tool_name=tool_name, + message_type=message_type, + thought=thought, + observation=observation, + tool_input=tool_input, + tool_output=tool_output, + ) + + agent_run_log_response.additional_properties = d + return agent_run_log_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/agent_run_log_response_observation_type_0.py b/gen/developer-api-client/developer_api_client/models/agent_run_log_response_observation_type_0.py new file mode 100644 index 0000000..8fa5509 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/agent_run_log_response_observation_type_0.py @@ -0,0 +1,44 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="AgentRunLogResponseObservationType0") + + +@_attrs_define +class AgentRunLogResponseObservationType0: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + agent_run_log_response_observation_type_0 = cls() + + agent_run_log_response_observation_type_0.additional_properties = d + return agent_run_log_response_observation_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/agent_run_log_response_tool_input_type_0.py b/gen/developer-api-client/developer_api_client/models/agent_run_log_response_tool_input_type_0.py new file mode 100644 index 0000000..e26a2dc --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/agent_run_log_response_tool_input_type_0.py @@ -0,0 +1,44 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="AgentRunLogResponseToolInputType0") + + +@_attrs_define +class AgentRunLogResponseToolInputType0: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + agent_run_log_response_tool_input_type_0 = cls() + + agent_run_log_response_tool_input_type_0.additional_properties = d + return agent_run_log_response_tool_input_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/agent_run_log_response_tool_output_type_0.py b/gen/developer-api-client/developer_api_client/models/agent_run_log_response_tool_output_type_0.py new file mode 100644 index 0000000..f0c7018 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/agent_run_log_response_tool_output_type_0.py @@ -0,0 +1,44 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="AgentRunLogResponseToolOutputType0") + + +@_attrs_define +class AgentRunLogResponseToolOutputType0: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + agent_run_log_response_tool_output_type_0 = cls() + + agent_run_log_response_tool_output_type_0.additional_properties = d + return agent_run_log_response_tool_output_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/agent_run_not_found_error_response.py b/gen/developer-api-client/developer_api_client/models/agent_run_not_found_error_response.py new file mode 100644 index 0000000..c557d07 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/agent_run_not_found_error_response.py @@ -0,0 +1,68 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AgentRunNotFoundErrorResponse") + + +@_attrs_define +class AgentRunNotFoundErrorResponse: + """ + Attributes: + message (Union[Unset, str]): Default: 'Agent run not found.'. + status_code (Union[Unset, int]): Default: 404. + """ + + message: Union[Unset, str] = "Agent run not found." + status_code: Union[Unset, int] = 404 + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status_code = self.status_code + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status_code is not UNSET: + field_dict["status_code"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + message = d.pop("message", UNSET) + + status_code = d.pop("status_code", UNSET) + + agent_run_not_found_error_response = cls( + message=message, + status_code=status_code, + ) + + agent_run_not_found_error_response.additional_properties = d + return agent_run_not_found_error_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/agent_run_response.py b/gen/developer-api-client/developer_api_client/models/agent_run_response.py index d8f34cd..3e415fe 100644 --- a/gen/developer-api-client/developer_api_client/models/agent_run_response.py +++ b/gen/developer-api-client/developer_api_client/models/agent_run_response.py @@ -1,11 +1,17 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field +from ..models.api_agent_run_source_type import ApiAgentRunSourceType from ..types import UNSET, Unset +if TYPE_CHECKING: + from ..models.agent_run_response_metadata_type_0 import AgentRunResponseMetadataType0 + from ..models.github_pull_request_response import GithubPullRequestResponse + + T = TypeVar("T", bound="AgentRunResponse") @@ -20,6 +26,9 @@ class AgentRunResponse: created_at (Union[None, Unset, str]): web_url (Union[None, Unset, str]): result (Union[None, Unset, str]): + source_type (Union[ApiAgentRunSourceType, None, Unset]): + github_pull_requests (Union[None, Unset, list['GithubPullRequestResponse']]): + metadata (Union['AgentRunResponseMetadataType0', None, Unset]): """ id: int @@ -28,9 +37,14 @@ class AgentRunResponse: created_at: Union[None, Unset, str] = UNSET web_url: Union[None, Unset, str] = UNSET result: Union[None, Unset, str] = UNSET + source_type: Union[ApiAgentRunSourceType, None, Unset] = UNSET + github_pull_requests: Union[None, Unset, list["GithubPullRequestResponse"]] = UNSET + metadata: Union["AgentRunResponseMetadataType0", None, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + from ..models.agent_run_response_metadata_type_0 import AgentRunResponseMetadataType0 + id = self.id organization_id = self.organization_id @@ -59,6 +73,34 @@ def to_dict(self) -> dict[str, Any]: else: result = self.result + source_type: Union[None, Unset, str] + if isinstance(self.source_type, Unset): + source_type = UNSET + elif isinstance(self.source_type, ApiAgentRunSourceType): + source_type = self.source_type.value + else: + source_type = self.source_type + + github_pull_requests: Union[None, Unset, list[dict[str, Any]]] + if isinstance(self.github_pull_requests, Unset): + github_pull_requests = UNSET + elif isinstance(self.github_pull_requests, list): + github_pull_requests = [] + for github_pull_requests_type_0_item_data in self.github_pull_requests: + github_pull_requests_type_0_item = github_pull_requests_type_0_item_data.to_dict() + github_pull_requests.append(github_pull_requests_type_0_item) + + else: + github_pull_requests = self.github_pull_requests + + metadata: Union[None, Unset, dict[str, Any]] + if isinstance(self.metadata, Unset): + metadata = UNSET + elif isinstance(self.metadata, AgentRunResponseMetadataType0): + metadata = self.metadata.to_dict() + else: + metadata = self.metadata + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -75,11 +117,20 @@ def to_dict(self) -> dict[str, Any]: field_dict["web_url"] = web_url if result is not UNSET: field_dict["result"] = result + if source_type is not UNSET: + field_dict["source_type"] = source_type + if github_pull_requests is not UNSET: + field_dict["github_pull_requests"] = github_pull_requests + if metadata is not UNSET: + field_dict["metadata"] = metadata return field_dict @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.agent_run_response_metadata_type_0 import AgentRunResponseMetadataType0 + from ..models.github_pull_request_response import GithubPullRequestResponse + d = dict(src_dict) id = d.pop("id") @@ -121,6 +172,64 @@ def _parse_result(data: object) -> Union[None, Unset, str]: result = _parse_result(d.pop("result", UNSET)) + def _parse_source_type(data: object) -> Union[ApiAgentRunSourceType, None, Unset]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + source_type_type_0 = ApiAgentRunSourceType(data) + + return source_type_type_0 + except: # noqa: E722 + pass + return cast(Union[ApiAgentRunSourceType, None, Unset], data) + + source_type = _parse_source_type(d.pop("source_type", UNSET)) + + def _parse_github_pull_requests(data: object) -> Union[None, Unset, list["GithubPullRequestResponse"]]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + github_pull_requests_type_0 = [] + _github_pull_requests_type_0 = data + for github_pull_requests_type_0_item_data in _github_pull_requests_type_0: + github_pull_requests_type_0_item = GithubPullRequestResponse.from_dict( + github_pull_requests_type_0_item_data + ) + + github_pull_requests_type_0.append(github_pull_requests_type_0_item) + + return github_pull_requests_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, list["GithubPullRequestResponse"]], data) + + github_pull_requests = _parse_github_pull_requests(d.pop("github_pull_requests", UNSET)) + + def _parse_metadata(data: object) -> Union["AgentRunResponseMetadataType0", None, Unset]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + metadata_type_0 = AgentRunResponseMetadataType0.from_dict(data) + + return metadata_type_0 + except: # noqa: E722 + pass + return cast(Union["AgentRunResponseMetadataType0", None, Unset], data) + + metadata = _parse_metadata(d.pop("metadata", UNSET)) + agent_run_response = cls( id=id, organization_id=organization_id, @@ -128,6 +237,9 @@ def _parse_result(data: object) -> Union[None, Unset, str]: created_at=created_at, web_url=web_url, result=result, + source_type=source_type, + github_pull_requests=github_pull_requests, + metadata=metadata, ) agent_run_response.additional_properties = d diff --git a/gen/developer-api-client/developer_api_client/models/agent_run_response_metadata_type_0.py b/gen/developer-api-client/developer_api_client/models/agent_run_response_metadata_type_0.py new file mode 100644 index 0000000..1213187 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/agent_run_response_metadata_type_0.py @@ -0,0 +1,44 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="AgentRunResponseMetadataType0") + + +@_attrs_define +class AgentRunResponseMetadataType0: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + agent_run_response_metadata_type_0 = cls() + + agent_run_response_metadata_type_0.additional_properties = d + return agent_run_response_metadata_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/agent_run_with_logs_response.py b/gen/developer-api-client/developer_api_client/models/agent_run_with_logs_response.py new file mode 100644 index 0000000..abbbe13 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/agent_run_with_logs_response.py @@ -0,0 +1,286 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.agent_run_log_response import AgentRunLogResponse + from ..models.agent_run_with_logs_response_metadata_type_0 import AgentRunWithLogsResponseMetadataType0 + + +T = TypeVar("T", bound="AgentRunWithLogsResponse") + + +@_attrs_define +class AgentRunWithLogsResponse: + """Represents an agent run in API responses + + Attributes: + id (int): + organization_id (int): + logs (list['AgentRunLogResponse']): + status (Union[None, Unset, str]): + created_at (Union[None, Unset, str]): + web_url (Union[None, Unset, str]): + result (Union[None, Unset, str]): + metadata (Union['AgentRunWithLogsResponseMetadataType0', None, Unset]): + total_logs (Union[None, Unset, int]): + page (Union[None, Unset, int]): + size (Union[None, Unset, int]): + pages (Union[None, Unset, int]): + """ + + id: int + organization_id: int + logs: list["AgentRunLogResponse"] + status: Union[None, Unset, str] = UNSET + created_at: Union[None, Unset, str] = UNSET + web_url: Union[None, Unset, str] = UNSET + result: Union[None, Unset, str] = UNSET + metadata: Union["AgentRunWithLogsResponseMetadataType0", None, Unset] = UNSET + total_logs: Union[None, Unset, int] = UNSET + page: Union[None, Unset, int] = UNSET + size: Union[None, Unset, int] = UNSET + pages: Union[None, Unset, int] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.agent_run_with_logs_response_metadata_type_0 import AgentRunWithLogsResponseMetadataType0 + + id = self.id + + organization_id = self.organization_id + + logs = [] + for logs_item_data in self.logs: + logs_item = logs_item_data.to_dict() + logs.append(logs_item) + + status: Union[None, Unset, str] + if isinstance(self.status, Unset): + status = UNSET + else: + status = self.status + + created_at: Union[None, Unset, str] + if isinstance(self.created_at, Unset): + created_at = UNSET + else: + created_at = self.created_at + + web_url: Union[None, Unset, str] + if isinstance(self.web_url, Unset): + web_url = UNSET + else: + web_url = self.web_url + + result: Union[None, Unset, str] + if isinstance(self.result, Unset): + result = UNSET + else: + result = self.result + + metadata: Union[None, Unset, dict[str, Any]] + if isinstance(self.metadata, Unset): + metadata = UNSET + elif isinstance(self.metadata, AgentRunWithLogsResponseMetadataType0): + metadata = self.metadata.to_dict() + else: + metadata = self.metadata + + total_logs: Union[None, Unset, int] + if isinstance(self.total_logs, Unset): + total_logs = UNSET + else: + total_logs = self.total_logs + + page: Union[None, Unset, int] + if isinstance(self.page, Unset): + page = UNSET + else: + page = self.page + + size: Union[None, Unset, int] + if isinstance(self.size, Unset): + size = UNSET + else: + size = self.size + + pages: Union[None, Unset, int] + if isinstance(self.pages, Unset): + pages = UNSET + else: + pages = self.pages + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "organization_id": organization_id, + "logs": logs, + } + ) + if status is not UNSET: + field_dict["status"] = status + if created_at is not UNSET: + field_dict["created_at"] = created_at + if web_url is not UNSET: + field_dict["web_url"] = web_url + if result is not UNSET: + field_dict["result"] = result + if metadata is not UNSET: + field_dict["metadata"] = metadata + if total_logs is not UNSET: + field_dict["total_logs"] = total_logs + if page is not UNSET: + field_dict["page"] = page + if size is not UNSET: + field_dict["size"] = size + if pages is not UNSET: + field_dict["pages"] = pages + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.agent_run_log_response import AgentRunLogResponse + from ..models.agent_run_with_logs_response_metadata_type_0 import AgentRunWithLogsResponseMetadataType0 + + d = dict(src_dict) + id = d.pop("id") + + organization_id = d.pop("organization_id") + + logs = [] + _logs = d.pop("logs") + for logs_item_data in _logs: + logs_item = AgentRunLogResponse.from_dict(logs_item_data) + + logs.append(logs_item) + + def _parse_status(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + status = _parse_status(d.pop("status", UNSET)) + + def _parse_created_at(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + created_at = _parse_created_at(d.pop("created_at", UNSET)) + + def _parse_web_url(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + web_url = _parse_web_url(d.pop("web_url", UNSET)) + + def _parse_result(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + result = _parse_result(d.pop("result", UNSET)) + + def _parse_metadata(data: object) -> Union["AgentRunWithLogsResponseMetadataType0", None, Unset]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + metadata_type_0 = AgentRunWithLogsResponseMetadataType0.from_dict(data) + + return metadata_type_0 + except: # noqa: E722 + pass + return cast(Union["AgentRunWithLogsResponseMetadataType0", None, Unset], data) + + metadata = _parse_metadata(d.pop("metadata", UNSET)) + + def _parse_total_logs(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + total_logs = _parse_total_logs(d.pop("total_logs", UNSET)) + + def _parse_page(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + page = _parse_page(d.pop("page", UNSET)) + + def _parse_size(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + size = _parse_size(d.pop("size", UNSET)) + + def _parse_pages(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + pages = _parse_pages(d.pop("pages", UNSET)) + + agent_run_with_logs_response = cls( + id=id, + organization_id=organization_id, + logs=logs, + status=status, + created_at=created_at, + web_url=web_url, + result=result, + metadata=metadata, + total_logs=total_logs, + page=page, + size=size, + pages=pages, + ) + + agent_run_with_logs_response.additional_properties = d + return agent_run_with_logs_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/agent_run_with_logs_response_metadata_type_0.py b/gen/developer-api-client/developer_api_client/models/agent_run_with_logs_response_metadata_type_0.py new file mode 100644 index 0000000..3b25062 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/agent_run_with_logs_response_metadata_type_0.py @@ -0,0 +1,44 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="AgentRunWithLogsResponseMetadataType0") + + +@_attrs_define +class AgentRunWithLogsResponseMetadataType0: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + agent_run_with_logs_response_metadata_type_0 = cls() + + agent_run_with_logs_response_metadata_type_0.additional_properties = d + return agent_run_with_logs_response_metadata_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/api_agent_run_source_type.py b/gen/developer-api-client/developer_api_client/models/api_agent_run_source_type.py new file mode 100644 index 0000000..3c7a383 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/api_agent_run_source_type.py @@ -0,0 +1,15 @@ +from enum import Enum + + +class ApiAgentRunSourceType(str, Enum): + API = "API" + CHAT = "CHAT" + GITHUB = "GITHUB" + GITHUB_CHECK_SUITE = "GITHUB_CHECK_SUITE" + JIRA = "JIRA" + LINEAR = "LINEAR" + LOCAL = "LOCAL" + SLACK = "SLACK" + + def __str__(self) -> str: + return str(self.value) diff --git a/gen/developer-api-client/developer_api_client/models/fast_api_rate_limit_response.py b/gen/developer-api-client/developer_api_client/models/api_rate_limit_error_response.py similarity index 71% rename from gen/developer-api-client/developer_api_client/models/fast_api_rate_limit_response.py rename to gen/developer-api-client/developer_api_client/models/api_rate_limit_error_response.py index ff217a2..0f61af1 100644 --- a/gen/developer-api-client/developer_api_client/models/fast_api_rate_limit_response.py +++ b/gen/developer-api-client/developer_api_client/models/api_rate_limit_error_response.py @@ -6,31 +6,31 @@ from ..types import UNSET, Unset -T = TypeVar("T", bound="FastAPIRateLimitResponse") +T = TypeVar("T", bound="APIRateLimitErrorResponse") @_attrs_define -class FastAPIRateLimitResponse: +class APIRateLimitErrorResponse: """ Attributes: - detail (Union[Unset, str]): Default: 'Rate limit exceeded'. + message (Union[Unset, str]): Default: 'Rate limit exceeded. Please try again later.'. status_code (Union[Unset, int]): Default: 429. """ - detail: Union[Unset, str] = "Rate limit exceeded" + message: Union[Unset, str] = "Rate limit exceeded. Please try again later." status_code: Union[Unset, int] = 429 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - detail = self.detail + message = self.message status_code = self.status_code field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) - if detail is not UNSET: - field_dict["detail"] = detail + if message is not UNSET: + field_dict["message"] = message if status_code is not UNSET: field_dict["status_code"] = status_code @@ -39,17 +39,17 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - detail = d.pop("detail", UNSET) + message = d.pop("message", UNSET) status_code = d.pop("status_code", UNSET) - fast_api_rate_limit_response = cls( - detail=detail, + api_rate_limit_error_response = cls( + message=message, status_code=status_code, ) - fast_api_rate_limit_response.additional_properties = d - return fast_api_rate_limit_response + api_rate_limit_error_response.additional_properties = d + return api_rate_limit_error_response @property def additional_keys(self) -> list[str]: diff --git a/gen/developer-api-client/developer_api_client/models/check_suite_retry_stats_response.py b/gen/developer-api-client/developer_api_client/models/check_suite_retry_stats_response.py new file mode 100644 index 0000000..c3d6d4e --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/check_suite_retry_stats_response.py @@ -0,0 +1,112 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CheckSuiteRetryStatsResponse") + + +@_attrs_define +class CheckSuiteRetryStatsResponse: + """Response model for check suite retry statistics. + + Example: + {'active_orchestrations': 2, 'checks_at_retry_limit': 8, 'completed_orchestrations': 40, + 'failed_orchestrations': 3, 'repo_id': 123, 'total_orchestrations': 45, 'total_retry_attempts': 67} + + Attributes: + repo_id (int): Repository ID + total_orchestrations (int): Total number of orchestrations + active_orchestrations (int): Number of active orchestrations + completed_orchestrations (int): Number of completed orchestrations + failed_orchestrations (int): Number of failed orchestrations + total_retry_attempts (int): Total number of retry attempts across all checks + checks_at_retry_limit (int): Number of checks that have reached their retry limit + """ + + repo_id: int + total_orchestrations: int + active_orchestrations: int + completed_orchestrations: int + failed_orchestrations: int + total_retry_attempts: int + checks_at_retry_limit: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + repo_id = self.repo_id + + total_orchestrations = self.total_orchestrations + + active_orchestrations = self.active_orchestrations + + completed_orchestrations = self.completed_orchestrations + + failed_orchestrations = self.failed_orchestrations + + total_retry_attempts = self.total_retry_attempts + + checks_at_retry_limit = self.checks_at_retry_limit + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "repo_id": repo_id, + "total_orchestrations": total_orchestrations, + "active_orchestrations": active_orchestrations, + "completed_orchestrations": completed_orchestrations, + "failed_orchestrations": failed_orchestrations, + "total_retry_attempts": total_retry_attempts, + "checks_at_retry_limit": checks_at_retry_limit, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + repo_id = d.pop("repo_id") + + total_orchestrations = d.pop("total_orchestrations") + + active_orchestrations = d.pop("active_orchestrations") + + completed_orchestrations = d.pop("completed_orchestrations") + + failed_orchestrations = d.pop("failed_orchestrations") + + total_retry_attempts = d.pop("total_retry_attempts") + + checks_at_retry_limit = d.pop("checks_at_retry_limit") + + check_suite_retry_stats_response = cls( + repo_id=repo_id, + total_orchestrations=total_orchestrations, + active_orchestrations=active_orchestrations, + completed_orchestrations=completed_orchestrations, + failed_orchestrations=failed_orchestrations, + total_retry_attempts=total_retry_attempts, + checks_at_retry_limit=checks_at_retry_limit, + ) + + check_suite_retry_stats_response.additional_properties = d + return check_suite_retry_stats_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/check_suite_settings_response.py b/gen/developer-api-client/developer_api_client/models/check_suite_settings_response.py new file mode 100644 index 0000000..8374b20 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/check_suite_settings_response.py @@ -0,0 +1,71 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CheckSuiteSettingsResponse") + + +@_attrs_define +class CheckSuiteSettingsResponse: + """Response model for check suite settings. + + Example: + {'ignored_checks': ['dependency-review', 'security-scan'], 'retry_count': 3} + + Attributes: + retry_count (int): Number of retry attempts for failed checks + ignored_checks (list[str]): List of check names to ignore + """ + + retry_count: int + ignored_checks: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + retry_count = self.retry_count + + ignored_checks = self.ignored_checks + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "retry_count": retry_count, + "ignored_checks": ignored_checks, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + retry_count = d.pop("retry_count") + + ignored_checks = cast(list[str], d.pop("ignored_checks")) + + check_suite_settings_response = cls( + retry_count=retry_count, + ignored_checks=ignored_checks, + ) + + check_suite_settings_response.additional_properties = d + return check_suite_settings_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/create_agent_run_input.py b/gen/developer-api-client/developer_api_client/models/create_agent_run_input.py index 9f26386..50b5c2d 100644 --- a/gen/developer-api-client/developer_api_client/models/create_agent_run_input.py +++ b/gen/developer-api-client/developer_api_client/models/create_agent_run_input.py @@ -1,9 +1,15 @@ from collections.abc import Mapping -from typing import Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.create_agent_run_input_metadata_type_0 import CreateAgentRunInputMetadataType0 + + T = TypeVar("T", bound="CreateAgentRunInput") @@ -12,14 +18,55 @@ class CreateAgentRunInput: """ Attributes: prompt (str): + images (Union[None, Unset, list[str]]): List of base64 encoded data URIs representing images to be processed by + the agent + metadata (Union['CreateAgentRunInputMetadataType0', None, Unset]): Arbitrary JSON metadata to be stored with the + agent run + repo_id (Union[None, Unset, int]): ID of the repository to use for the agent run + model (Union[None, Unset, str]): Model to use for this agent run (optional, uses org default if not specified) """ prompt: str + images: Union[None, Unset, list[str]] = UNSET + metadata: Union["CreateAgentRunInputMetadataType0", None, Unset] = UNSET + repo_id: Union[None, Unset, int] = UNSET + model: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + from ..models.create_agent_run_input_metadata_type_0 import CreateAgentRunInputMetadataType0 + prompt = self.prompt + images: Union[None, Unset, list[str]] + if isinstance(self.images, Unset): + images = UNSET + elif isinstance(self.images, list): + images = self.images + + else: + images = self.images + + metadata: Union[None, Unset, dict[str, Any]] + if isinstance(self.metadata, Unset): + metadata = UNSET + elif isinstance(self.metadata, CreateAgentRunInputMetadataType0): + metadata = self.metadata.to_dict() + else: + metadata = self.metadata + + repo_id: Union[None, Unset, int] + if isinstance(self.repo_id, Unset): + repo_id = UNSET + else: + repo_id = self.repo_id + + model: Union[None, Unset, str] + if isinstance(self.model, Unset): + model = UNSET + else: + model = self.model + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -27,16 +74,82 @@ def to_dict(self) -> dict[str, Any]: "prompt": prompt, } ) + if images is not UNSET: + field_dict["images"] = images + if metadata is not UNSET: + field_dict["metadata"] = metadata + if repo_id is not UNSET: + field_dict["repo_id"] = repo_id + if model is not UNSET: + field_dict["model"] = model return field_dict @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.create_agent_run_input_metadata_type_0 import CreateAgentRunInputMetadataType0 + d = dict(src_dict) prompt = d.pop("prompt") + def _parse_images(data: object) -> Union[None, Unset, list[str]]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + images_type_0 = cast(list[str], data) + + return images_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, list[str]], data) + + images = _parse_images(d.pop("images", UNSET)) + + def _parse_metadata(data: object) -> Union["CreateAgentRunInputMetadataType0", None, Unset]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + metadata_type_0 = CreateAgentRunInputMetadataType0.from_dict(data) + + return metadata_type_0 + except: # noqa: E722 + pass + return cast(Union["CreateAgentRunInputMetadataType0", None, Unset], data) + + metadata = _parse_metadata(d.pop("metadata", UNSET)) + + def _parse_repo_id(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + repo_id = _parse_repo_id(d.pop("repo_id", UNSET)) + + def _parse_model(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + model = _parse_model(d.pop("model", UNSET)) + create_agent_run_input = cls( prompt=prompt, + images=images, + metadata=metadata, + repo_id=repo_id, + model=model, ) create_agent_run_input.additional_properties = d diff --git a/gen/developer-api-client/developer_api_client/models/create_agent_run_input_metadata_type_0.py b/gen/developer-api-client/developer_api_client/models/create_agent_run_input_metadata_type_0.py new file mode 100644 index 0000000..9a7f4a3 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/create_agent_run_input_metadata_type_0.py @@ -0,0 +1,44 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CreateAgentRunInputMetadataType0") + + +@_attrs_define +class CreateAgentRunInputMetadataType0: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + create_agent_run_input_metadata_type_0 = cls() + + create_agent_run_input_metadata_type_0.additional_properties = d + return create_agent_run_input_metadata_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/github_pull_request_response.py b/gen/developer-api-client/developer_api_client/models/github_pull_request_response.py new file mode 100644 index 0000000..d5ced38 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/github_pull_request_response.py @@ -0,0 +1,83 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="GithubPullRequestResponse") + + +@_attrs_define +class GithubPullRequestResponse: + """ + Attributes: + id (int): + title (str): + url (str): + created_at (str): + """ + + id: int + title: str + url: str + created_at: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + title = self.title + + url = self.url + + created_at = self.created_at + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "title": title, + "url": url, + "created_at": created_at, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + title = d.pop("title") + + url = d.pop("url") + + created_at = d.pop("created_at") + + github_pull_request_response = cls( + id=id, + title=title, + url=url, + created_at=created_at, + ) + + github_pull_request_response.additional_properties = d + return github_pull_request_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/integration_status.py b/gen/developer-api-client/developer_api_client/models/integration_status.py new file mode 100644 index 0000000..383d22c --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/integration_status.py @@ -0,0 +1,148 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.integration_status_metadata_type_0 import IntegrationStatusMetadataType0 + + +T = TypeVar("T", bound="IntegrationStatus") + + +@_attrs_define +class IntegrationStatus: + """Status information for a single integration. + + Attributes: + integration_type (str): Type of integration (e.g., 'github', 'slack', 'linear', etc.) + active (bool): Whether the integration is currently active + token_id (Union[None, Unset, int]): ID of the associated token, if any + installation_id (Union[None, Unset, int]): ID of the app installation, if applicable + metadata (Union['IntegrationStatusMetadataType0', None, Unset]): Additional metadata about the integration + """ + + integration_type: str + active: bool + token_id: Union[None, Unset, int] = UNSET + installation_id: Union[None, Unset, int] = UNSET + metadata: Union["IntegrationStatusMetadataType0", None, Unset] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.integration_status_metadata_type_0 import IntegrationStatusMetadataType0 + + integration_type = self.integration_type + + active = self.active + + token_id: Union[None, Unset, int] + if isinstance(self.token_id, Unset): + token_id = UNSET + else: + token_id = self.token_id + + installation_id: Union[None, Unset, int] + if isinstance(self.installation_id, Unset): + installation_id = UNSET + else: + installation_id = self.installation_id + + metadata: Union[None, Unset, dict[str, Any]] + if isinstance(self.metadata, Unset): + metadata = UNSET + elif isinstance(self.metadata, IntegrationStatusMetadataType0): + metadata = self.metadata.to_dict() + else: + metadata = self.metadata + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "integration_type": integration_type, + "active": active, + } + ) + if token_id is not UNSET: + field_dict["token_id"] = token_id + if installation_id is not UNSET: + field_dict["installation_id"] = installation_id + if metadata is not UNSET: + field_dict["metadata"] = metadata + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.integration_status_metadata_type_0 import IntegrationStatusMetadataType0 + + d = dict(src_dict) + integration_type = d.pop("integration_type") + + active = d.pop("active") + + def _parse_token_id(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + token_id = _parse_token_id(d.pop("token_id", UNSET)) + + def _parse_installation_id(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + installation_id = _parse_installation_id(d.pop("installation_id", UNSET)) + + def _parse_metadata(data: object) -> Union["IntegrationStatusMetadataType0", None, Unset]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + metadata_type_0 = IntegrationStatusMetadataType0.from_dict(data) + + return metadata_type_0 + except: # noqa: E722 + pass + return cast(Union["IntegrationStatusMetadataType0", None, Unset], data) + + metadata = _parse_metadata(d.pop("metadata", UNSET)) + + integration_status = cls( + integration_type=integration_type, + active=active, + token_id=token_id, + installation_id=installation_id, + metadata=metadata, + ) + + integration_status.additional_properties = d + return integration_status + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/integration_status_metadata_type_0.py b/gen/developer-api-client/developer_api_client/models/integration_status_metadata_type_0.py new file mode 100644 index 0000000..8c58a89 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/integration_status_metadata_type_0.py @@ -0,0 +1,44 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="IntegrationStatusMetadataType0") + + +@_attrs_define +class IntegrationStatusMetadataType0: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + integration_status_metadata_type_0 = cls() + + integration_status_metadata_type_0.additional_properties = d + return integration_status_metadata_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/no_repos_found_in_org_error_response.py b/gen/developer-api-client/developer_api_client/models/no_repos_found_in_org_error_response.py new file mode 100644 index 0000000..5901374 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/no_repos_found_in_org_error_response.py @@ -0,0 +1,69 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="NoReposFoundInOrgErrorResponse") + + +@_attrs_define +class NoReposFoundInOrgErrorResponse: + """ + Attributes: + message (Union[Unset, str]): Default: 'No repos found in the organization. Please add some repos and try + again.'. + status_code (Union[Unset, int]): Default: 404. + """ + + message: Union[Unset, str] = "No repos found in the organization. Please add some repos and try again." + status_code: Union[Unset, int] = 404 + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status_code = self.status_code + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status_code is not UNSET: + field_dict["status_code"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + message = d.pop("message", UNSET) + + status_code = d.pop("status_code", UNSET) + + no_repos_found_in_org_error_response = cls( + message=message, + status_code=status_code, + ) + + no_repos_found_in_org_error_response.additional_properties = d + return no_repos_found_in_org_error_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/organization_integrations_response.py b/gen/developer-api-client/developer_api_client/models/organization_integrations_response.py new file mode 100644 index 0000000..22b8f69 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/organization_integrations_response.py @@ -0,0 +1,98 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.integration_status import IntegrationStatus + + +T = TypeVar("T", bound="OrganizationIntegrationsResponse") + + +@_attrs_define +class OrganizationIntegrationsResponse: + """Response schema for organization integrations. + + Attributes: + organization_id (int): ID of the organization + organization_name (str): Name of the organization + integrations (list['IntegrationStatus']): List of integration statuses + total_active_integrations (int): Total number of active integrations + """ + + organization_id: int + organization_name: str + integrations: list["IntegrationStatus"] + total_active_integrations: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + organization_id = self.organization_id + + organization_name = self.organization_name + + integrations = [] + for integrations_item_data in self.integrations: + integrations_item = integrations_item_data.to_dict() + integrations.append(integrations_item) + + total_active_integrations = self.total_active_integrations + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "organization_id": organization_id, + "organization_name": organization_name, + "integrations": integrations, + "total_active_integrations": total_active_integrations, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.integration_status import IntegrationStatus + + d = dict(src_dict) + organization_id = d.pop("organization_id") + + organization_name = d.pop("organization_name") + + integrations = [] + _integrations = d.pop("integrations") + for integrations_item_data in _integrations: + integrations_item = IntegrationStatus.from_dict(integrations_item_data) + + integrations.append(integrations_item) + + total_active_integrations = d.pop("total_active_integrations") + + organization_integrations_response = cls( + organization_id=organization_id, + organization_name=organization_name, + integrations=integrations, + total_active_integrations=total_active_integrations, + ) + + organization_integrations_response.additional_properties = d + return organization_integrations_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/page_agent_run_response.py b/gen/developer-api-client/developer_api_client/models/page_agent_run_response.py new file mode 100644 index 0000000..a57dc4a --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/page_agent_run_response.py @@ -0,0 +1,105 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.agent_run_response import AgentRunResponse + + +T = TypeVar("T", bound="PageAgentRunResponse") + + +@_attrs_define +class PageAgentRunResponse: + """ + Attributes: + items (list['AgentRunResponse']): + total (int): + page (int): + size (int): + pages (int): + """ + + items: list["AgentRunResponse"] + total: int + page: int + size: int + pages: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + items = [] + for items_item_data in self.items: + items_item = items_item_data.to_dict() + items.append(items_item) + + total = self.total + + page = self.page + + size = self.size + + pages = self.pages + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "items": items, + "total": total, + "page": page, + "size": size, + "pages": pages, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.agent_run_response import AgentRunResponse + + d = dict(src_dict) + items = [] + _items = d.pop("items") + for items_item_data in _items: + items_item = AgentRunResponse.from_dict(items_item_data) + + items.append(items_item) + + total = d.pop("total") + + page = d.pop("page") + + size = d.pop("size") + + pages = d.pop("pages") + + page_agent_run_response = cls( + items=items, + total=total, + page=page, + size=size, + pages=pages, + ) + + page_agent_run_response.additional_properties = d + return page_agent_run_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/page_repo_response.py b/gen/developer-api-client/developer_api_client/models/page_repo_response.py new file mode 100644 index 0000000..bdec71b --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/page_repo_response.py @@ -0,0 +1,105 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.repo_response import RepoResponse + + +T = TypeVar("T", bound="PageRepoResponse") + + +@_attrs_define +class PageRepoResponse: + """ + Attributes: + items (list['RepoResponse']): + total (int): + page (int): + size (int): + pages (int): + """ + + items: list["RepoResponse"] + total: int + page: int + size: int + pages: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + items = [] + for items_item_data in self.items: + items_item = items_item_data.to_dict() + items.append(items_item) + + total = self.total + + page = self.page + + size = self.size + + pages = self.pages + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "items": items, + "total": total, + "page": page, + "size": size, + "pages": pages, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.repo_response import RepoResponse + + d = dict(src_dict) + items = [] + _items = d.pop("items") + for items_item_data in _items: + items_item = RepoResponse.from_dict(items_item_data) + + items.append(items_item) + + total = d.pop("total") + + page = d.pop("page") + + size = d.pop("size") + + pages = d.pop("pages") + + page_repo_response = cls( + items=items, + total=total, + page=page, + size=size, + pages=pages, + ) + + page_repo_response.additional_properties = d + return page_repo_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/permissions_error_response.py b/gen/developer-api-client/developer_api_client/models/permissions_error_response.py new file mode 100644 index 0000000..9bac262 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/permissions_error_response.py @@ -0,0 +1,68 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PermissionsErrorResponse") + + +@_attrs_define +class PermissionsErrorResponse: + """ + Attributes: + message (Union[Unset, str]): Default: 'You do not have access to this organization.'. + status_code (Union[Unset, int]): Default: 403. + """ + + message: Union[Unset, str] = "You do not have access to this organization." + status_code: Union[Unset, int] = 403 + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status_code = self.status_code + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status_code is not UNSET: + field_dict["status_code"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + message = d.pop("message", UNSET) + + status_code = d.pop("status_code", UNSET) + + permissions_error_response = cls( + message=message, + status_code=status_code, + ) + + permissions_error_response.additional_properties = d + return permissions_error_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/repo_response.py b/gen/developer-api-client/developer_api_client/models/repo_response.py new file mode 100644 index 0000000..4e3358a --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/repo_response.py @@ -0,0 +1,156 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="RepoResponse") + + +@_attrs_define +class RepoResponse: + """Represents a repository in API responses + + Attributes: + id (int): + name (str): + full_name (str): + description (Union[None, str]): + github_id (str): + organization_id (int): + visibility (Union[None, str]): + archived (Union[None, bool]): + setup_status (str): + language (Union[None, str]): + """ + + id: int + name: str + full_name: str + description: Union[None, str] + github_id: str + organization_id: int + visibility: Union[None, str] + archived: Union[None, bool] + setup_status: str + language: Union[None, str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + full_name = self.full_name + + description: Union[None, str] + description = self.description + + github_id = self.github_id + + organization_id = self.organization_id + + visibility: Union[None, str] + visibility = self.visibility + + archived: Union[None, bool] + archived = self.archived + + setup_status = self.setup_status + + language: Union[None, str] + language = self.language + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "name": name, + "full_name": full_name, + "description": description, + "github_id": github_id, + "organization_id": organization_id, + "visibility": visibility, + "archived": archived, + "setup_status": setup_status, + "language": language, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + name = d.pop("name") + + full_name = d.pop("full_name") + + def _parse_description(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + description = _parse_description(d.pop("description")) + + github_id = d.pop("github_id") + + organization_id = d.pop("organization_id") + + def _parse_visibility(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + visibility = _parse_visibility(d.pop("visibility")) + + def _parse_archived(data: object) -> Union[None, bool]: + if data is None: + return data + return cast(Union[None, bool], data) + + archived = _parse_archived(d.pop("archived")) + + setup_status = d.pop("setup_status") + + def _parse_language(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + language = _parse_language(d.pop("language")) + + repo_response = cls( + id=id, + name=name, + full_name=full_name, + description=description, + github_id=github_id, + organization_id=organization_id, + visibility=visibility, + archived=archived, + setup_status=setup_status, + language=language, + ) + + repo_response.additional_properties = d + return repo_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/resume_agent_run_input.py b/gen/developer-api-client/developer_api_client/models/resume_agent_run_input.py new file mode 100644 index 0000000..985ebcd --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/resume_agent_run_input.py @@ -0,0 +1,101 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ResumeAgentRunInput") + + +@_attrs_define +class ResumeAgentRunInput: + """ + Attributes: + agent_run_id (int): + prompt (str): + images (Union[None, Unset, list[str]]): List of base64 encoded data URIs representing images to be processed by + the agent + """ + + agent_run_id: int + prompt: str + images: Union[None, Unset, list[str]] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + agent_run_id = self.agent_run_id + + prompt = self.prompt + + images: Union[None, Unset, list[str]] + if isinstance(self.images, Unset): + images = UNSET + elif isinstance(self.images, list): + images = self.images + + else: + images = self.images + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "agent_run_id": agent_run_id, + "prompt": prompt, + } + ) + if images is not UNSET: + field_dict["images"] = images + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + agent_run_id = d.pop("agent_run_id") + + prompt = d.pop("prompt") + + def _parse_images(data: object) -> Union[None, Unset, list[str]]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + images_type_0 = cast(list[str], data) + + return images_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, list[str]], data) + + images = _parse_images(d.pop("images", UNSET)) + + resume_agent_run_input = cls( + agent_run_id=agent_run_id, + prompt=prompt, + images=images, + ) + + resume_agent_run_input.additional_properties = d + return resume_agent_run_input + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/stop_agent_run_input.py b/gen/developer-api-client/developer_api_client/models/stop_agent_run_input.py new file mode 100644 index 0000000..6a28899 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/stop_agent_run_input.py @@ -0,0 +1,59 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="StopAgentRunInput") + + +@_attrs_define +class StopAgentRunInput: + """ + Attributes: + agent_run_id (int): + """ + + agent_run_id: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + agent_run_id = self.agent_run_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "agent_run_id": agent_run_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + agent_run_id = d.pop("agent_run_id") + + stop_agent_run_input = cls( + agent_run_id=agent_run_id, + ) + + stop_agent_run_input.additional_properties = d + return stop_agent_run_input + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/tool_execution_request.py b/gen/developer-api-client/developer_api_client/models/tool_execution_request.py new file mode 100644 index 0000000..8cac43a --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/tool_execution_request.py @@ -0,0 +1,96 @@ +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.tool_execution_request_arguments import ToolExecutionRequestArguments + + +T = TypeVar("T", bound="ToolExecutionRequest") + + +@_attrs_define +class ToolExecutionRequest: + """Request schema for tool execution. + + Attributes: + tool_name (str): Name of the tool to execute + arguments (ToolExecutionRequestArguments): JSON arguments to pass to the tool + repo_id (Union[None, Unset, int]): Optional repository ID for repository-specific tool context + """ + + tool_name: str + arguments: "ToolExecutionRequestArguments" + repo_id: Union[None, Unset, int] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + tool_name = self.tool_name + + arguments = self.arguments.to_dict() + + repo_id: Union[None, Unset, int] + if isinstance(self.repo_id, Unset): + repo_id = UNSET + else: + repo_id = self.repo_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "tool_name": tool_name, + "arguments": arguments, + } + ) + if repo_id is not UNSET: + field_dict["repo_id"] = repo_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.tool_execution_request_arguments import ToolExecutionRequestArguments + + d = dict(src_dict) + tool_name = d.pop("tool_name") + + arguments = ToolExecutionRequestArguments.from_dict(d.pop("arguments")) + + def _parse_repo_id(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + repo_id = _parse_repo_id(d.pop("repo_id", UNSET)) + + tool_execution_request = cls( + tool_name=tool_name, + arguments=arguments, + repo_id=repo_id, + ) + + tool_execution_request.additional_properties = d + return tool_execution_request + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/tool_execution_request_arguments.py b/gen/developer-api-client/developer_api_client/models/tool_execution_request_arguments.py new file mode 100644 index 0000000..929453a --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/tool_execution_request_arguments.py @@ -0,0 +1,44 @@ +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ToolExecutionRequestArguments") + + +@_attrs_define +class ToolExecutionRequestArguments: + """JSON arguments to pass to the tool""" + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + tool_execution_request_arguments = cls() + + tool_execution_request_arguments.additional_properties = d + return tool_execution_request_arguments + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/tool_execution_response.py b/gen/developer-api-client/developer_api_client/models/tool_execution_response.py new file mode 100644 index 0000000..a79bd88 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/tool_execution_response.py @@ -0,0 +1,119 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ToolExecutionResponse") + + +@_attrs_define +class ToolExecutionResponse: + """Response schema for tool execution. + + Attributes: + success (bool): Whether the tool execution was successful + tool_name (str): Name of the executed tool + result (Union[Unset, Any]): The result returned by the tool + error (Union[None, Unset, str]): Error message if execution failed + execution_time_ms (Union[None, Unset, float]): Tool execution time in milliseconds + """ + + success: bool + tool_name: str + result: Union[Unset, Any] = UNSET + error: Union[None, Unset, str] = UNSET + execution_time_ms: Union[None, Unset, float] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + success = self.success + + tool_name = self.tool_name + + result = self.result + + error: Union[None, Unset, str] + if isinstance(self.error, Unset): + error = UNSET + else: + error = self.error + + execution_time_ms: Union[None, Unset, float] + if isinstance(self.execution_time_ms, Unset): + execution_time_ms = UNSET + else: + execution_time_ms = self.execution_time_ms + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "success": success, + "tool_name": tool_name, + } + ) + if result is not UNSET: + field_dict["result"] = result + if error is not UNSET: + field_dict["error"] = error + if execution_time_ms is not UNSET: + field_dict["execution_time_ms"] = execution_time_ms + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + success = d.pop("success") + + tool_name = d.pop("tool_name") + + result = d.pop("result", UNSET) + + def _parse_error(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + error = _parse_error(d.pop("error", UNSET)) + + def _parse_execution_time_ms(data: object) -> Union[None, Unset, float]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, float], data) + + execution_time_ms = _parse_execution_time_ms(d.pop("execution_time_ms", UNSET)) + + tool_execution_response = cls( + success=success, + tool_name=tool_name, + result=result, + error=error, + execution_time_ms=execution_time_ms, + ) + + tool_execution_response.additional_properties = d + return tool_execution_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/update_check_suite_settings_request.py b/gen/developer-api-client/developer_api_client/models/update_check_suite_settings_request.py new file mode 100644 index 0000000..a3a7e98 --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/update_check_suite_settings_request.py @@ -0,0 +1,106 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateCheckSuiteSettingsRequest") + + +@_attrs_define +class UpdateCheckSuiteSettingsRequest: + """Request model for updating check suite settings. + + Example: + {'ignored_checks': ['dependency-review', 'security-scan'], 'retry_count': 3} + + Attributes: + retry_count (Union[None, Unset, int]): Number of retry attempts for failed checks + ignored_checks (Union[None, Unset, list[str]]): List of check names to ignore + """ + + retry_count: Union[None, Unset, int] = UNSET + ignored_checks: Union[None, Unset, list[str]] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + retry_count: Union[None, Unset, int] + if isinstance(self.retry_count, Unset): + retry_count = UNSET + else: + retry_count = self.retry_count + + ignored_checks: Union[None, Unset, list[str]] + if isinstance(self.ignored_checks, Unset): + ignored_checks = UNSET + elif isinstance(self.ignored_checks, list): + ignored_checks = self.ignored_checks + + else: + ignored_checks = self.ignored_checks + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if retry_count is not UNSET: + field_dict["retry_count"] = retry_count + if ignored_checks is not UNSET: + field_dict["ignored_checks"] = ignored_checks + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + + def _parse_retry_count(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + retry_count = _parse_retry_count(d.pop("retry_count", UNSET)) + + def _parse_ignored_checks(data: object) -> Union[None, Unset, list[str]]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + ignored_checks_type_0 = cast(list[str], data) + + return ignored_checks_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, list[str]], data) + + ignored_checks = _parse_ignored_checks(d.pop("ignored_checks", UNSET)) + + update_check_suite_settings_request = cls( + retry_count=retry_count, + ignored_checks=ignored_checks, + ) + + update_check_suite_settings_request.additional_properties = d + return update_check_suite_settings_request + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/user_not_found_error_response.py b/gen/developer-api-client/developer_api_client/models/user_not_found_error_response.py new file mode 100644 index 0000000..7d9038b --- /dev/null +++ b/gen/developer-api-client/developer_api_client/models/user_not_found_error_response.py @@ -0,0 +1,68 @@ +from collections.abc import Mapping +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UserNotFoundErrorResponse") + + +@_attrs_define +class UserNotFoundErrorResponse: + """ + Attributes: + message (Union[Unset, str]): Default: 'User not found.'. + status_code (Union[Unset, int]): Default: 404. + """ + + message: Union[Unset, str] = "User not found." + status_code: Union[Unset, int] = 404 + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status_code = self.status_code + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status_code is not UNSET: + field_dict["status_code"] = status_code + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + message = d.pop("message", UNSET) + + status_code = d.pop("status_code", UNSET) + + user_not_found_error_response = cls( + message=message, + status_code=status_code, + ) + + user_not_found_error_response.additional_properties = d + return user_not_found_error_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/gen/developer-api-client/developer_api_client/models/user_response.py b/gen/developer-api-client/developer_api_client/models/user_response.py index 24bb391..a16217e 100644 --- a/gen/developer-api-client/developer_api_client/models/user_response.py +++ b/gen/developer-api-client/developer_api_client/models/user_response.py @@ -4,6 +4,8 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field +from ..types import UNSET, Unset + T = TypeVar("T", bound="UserResponse") @@ -12,50 +14,82 @@ class UserResponse: """Represents a user in API responses Attributes: - id (int): - email (Union[None, str]): - github_user_id (str): - github_username (str): - avatar_url (Union[None, str]): - full_name (Union[None, str]): + id (int): Unique user ID + github_user_id (str): GitHub user ID + github_username (str): GitHub username + email (Union[None, Unset, str]): User's email address + avatar_url (Union[None, Unset, str]): URL to user's avatar image + full_name (Union[None, Unset, str]): User's full name + role (Union[None, Unset, str]): User's role in the organization (ADMIN, MANAGER, MEMBER) + is_admin (Union[None, Unset, bool]): Whether the user is an admin (deprecated, use role instead) """ id: int - email: Union[None, str] github_user_id: str github_username: str - avatar_url: Union[None, str] - full_name: Union[None, str] + email: Union[None, Unset, str] = UNSET + avatar_url: Union[None, Unset, str] = UNSET + full_name: Union[None, Unset, str] = UNSET + role: Union[None, Unset, str] = UNSET + is_admin: Union[None, Unset, bool] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - email: Union[None, str] - email = self.email - github_user_id = self.github_user_id github_username = self.github_username - avatar_url: Union[None, str] - avatar_url = self.avatar_url - - full_name: Union[None, str] - full_name = self.full_name + email: Union[None, Unset, str] + if isinstance(self.email, Unset): + email = UNSET + else: + email = self.email + + avatar_url: Union[None, Unset, str] + if isinstance(self.avatar_url, Unset): + avatar_url = UNSET + else: + avatar_url = self.avatar_url + + full_name: Union[None, Unset, str] + if isinstance(self.full_name, Unset): + full_name = UNSET + else: + full_name = self.full_name + + role: Union[None, Unset, str] + if isinstance(self.role, Unset): + role = UNSET + else: + role = self.role + + is_admin: Union[None, Unset, bool] + if isinstance(self.is_admin, Unset): + is_admin = UNSET + else: + is_admin = self.is_admin field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { "id": id, - "email": email, "github_user_id": github_user_id, "github_username": github_username, - "avatar_url": avatar_url, - "full_name": full_name, } ) + if email is not UNSET: + field_dict["email"] = email + if avatar_url is not UNSET: + field_dict["avatar_url"] = avatar_url + if full_name is not UNSET: + field_dict["full_name"] = full_name + if role is not UNSET: + field_dict["role"] = role + if is_admin is not UNSET: + field_dict["is_admin"] = is_admin return field_dict @@ -64,38 +98,64 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) id = d.pop("id") - def _parse_email(data: object) -> Union[None, str]: + github_user_id = d.pop("github_user_id") + + github_username = d.pop("github_username") + + def _parse_email(data: object) -> Union[None, Unset, str]: if data is None: return data - return cast(Union[None, str], data) + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) - email = _parse_email(d.pop("email")) + email = _parse_email(d.pop("email", UNSET)) - github_user_id = d.pop("github_user_id") + def _parse_avatar_url(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) - github_username = d.pop("github_username") + avatar_url = _parse_avatar_url(d.pop("avatar_url", UNSET)) - def _parse_avatar_url(data: object) -> Union[None, str]: + def _parse_full_name(data: object) -> Union[None, Unset, str]: if data is None: return data - return cast(Union[None, str], data) + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) - avatar_url = _parse_avatar_url(d.pop("avatar_url")) + full_name = _parse_full_name(d.pop("full_name", UNSET)) - def _parse_full_name(data: object) -> Union[None, str]: + def _parse_role(data: object) -> Union[None, Unset, str]: if data is None: return data - return cast(Union[None, str], data) + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) - full_name = _parse_full_name(d.pop("full_name")) + role = _parse_role(d.pop("role", UNSET)) + + def _parse_is_admin(data: object) -> Union[None, Unset, bool]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, bool], data) + + is_admin = _parse_is_admin(d.pop("is_admin", UNSET)) user_response = cls( id=id, - email=email, github_user_id=github_user_id, github_username=github_username, + email=email, avatar_url=avatar_url, full_name=full_name, + role=role, + is_admin=is_admin, ) user_response.additional_properties = d diff --git a/gen/openapi.yaml b/gen/openapi.yaml index 45bdf11..241c583 100644 --- a/gen/openapi.yaml +++ b/gen/openapi.yaml @@ -1,29 +1,37 @@ ---- openapi: 3.1.0 info: title: Developer API description: API for application developers version: 1.0.0 +servers: +- url: https://api.codegen.com + description: Codegen API paths: - "/v1/organizations/{org_id}/users": + /v1/organizations/{org_id}/users: get: tags: - users - users - users summary: Get Users - description: |- - Get paginated list of users for a specific organization. + description: 'Get users for the specified organization. - Returns a paginated list of all users associated with the specified organization. - The requesting user must be a member of the organization to access this endpoint. + + Returns a paginated list of all users that belong to the specified organization. + + Results include user details such as name, email, GitHub username, and avatar. + + Use pagination parameters to control the number of results returned. + + + Rate limit: 60 requests per 30 seconds.' operationId: get_users_v1_organizations__org_id__users_get parameters: - name: org_id in: path required: true schema: - type: string + type: integer title: Org Id - name: skip in: query @@ -53,44 +61,54 @@ paths: content: application/json: schema: - "$ref": "#/components/schemas/Page_UserResponse_" - '422': - description: Validation Error + $ref: '#/components/schemas/Page_UserResponse_' + '429': content: application/json: schema: - "$ref": "#/components/schemas/HTTPValidationError" - '429': + $ref: '#/components/schemas/APIRateLimitErrorResponse' + description: Too Many Requests + '403': content: application/json: schema: - "$ref": "#/components/schemas/FastAPIRateLimitResponse" - description: Too Many Requests - "/v1/organizations/{org_id}/users/{user_id}": + $ref: '#/components/schemas/PermissionsErrorResponse' + description: Forbidden + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/organizations/{org_id}/users/{user_id}: get: tags: - users - users - users summary: Get User - description: |- - Get details for a specific user in an organization. + description: 'Get details for a specific user in an organization. + Returns detailed information about a user within the specified organization. + The requesting user must be a member of the organization to access this endpoint. + + + Rate limit: 60 requests per 30 seconds.' operationId: get_user_v1_organizations__org_id__users__user_id__get parameters: - name: org_id in: path required: true schema: - type: string + type: integer title: Org Id - name: user_id in: path required: true schema: - type: string + type: integer title: User Id - name: authorization in: header @@ -103,33 +121,106 @@ paths: content: application/json: schema: - "$ref": "#/components/schemas/UserResponse" + $ref: '#/components/schemas/UserResponse' + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/APIRateLimitErrorResponse' + description: Too Many Requests + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/PermissionsErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/UserNotFoundErrorResponse' + description: Not Found '422': description: Validation Error content: application/json: schema: - "$ref": "#/components/schemas/HTTPValidationError" + $ref: '#/components/schemas/HTTPValidationError' + /v1/users/me: + get: + tags: + - users + - users + - users + summary: Get Current User Info + description: 'Get current user information from API token. + + + Returns detailed information about the user associated with the provided API + token. + + This is useful for applications that need to identify the current user from + their API token. + + + Rate limit: 60 requests per 30 seconds.' + operationId: get_current_user_info_v1_users_me_get + parameters: + - name: authorization + in: header + required: false + schema: + title: Authorization + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/UserResponse' '429': content: application/json: schema: - "$ref": "#/components/schemas/FastAPIRateLimitResponse" + $ref: '#/components/schemas/APIRateLimitErrorResponse' description: Too Many Requests - "/v1/organizations/{org_id}/agent/run": + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/PermissionsErrorResponse' + description: Forbidden + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/organizations/{org_id}/agent/run: post: tags: - agents - agents - agents summary: Create Agent Run - description: |- - Create a new agent run. + description: 'Create a new agent run. + Creates and initiates a long-running agent process based on the provided prompt. - The process will complete asynchronously, and the response contains the agent run ID - which can be used to check the status later. The requesting user must be a member + + The process will complete asynchronously, and the response contains the agent + run ID + + which can be used to check the status later. The requesting user must be a + member + of the specified organization. + + + This endpoint accepts both a text prompt and an optional image file upload. + + + Rate limit: 10 requests per minute.' operationId: create_agent_run_v1_organizations__org_id__agent_run_post parameters: - name: org_id @@ -148,39 +239,64 @@ paths: content: application/json: schema: - "$ref": "#/components/schemas/CreateAgentRunInput" + $ref: '#/components/schemas/CreateAgentRunInput' responses: '200': description: Successful Response content: application/json: schema: - "$ref": "#/components/schemas/AgentRunResponse" - '422': - description: Validation Error + $ref: '#/components/schemas/AgentRunResponse' + '429': content: application/json: schema: - "$ref": "#/components/schemas/HTTPValidationError" - '429': + $ref: '#/components/schemas/APIRateLimitErrorResponse' + description: Too Many Requests + '402': content: application/json: schema: - "$ref": "#/components/schemas/FastAPIRateLimitResponse" - description: Too Many Requests - "/v1/organizations/{org_id}/agent/run/{agent_run_id}": + $ref: '#/components/schemas/AgentRunLimitReachedErrorResponse' + description: Payment Required + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/PermissionsErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/NoReposFoundInOrgErrorResponse' + description: Not Found + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/organizations/{org_id}/agent/run/{agent_run_id}: get: tags: - agents - agents - agents summary: Get Agent Run - description: |- - Retrieve the status and result of an agent run. + description: 'Retrieve the status and result of an agent run. + + + Returns the current status, progress, and any available results for the specified + agent run. + + The agent run must belong to the specified organization. If the agent run + is still in progress, - Returns the current status, progress, and any available results for the specified agent run. - The agent run must belong to the specified organization. If the agent run is still in progress, this endpoint can be polled to check for completion. + + + Rate limit: 60 requests per 30 seconds.' operationId: get_agent_run_v1_organizations__org_id__agent_run__agent_run_id__get parameters: - name: agent_run_id @@ -206,34 +322,78 @@ paths: content: application/json: schema: - "$ref": "#/components/schemas/AgentRunResponse" - '422': - description: Validation Error + $ref: '#/components/schemas/AgentRunResponse' + '429': content: application/json: schema: - "$ref": "#/components/schemas/HTTPValidationError" - '429': + $ref: '#/components/schemas/APIRateLimitErrorResponse' + description: Too Many Requests + '403': content: application/json: schema: - "$ref": "#/components/schemas/FastAPIRateLimitResponse" - description: Too Many Requests - "/v1/organizations": + $ref: '#/components/schemas/PermissionsErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/AgentRunNotFoundErrorResponse' + description: Not Found + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/organizations/{org_id}/agent/runs: get: tags: - - organizations - - organizations - - organizations - summary: Get Organizations - description: |- - Get organizations for the authenticated user. + - agents + - agents + - agents + summary: List Agent Runs + description: 'List agent runs for an organization with optional user filtering. - Returns a paginated list of all organizations that the authenticated user is a member of. - Results include basic organization details such as name, ID, and membership information. - Use pagination parameters to control the number of results returned. - operationId: get_organizations_v1_organizations_get + + Returns a paginated list of agent runs for the specified organization. + + Optionally filter by user_id to get only agent runs initiated by a specific + user. + + Results are ordered by creation date (newest first). + + + Rate limit: 60 requests per 30 seconds.' + operationId: list_agent_runs_v1_organizations__org_id__agent_runs_get parameters: + - name: org_id + in: path + required: true + schema: + type: integer + title: Org Id + - name: user_id + in: query + required: false + schema: + anyOf: + - type: integer + - type: 'null' + description: Filter by user ID who initiated the agent runs + title: User Id + description: Filter by user ID who initiated the agent runs + - name: source_type + in: query + required: false + schema: + anyOf: + - $ref: '#/components/schemas/ApiAgentRunSourceType' + - type: 'null' + description: Filter by source type of the agent runs + title: Source Type + description: Filter by source type of the agent runs - name: skip in: query required: false @@ -262,85 +422,1417 @@ paths: content: application/json: schema: - "$ref": "#/components/schemas/Page_OrganizationResponse_" + $ref: '#/components/schemas/Page_AgentRunResponse_' + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/APIRateLimitErrorResponse' + description: Too Many Requests + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/PermissionsErrorResponse' + description: Forbidden '422': description: Validation Error content: application/json: schema: - "$ref": "#/components/schemas/HTTPValidationError" + $ref: '#/components/schemas/HTTPValidationError' + /v1/organizations/{org_id}/agent/run/resume: + post: + tags: + - agents + - agents + - agents + summary: Resume Agent Run + description: 'Resume a paused agent run. + + + Resumes a paused agent run, allowing it to continue processing.' + operationId: resume_agent_run_v1_organizations__org_id__agent_run_resume_post + parameters: + - name: org_id + in: path + required: true + schema: + type: integer + title: Org Id + - name: authorization + in: header + required: false + schema: + title: Authorization + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ResumeAgentRunInput' + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AgentRunResponse' '429': content: application/json: schema: - "$ref": "#/components/schemas/FastAPIRateLimitResponse" + $ref: '#/components/schemas/APIRateLimitErrorResponse' description: Too Many Requests -components: - schemas: - AgentRunResponse: - properties: - id: - type: integer - title: Id - organization_id: + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/PermissionsErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/AgentRunNotFoundErrorResponse' + description: Not Found + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/organizations/{org_id}/agent/run/ban: + post: + tags: + - agents + - agents + - agents + summary: Ban All Checks For Agent Run + description: 'Ban all checks for a PR and stop all related agents. + + + This endpoint: + + 1. Flags the PR to prevent future CI/CD check suite events from being processed + + 2. Stops all current agents for that PR' + operationId: ban_all_checks_for_agent_run_v1_organizations__org_id__agent_run_ban_post + parameters: + - name: org_id + in: path + required: true + schema: type: integer - title: Organization Id - status: - anyOf: - - type: string - - type: 'null' - title: Status - created_at: - anyOf: - - type: string - - type: 'null' - title: Created At - web_url: - anyOf: - - type: string - - type: 'null' - title: Web Url - result: - anyOf: - - type: string - - type: 'null' - title: Result - type: object - required: - - id - - organization_id - title: AgentRunResponse - description: Represents an agent run in API responses - CreateAgentRunInput: - properties: - prompt: - type: string - title: Prompt - type: object - required: - - prompt - title: CreateAgentRunInput - FastAPIRateLimitResponse: - properties: - detail: - type: string - title: Detail - default: Rate limit exceeded + title: Org Id + - name: authorization + in: header + required: false + schema: + title: Authorization + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/StopAgentRunInput' + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/APIRateLimitErrorResponse' + description: Too Many Requests + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/PermissionsErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/AgentRunNotFoundErrorResponse' + description: Not Found + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/organizations/{org_id}/agent/run/unban: + post: + tags: + - agents + - agents + - agents + summary: Unban All Checks For Agent Run + description: 'Unban all checks for a PR. + + + This endpoint: + + 1. Removes the ban flag from the PR to allow future CI/CD check suite events + to be processed + + 2. Handles both URL-based bans and parent-agent-run-based bans' + operationId: unban_all_checks_for_agent_run_v1_organizations__org_id__agent_run_unban_post + parameters: + - name: org_id + in: path + required: true + schema: + type: integer + title: Org Id + - name: authorization + in: header + required: false + schema: + title: Authorization + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/StopAgentRunInput' + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/APIRateLimitErrorResponse' + description: Too Many Requests + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/PermissionsErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/AgentRunNotFoundErrorResponse' + description: Not Found + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/organizations/{org_id}/agent/run/remove-from-pr: + post: + tags: + - agents + - agents + - agents + summary: Remove Codegen From Pr + description: 'Remove Codegen from a PR. + + + This endpoint performs the same action as banning all checks but with more + user-friendly naming. + + It: + + 1. Flags the PR to prevent future CI/CD check suite events from being processed + + 2. Stops all current agents for that PR' + operationId: remove_codegen_from_pr_v1_organizations__org_id__agent_run_remove_from_pr_post + parameters: + - name: org_id + in: path + required: true + schema: + type: integer + title: Org Id + - name: authorization + in: header + required: false + schema: + title: Authorization + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/StopAgentRunInput' + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/APIRateLimitErrorResponse' + description: Too Many Requests + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/PermissionsErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/AgentRunNotFoundErrorResponse' + description: Not Found + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/organizations/{org_id}/repos: + get: + tags: + - repositories + - repositories + - repositories + summary: Get Repositories + description: 'Get repositories for the specified organization. + + + Returns a paginated list of all repositories that belong to the specified + organization. + + Results include repository details such as name, ID, description, visibility, + and setup status. + + Use pagination parameters to control the number of results returned. + + + Rate limit: 60 requests per 30 seconds.' + operationId: get_repositories_v1_organizations__org_id__repos_get + parameters: + - name: org_id + in: path + required: true + schema: + type: integer + title: Org Id + - name: skip + in: query + required: false + schema: + type: integer + minimum: 0 + default: 0 + title: Skip + - name: limit + in: query + required: false + schema: + type: integer + maximum: 100 + minimum: 1 + default: 100 + title: Limit + - name: authorization + in: header + required: false + schema: + title: Authorization + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Page_RepoResponse_' + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/APIRateLimitErrorResponse' + description: Too Many Requests + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/organizations/{org_id}/repos/{repo_id}/check-suite/settings: + get: + tags: + - repositories + - repositories + - repositories + summary: Get Check Suite Settings + description: 'Get check suite retry settings for a repository. + + + Returns the current configuration for check suite retry logic including: + + - retry_count: Maximum number of retry attempts per failed check + + - ignored_checks: List of check names that should be ignored + + + Rate limit: 60 requests per 30 seconds.' + operationId: get_check_suite_settings_v1_organizations__org_id__repos__repo_id__check_suite_settings_get + parameters: + - name: org_id + in: path + required: true + schema: + type: integer + title: Org Id + - name: repo_id + in: path + required: true + schema: + type: integer + title: Repo Id + - name: authorization + in: header + required: false + schema: + title: Authorization + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/CheckSuiteSettingsResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + put: + tags: + - repositories + - repositories + - repositories + summary: Update Check Suite Settings + description: 'Update check suite retry settings for a repository. + + + Updates the configuration for check suite retry logic. You can update: + + - retry_count: Maximum number of retry attempts per failed check (0-10) + + - ignored_checks: List of check names that should be ignored + + + Rate limit: 30 requests per 60 seconds.' + operationId: update_check_suite_settings_v1_organizations__org_id__repos__repo_id__check_suite_settings_put + parameters: + - name: org_id + in: path + required: true + schema: + type: integer + title: Org Id + - name: repo_id + in: path + required: true + schema: + type: integer + title: Repo Id + - name: authorization + in: header + required: false + schema: + title: Authorization + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateCheckSuiteSettingsRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/CheckSuiteSettingsResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/organizations/{org_id}/repos/{repo_id}/check-suite/stats: + get: + tags: + - repositories + - repositories + - repositories + summary: Get Check Suite Retry Stats + description: 'Get check suite retry statistics for a repository. + + + Returns comprehensive statistics about check suite orchestrations and retry + attempts: + + - Total, active, completed, and failed orchestrations + + - Total retry attempts across all checks + + - Number of checks that have reached their retry limit + + + Rate limit: 60 requests per 30 seconds.' + operationId: get_check_suite_retry_stats_v1_organizations__org_id__repos__repo_id__check_suite_stats_get + parameters: + - name: org_id + in: path + required: true + schema: + type: integer + title: Org Id + - name: repo_id + in: path + required: true + schema: + type: integer + title: Repo Id + - name: authorization + in: header + required: false + schema: + title: Authorization + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/CheckSuiteRetryStatsResponse' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/organizations/{org_id}/tools: + get: + tags: + - tools + - tools + - tools + summary: Get Available Tools + description: 'Get a list of all available tools for the given API token and + organization. + + + Returns a comprehensive list of tools that can be used with the current API + token, + + including their names, descriptions, and parameter specifications. Tools are + filtered + + based on the organization''s permissions and enabled integrations. + + + The response includes tool schemas that can be used to understand: + + - Tool name and description + + - Required and optional parameters + + - Parameter types and constraints + + - Default values where applicable + + + Rate limit: 60 requests per 30 seconds.' + operationId: get_available_tools_v1_organizations__org_id__tools_get + parameters: + - name: org_id + in: path + required: true + schema: + type: integer + title: Org Id + - name: repo_id + in: query + required: false + schema: + anyOf: + - type: integer + - type: 'null' + description: Optional repository ID to filter tools for specific repository + context + title: Repo Id + description: Optional repository ID to filter tools for specific repository + context + - name: authorization + in: header + required: false + schema: + title: Authorization + responses: + '200': + description: Successful Response + content: + application/json: + schema: + type: object + additionalProperties: true + title: Response Get Available Tools V1 Organizations Org Id Tools + Get + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/APIRateLimitErrorResponse' + description: Too Many Requests + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/PermissionsErrorResponse' + description: Forbidden + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/organizations/{org_id}/tools/execute: + post: + tags: + - tools + - tools + - tools + summary: Execute Tool + description: 'Execute a specific tool with the provided arguments. + + + This endpoint allows direct execution of available tools by providing the + tool name + + and arguments as JSON. The tool will be executed in the context of the authenticated + + user''s organization and permissions. + + + The tool execution happens with the same permissions and context as if the + tool + + were called by an agent, ensuring proper security and access control. + + + Rate limit: 30 requests per minute.' + operationId: execute_tool_v1_organizations__org_id__tools_execute_post + parameters: + - name: org_id + in: path + required: true + schema: + type: integer + title: Org Id + - name: authorization + in: header + required: false + schema: + title: Authorization + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ToolExecutionRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/ToolExecutionResponse' + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/APIRateLimitErrorResponse' + description: Too Many Requests + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/PermissionsErrorResponse' + description: Forbidden + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/organizations/{org_id}/integrations: + get: + tags: + - integrations + - integrations + - integrations + summary: Get Organization Integrations Endpoint + description: 'Get all integration statuses for the given organization. + + + Returns a comprehensive overview of all integrations configured for the organization, + + including: + + - OAuth-based integrations (Slack, Linear, Notion, Figma, ClickUp, Jira, Sentry, + Monday.com) + + - GitHub app installations + + - API key-based integrations (CircleCI) + + - Database connections (PostgreSQL) + + + Each integration includes its current status (active/inactive), associated + token/installation IDs, + + and relevant metadata such as app names, organization names, etc. + + + Rate limit: 60 requests per 30 seconds.' + operationId: get_organization_integrations_endpoint_v1_organizations__org_id__integrations_get + parameters: + - name: org_id + in: path + required: true + schema: + type: integer + title: Org Id + - name: authorization + in: header + required: false + schema: + title: Authorization + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationIntegrationsResponse' + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/APIRateLimitErrorResponse' + description: Too Many Requests + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/PermissionsErrorResponse' + description: Forbidden + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/linear/projects: + get: + tags: + - linear + - linear + - linear + summary: Get Linear Projects + description: 'Get Linear projects for the authenticated user''s organization. + + + Returns a list of all Linear projects that the authenticated user has access + to + + within the specified organization. This endpoint is used to populate project + + selection dropdowns in repository settings. + + + Rate limit: 60 requests per 30 seconds.' + operationId: get_linear_projects_v1_linear_projects_get + parameters: + - name: authorization + in: header + required: false + schema: + title: Authorization + - name: X-Organization-Id + in: header + required: false + schema: + title: X-Organization-Id + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/APIRateLimitErrorResponse' + description: Too Many Requests + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/linear/teams: + get: + tags: + - linear + - linear + - linear + summary: Get Linear Teams + description: 'Get Linear teams for the authenticated user''s organization. + + + Returns a list of all Linear teams that the authenticated user has access + to + + within the specified organization. This endpoint is used to populate team + + selection dropdowns in repository settings. + + + Rate limit: 60 requests per 30 seconds.' + operationId: get_linear_teams_v1_linear_teams_get + parameters: + - name: authorization + in: header + required: false + schema: + title: Authorization + - name: X-Organization-Id + in: header + required: false + schema: + title: X-Organization-Id + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/APIRateLimitErrorResponse' + description: Too Many Requests + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/organizations: + get: + tags: + - organizations + - organizations + - organizations + summary: Get Organizations + description: 'Get organizations for the authenticated user. + + + Returns a paginated list of all organizations that the authenticated user + is a member of. + + Results include basic organization details such as name, ID, and membership + information. + + Use pagination parameters to control the number of results returned. + + + Rate limit: 60 requests per 30 seconds.' + operationId: get_organizations_v1_organizations_get + parameters: + - name: skip + in: query + required: false + schema: + type: integer + minimum: 0 + default: 0 + title: Skip + - name: limit + in: query + required: false + schema: + type: integer + maximum: 100 + minimum: 1 + default: 100 + title: Limit + - name: authorization + in: header + required: false + schema: + title: Authorization + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Page_OrganizationResponse_' + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/APIRateLimitErrorResponse' + description: Too Many Requests + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/alpha/organizations/{org_id}/agent/run/{agent_run_id}/logs: + get: + tags: + - agents-alpha + - agents-alpha + - agents-beta + summary: Get Agent Run Logs + description: 'Retrieve an agent run with its logs using pagination. This endpoint + is currently in ALPHA and IS subject to change. + + + Returns the agent run details along with a paginated list of logs for the + specified agent run. + + The agent run must belong to the specified organization. Logs are returned + in chronological order. + + Uses standard pagination parameters (skip and limit) and includes pagination + metadata in the response. + + + Rate limit: 60 requests per 60 seconds.' + operationId: get_agent_run_logs_v1_alpha_organizations__org_id__agent_run__agent_run_id__logs_get + parameters: + - name: agent_run_id + in: path + required: true + schema: + type: integer + title: Agent Run Id + - name: org_id + in: path + required: true + schema: + type: integer + title: Org Id + - name: skip + in: query + required: false + schema: + type: integer + minimum: 0 + default: 0 + title: Skip + - name: limit + in: query + required: false + schema: + type: integer + maximum: 100 + minimum: 1 + default: 100 + title: Limit + - name: authorization + in: header + required: false + schema: + title: Authorization + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AgentRunWithLogsResponse' + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/APIRateLimitErrorResponse' + description: Too Many Requests + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/PermissionsErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/AgentRunNotFoundErrorResponse' + description: Not Found + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' +components: + schemas: + APIRateLimitErrorResponse: + properties: + message: + type: string + title: Message + default: Rate limit exceeded. Please try again later. + status_code: + type: integer + title: Status Code + default: 429 + type: object + title: APIRateLimitErrorResponse + AgentRunLimitReachedErrorResponse: + properties: + message: + type: string + title: Message + default: Alloted agent runs for the current billing plan have been reached. + Please upgrade your plan to continue. + status_code: + type: integer + title: Status Code + default: 402 + type: object + title: AgentRunLimitReachedErrorResponse + AgentRunLogResponse: + properties: + agent_run_id: + type: integer + title: Agent Run Id + created_at: + anyOf: + - type: string + - type: 'null' + title: Created At + tool_name: + anyOf: + - type: string + - type: 'null' + title: Tool Name + message_type: + anyOf: + - type: string + - type: 'null' + title: Message Type + thought: + anyOf: + - type: string + - type: 'null' + title: Thought + observation: + anyOf: + - additionalProperties: true + type: object + - type: string + - type: 'null' + title: Observation + tool_input: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Tool Input + tool_output: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Tool Output + type: object + required: + - agent_run_id + title: AgentRunLogResponse + description: Represents an agent run log in API responses + AgentRunNotFoundErrorResponse: + properties: + message: + type: string + title: Message + default: Agent run not found. status_code: type: integer - title: Status Code - default: 429 + title: Status Code + default: 404 + type: object + title: AgentRunNotFoundErrorResponse + AgentRunResponse: + properties: + id: + type: integer + title: Id + organization_id: + type: integer + title: Organization Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + created_at: + anyOf: + - type: string + - type: 'null' + title: Created At + web_url: + anyOf: + - type: string + - type: 'null' + title: Web Url + result: + anyOf: + - type: string + - type: 'null' + title: Result + source_type: + anyOf: + - $ref: '#/components/schemas/ApiAgentRunSourceType' + - type: 'null' + github_pull_requests: + anyOf: + - items: + $ref: '#/components/schemas/GithubPullRequestResponse' + type: array + - type: 'null' + title: Github Pull Requests + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + type: object + required: + - id + - organization_id + title: AgentRunResponse + description: Represents an agent run in API responses + AgentRunWithLogsResponse: + properties: + id: + type: integer + title: Id + organization_id: + type: integer + title: Organization Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + created_at: + anyOf: + - type: string + - type: 'null' + title: Created At + web_url: + anyOf: + - type: string + - type: 'null' + title: Web Url + result: + anyOf: + - type: string + - type: 'null' + title: Result + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + logs: + items: + $ref: '#/components/schemas/AgentRunLogResponse' + type: array + title: Logs + total_logs: + anyOf: + - type: integer + - type: 'null' + title: Total Logs + page: + anyOf: + - type: integer + - type: 'null' + title: Page + size: + anyOf: + - type: integer + - type: 'null' + title: Size + pages: + anyOf: + - type: integer + - type: 'null' + title: Pages + type: object + required: + - id + - organization_id + - logs + title: AgentRunWithLogsResponse + description: Represents an agent run in API responses + ApiAgentRunSourceType: + type: string + enum: + - LOCAL + - SLACK + - GITHUB + - GITHUB_CHECK_SUITE + - LINEAR + - API + - CHAT + - JIRA + title: ApiAgentRunSourceType + CheckSuiteRetryStatsResponse: + properties: + repo_id: + type: integer + title: Repo Id + description: Repository ID + total_orchestrations: + type: integer + title: Total Orchestrations + description: Total number of orchestrations + active_orchestrations: + type: integer + title: Active Orchestrations + description: Number of active orchestrations + completed_orchestrations: + type: integer + title: Completed Orchestrations + description: Number of completed orchestrations + failed_orchestrations: + type: integer + title: Failed Orchestrations + description: Number of failed orchestrations + total_retry_attempts: + type: integer + title: Total Retry Attempts + description: Total number of retry attempts across all checks + checks_at_retry_limit: + type: integer + title: Checks At Retry Limit + description: Number of checks that have reached their retry limit + type: object + required: + - repo_id + - total_orchestrations + - active_orchestrations + - completed_orchestrations + - failed_orchestrations + - total_retry_attempts + - checks_at_retry_limit + title: CheckSuiteRetryStatsResponse + description: Response model for check suite retry statistics. + example: + active_orchestrations: 2 + checks_at_retry_limit: 8 + completed_orchestrations: 40 + failed_orchestrations: 3 + repo_id: 123 + total_orchestrations: 45 + total_retry_attempts: 67 + CheckSuiteSettingsResponse: + properties: + retry_count: + type: integer + maximum: 10.0 + minimum: 0.0 + title: Retry Count + description: Number of retry attempts for failed checks + ignored_checks: + items: + type: string + type: array + title: Ignored Checks + description: List of check names to ignore + type: object + required: + - retry_count + - ignored_checks + title: CheckSuiteSettingsResponse + description: Response model for check suite settings. + example: + ignored_checks: + - dependency-review + - security-scan + retry_count: 3 + CreateAgentRunInput: + properties: + prompt: + type: string + title: Prompt + images: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Images + description: List of base64 encoded data URIs representing images to be + processed by the agent + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + description: Arbitrary JSON metadata to be stored with the agent run + repo_id: + anyOf: + - type: integer + - type: 'null' + title: Repo Id + description: ID of the repository to use for the agent run + model: + anyOf: + - type: string + - type: 'null' + title: Model + description: Model to use for this agent run (optional, uses org default + if not specified) + type: object + required: + - prompt + title: CreateAgentRunInput + GithubPullRequestResponse: + properties: + id: + type: integer + title: Id + title: + type: string + title: Title + url: + type: string + title: Url + created_at: + type: string + title: Created At type: object - title: FastAPIRateLimitResponse + required: + - id + - title + - url + - created_at + title: GithubPullRequestResponse HTTPValidationError: properties: detail: items: - "$ref": "#/components/schemas/ValidationError" + $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError + IntegrationStatus: + properties: + integration_type: + type: string + title: Integration Type + description: Type of integration (e.g., 'github', 'slack', 'linear', etc.) + active: + type: boolean + title: Active + description: Whether the integration is currently active + token_id: + anyOf: + - type: integer + - type: 'null' + title: Token Id + description: ID of the associated token, if any + installation_id: + anyOf: + - type: integer + - type: 'null' + title: Installation Id + description: ID of the app installation, if applicable + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + description: Additional metadata about the integration + type: object + required: + - integration_type + - active + title: IntegrationStatus + description: Status information for a single integration. + NoReposFoundInOrgErrorResponse: + properties: + message: + type: string + title: Message + default: No repos found in the organization. Please add some repos and try + again. + status_code: + type: integer + title: Status Code + default: 404 + type: object + title: NoReposFoundInOrgErrorResponse + OrganizationIntegrationsResponse: + properties: + organization_id: + type: integer + title: Organization Id + description: ID of the organization + organization_name: + type: string + title: Organization Name + description: Name of the organization + integrations: + items: + $ref: '#/components/schemas/IntegrationStatus' + type: array + title: Integrations + description: List of integration statuses + total_active_integrations: + type: integer + title: Total Active Integrations + description: Total number of active integrations + type: object + required: + - organization_id + - organization_name + - integrations + - total_active_integrations + title: OrganizationIntegrationsResponse + description: Response schema for organization integrations. OrganizationResponse: properties: id: @@ -350,7 +1842,7 @@ components: type: string title: Name settings: - "$ref": "#/components/schemas/OrganizationSettings" + $ref: '#/components/schemas/OrganizationSettings' type: object required: - id @@ -370,11 +1862,38 @@ components: default: true type: object title: OrganizationSettings + Page_AgentRunResponse_: + properties: + items: + items: + $ref: '#/components/schemas/AgentRunResponse' + type: array + title: Items + total: + type: integer + title: Total + page: + type: integer + title: Page + size: + type: integer + title: Size + pages: + type: integer + title: Pages + type: object + required: + - items + - total + - page + - size + - pages + title: Page[AgentRunResponse] Page_OrganizationResponse_: properties: items: items: - "$ref": "#/components/schemas/OrganizationResponse" + $ref: '#/components/schemas/OrganizationResponse' type: array title: Items total: @@ -397,11 +1916,38 @@ components: - size - pages title: Page[OrganizationResponse] + Page_RepoResponse_: + properties: + items: + items: + $ref: '#/components/schemas/RepoResponse' + type: array + title: Items + total: + type: integer + title: Total + page: + type: integer + title: Page + size: + type: integer + title: Size + pages: + type: integer + title: Pages + type: object + required: + - items + - total + - page + - size + - pages + title: Page[RepoResponse] Page_UserResponse_: properties: items: items: - "$ref": "#/components/schemas/UserResponse" + $ref: '#/components/schemas/UserResponse' type: array title: Items total: @@ -424,40 +1970,244 @@ components: - size - pages title: Page[UserResponse] + PermissionsErrorResponse: + properties: + message: + type: string + title: Message + default: You do not have access to this organization. + status_code: + type: integer + title: Status Code + default: 403 + type: object + title: PermissionsErrorResponse + RepoResponse: + properties: + id: + type: integer + title: Id + name: + type: string + title: Name + full_name: + type: string + title: Full Name + description: + anyOf: + - type: string + - type: 'null' + title: Description + github_id: + type: string + title: Github Id + organization_id: + type: integer + title: Organization Id + visibility: + anyOf: + - type: string + - type: 'null' + title: Visibility + archived: + anyOf: + - type: boolean + - type: 'null' + title: Archived + setup_status: + type: string + title: Setup Status + language: + anyOf: + - type: string + - type: 'null' + title: Language + type: object + required: + - id + - name + - full_name + - description + - github_id + - organization_id + - visibility + - archived + - setup_status + - language + title: RepoResponse + description: Represents a repository in API responses + ResumeAgentRunInput: + properties: + agent_run_id: + type: integer + title: Agent Run Id + prompt: + type: string + title: Prompt + images: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Images + description: List of base64 encoded data URIs representing images to be + processed by the agent + type: object + required: + - agent_run_id + - prompt + title: ResumeAgentRunInput + StopAgentRunInput: + properties: + agent_run_id: + type: integer + title: Agent Run Id + type: object + required: + - agent_run_id + title: StopAgentRunInput + ToolExecutionRequest: + properties: + tool_name: + type: string + title: Tool Name + description: Name of the tool to execute + arguments: + additionalProperties: true + type: object + title: Arguments + description: JSON arguments to pass to the tool + repo_id: + anyOf: + - type: integer + - type: 'null' + title: Repo Id + description: Optional repository ID for repository-specific tool context + type: object + required: + - tool_name + - arguments + title: ToolExecutionRequest + description: Request schema for tool execution. + ToolExecutionResponse: + properties: + success: + type: boolean + title: Success + description: Whether the tool execution was successful + result: + title: Result + description: The result returned by the tool + error: + anyOf: + - type: string + - type: 'null' + title: Error + description: Error message if execution failed + tool_name: + type: string + title: Tool Name + description: Name of the executed tool + execution_time_ms: + anyOf: + - type: number + - type: 'null' + title: Execution Time Ms + description: Tool execution time in milliseconds + type: object + required: + - success + - tool_name + title: ToolExecutionResponse + description: Response schema for tool execution. + UpdateCheckSuiteSettingsRequest: + properties: + retry_count: + anyOf: + - type: integer + maximum: 10.0 + minimum: 0.0 + - type: 'null' + title: Retry Count + description: Number of retry attempts for failed checks + ignored_checks: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Ignored Checks + description: List of check names to ignore + type: object + title: UpdateCheckSuiteSettingsRequest + description: Request model for updating check suite settings. + example: + ignored_checks: + - dependency-review + - security-scan + retry_count: 3 + UserNotFoundErrorResponse: + properties: + message: + type: string + title: Message + default: User not found. + status_code: + type: integer + title: Status Code + default: 404 + type: object + title: UserNotFoundErrorResponse UserResponse: properties: id: type: integer title: Id + description: Unique user ID email: anyOf: - type: string - type: 'null' title: Email + description: User's email address github_user_id: type: string title: Github User Id + description: GitHub user ID github_username: type: string title: Github Username + description: GitHub username avatar_url: anyOf: - type: string - type: 'null' title: Avatar Url + description: URL to user's avatar image full_name: anyOf: - type: string - type: 'null' title: Full Name + description: User's full name + role: + anyOf: + - type: string + - type: 'null' + title: Role + description: User's role in the organization (ADMIN, MANAGER, MEMBER) + is_admin: + anyOf: + - type: boolean + - type: 'null' + title: Is Admin + description: Whether the user is an admin (deprecated, use role instead) type: object required: - id - - email - github_user_id - github_username - - avatar_url - - full_name title: UserResponse description: Represents a user in API responses ValidationError: diff --git a/test/test_agent_run_limit_reached_error_response.py b/test/test_agent_run_limit_reached_error_response.py new file mode 100644 index 0000000..0a6945f --- /dev/null +++ b/test/test_agent_run_limit_reached_error_response.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from codegen_api_client.models.agent_run_limit_reached_error_response import AgentRunLimitReachedErrorResponse + +class TestAgentRunLimitReachedErrorResponse(unittest.TestCase): + """AgentRunLimitReachedErrorResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AgentRunLimitReachedErrorResponse: + """Test AgentRunLimitReachedErrorResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AgentRunLimitReachedErrorResponse` + """ + model = AgentRunLimitReachedErrorResponse() + if include_optional: + return AgentRunLimitReachedErrorResponse( + message = 'Alloted agent runs for the current billing plan have been reached. Please upgrade your plan to continue.', + status_code = 56 + ) + else: + return AgentRunLimitReachedErrorResponse( + ) + """ + + def testAgentRunLimitReachedErrorResponse(self): + """Test AgentRunLimitReachedErrorResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_agent_run_log_response.py b/test/test_agent_run_log_response.py new file mode 100644 index 0000000..08c7a6b --- /dev/null +++ b/test/test_agent_run_log_response.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from codegen_api_client.models.agent_run_log_response import AgentRunLogResponse + +class TestAgentRunLogResponse(unittest.TestCase): + """AgentRunLogResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AgentRunLogResponse: + """Test AgentRunLogResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AgentRunLogResponse` + """ + model = AgentRunLogResponse() + if include_optional: + return AgentRunLogResponse( + agent_run_id = 56, + created_at = '', + tool_name = '', + message_type = '', + thought = '', + observation = None, + tool_input = { }, + tool_output = { } + ) + else: + return AgentRunLogResponse( + agent_run_id = 56, + ) + """ + + def testAgentRunLogResponse(self): + """Test AgentRunLogResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_agent_run_not_found_error_response.py b/test/test_agent_run_not_found_error_response.py new file mode 100644 index 0000000..2d427cc --- /dev/null +++ b/test/test_agent_run_not_found_error_response.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from codegen_api_client.models.agent_run_not_found_error_response import AgentRunNotFoundErrorResponse + +class TestAgentRunNotFoundErrorResponse(unittest.TestCase): + """AgentRunNotFoundErrorResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AgentRunNotFoundErrorResponse: + """Test AgentRunNotFoundErrorResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AgentRunNotFoundErrorResponse` + """ + model = AgentRunNotFoundErrorResponse() + if include_optional: + return AgentRunNotFoundErrorResponse( + message = 'Agent run not found.', + status_code = 56 + ) + else: + return AgentRunNotFoundErrorResponse( + ) + """ + + def testAgentRunNotFoundErrorResponse(self): + """Test AgentRunNotFoundErrorResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_agent_run_with_logs_response.py b/test/test_agent_run_with_logs_response.py new file mode 100644 index 0000000..5e35487 --- /dev/null +++ b/test/test_agent_run_with_logs_response.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from codegen_api_client.models.agent_run_with_logs_response import AgentRunWithLogsResponse + +class TestAgentRunWithLogsResponse(unittest.TestCase): + """AgentRunWithLogsResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AgentRunWithLogsResponse: + """Test AgentRunWithLogsResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AgentRunWithLogsResponse` + """ + model = AgentRunWithLogsResponse() + if include_optional: + return AgentRunWithLogsResponse( + id = 56, + organization_id = 56, + status = '', + created_at = '', + web_url = '', + result = '', + metadata = { }, + logs = [ + codegen_api_client.models.agent_run_log_response.AgentRunLogResponse( + agent_run_id = 56, + created_at = '', + tool_name = '', + message_type = '', + thought = '', + observation = null, + tool_input = { }, + tool_output = { }, ) + ], + total_logs = 56, + page = 56, + size = 56, + pages = 56 + ) + else: + return AgentRunWithLogsResponse( + id = 56, + organization_id = 56, + logs = [ + codegen_api_client.models.agent_run_log_response.AgentRunLogResponse( + agent_run_id = 56, + created_at = '', + tool_name = '', + message_type = '', + thought = '', + observation = null, + tool_input = { }, + tool_output = { }, ) + ], + ) + """ + + def testAgentRunWithLogsResponse(self): + """Test AgentRunWithLogsResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_agents_alpha_api.py b/test/test_agents_alpha_api.py new file mode 100644 index 0000000..f52d650 --- /dev/null +++ b/test/test_agents_alpha_api.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from codegen_api_client.api.agents_alpha_api import AgentsAlphaApi + + +class TestAgentsAlphaApi(unittest.TestCase): + """AgentsAlphaApi unit test stubs""" + + def setUp(self) -> None: + self.api = AgentsAlphaApi() + + def tearDown(self) -> None: + pass + + def test_get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get(self) -> None: + """Test case for get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get + + Get Agent Run Logs + """ + pass + + def test_get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get_0(self) -> None: + """Test case for get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get_0 + + Get Agent Run Logs + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_agents_beta_api.py b/test/test_agents_beta_api.py new file mode 100644 index 0000000..ce02210 --- /dev/null +++ b/test/test_agents_beta_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from codegen_api_client.api.agents_beta_api import AgentsBetaApi + + +class TestAgentsBetaApi(unittest.TestCase): + """AgentsBetaApi unit test stubs""" + + def setUp(self) -> None: + self.api = AgentsBetaApi() + + def tearDown(self) -> None: + pass + + def test_get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get(self) -> None: + """Test case for get_agent_run_logs_v1_alpha_organizations_org_id_agent_run_agent_run_id_logs_get + + Get Agent Run Logs + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_api_agent_run_source_type.py b/test/test_api_agent_run_source_type.py new file mode 100644 index 0000000..cd97017 --- /dev/null +++ b/test/test_api_agent_run_source_type.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from codegen_api_client.models.api_agent_run_source_type import ApiAgentRunSourceType + +class TestApiAgentRunSourceType(unittest.TestCase): + """ApiAgentRunSourceType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testApiAgentRunSourceType(self): + """Test ApiAgentRunSourceType""" + # inst = ApiAgentRunSourceType() + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_api_rate_limit_error_response.py b/test/test_api_rate_limit_error_response.py new file mode 100644 index 0000000..bf34874 --- /dev/null +++ b/test/test_api_rate_limit_error_response.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from codegen_api_client.models.api_rate_limit_error_response import APIRateLimitErrorResponse + +class TestAPIRateLimitErrorResponse(unittest.TestCase): + """APIRateLimitErrorResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> APIRateLimitErrorResponse: + """Test APIRateLimitErrorResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `APIRateLimitErrorResponse` + """ + model = APIRateLimitErrorResponse() + if include_optional: + return APIRateLimitErrorResponse( + message = 'Rate limit exceeded. Please try again later.', + status_code = 56 + ) + else: + return APIRateLimitErrorResponse( + ) + """ + + def testAPIRateLimitErrorResponse(self): + """Test APIRateLimitErrorResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_check_suite_retry_stats_response.py b/test/test_check_suite_retry_stats_response.py new file mode 100644 index 0000000..16e25b1 --- /dev/null +++ b/test/test_check_suite_retry_stats_response.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from codegen_api_client.models.check_suite_retry_stats_response import CheckSuiteRetryStatsResponse + +class TestCheckSuiteRetryStatsResponse(unittest.TestCase): + """CheckSuiteRetryStatsResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CheckSuiteRetryStatsResponse: + """Test CheckSuiteRetryStatsResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CheckSuiteRetryStatsResponse` + """ + model = CheckSuiteRetryStatsResponse() + if include_optional: + return CheckSuiteRetryStatsResponse( + repo_id = 56, + total_orchestrations = 56, + active_orchestrations = 56, + completed_orchestrations = 56, + failed_orchestrations = 56, + total_retry_attempts = 56, + checks_at_retry_limit = 56 + ) + else: + return CheckSuiteRetryStatsResponse( + repo_id = 56, + total_orchestrations = 56, + active_orchestrations = 56, + completed_orchestrations = 56, + failed_orchestrations = 56, + total_retry_attempts = 56, + checks_at_retry_limit = 56, + ) + """ + + def testCheckSuiteRetryStatsResponse(self): + """Test CheckSuiteRetryStatsResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_check_suite_settings_response.py b/test/test_check_suite_settings_response.py new file mode 100644 index 0000000..d01eb65 --- /dev/null +++ b/test/test_check_suite_settings_response.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from codegen_api_client.models.check_suite_settings_response import CheckSuiteSettingsResponse + +class TestCheckSuiteSettingsResponse(unittest.TestCase): + """CheckSuiteSettingsResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CheckSuiteSettingsResponse: + """Test CheckSuiteSettingsResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CheckSuiteSettingsResponse` + """ + model = CheckSuiteSettingsResponse() + if include_optional: + return CheckSuiteSettingsResponse( + retry_count = 0.0, + ignored_checks = [ + '' + ] + ) + else: + return CheckSuiteSettingsResponse( + retry_count = 0.0, + ignored_checks = [ + '' + ], + ) + """ + + def testCheckSuiteSettingsResponse(self): + """Test CheckSuiteSettingsResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_github_pull_request_response.py b/test/test_github_pull_request_response.py new file mode 100644 index 0000000..4b8be3f --- /dev/null +++ b/test/test_github_pull_request_response.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from codegen_api_client.models.github_pull_request_response import GithubPullRequestResponse + +class TestGithubPullRequestResponse(unittest.TestCase): + """GithubPullRequestResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GithubPullRequestResponse: + """Test GithubPullRequestResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GithubPullRequestResponse` + """ + model = GithubPullRequestResponse() + if include_optional: + return GithubPullRequestResponse( + id = 56, + title = '', + url = '', + created_at = '' + ) + else: + return GithubPullRequestResponse( + id = 56, + title = '', + url = '', + created_at = '', + ) + """ + + def testGithubPullRequestResponse(self): + """Test GithubPullRequestResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_integration_status.py b/test/test_integration_status.py new file mode 100644 index 0000000..813372d --- /dev/null +++ b/test/test_integration_status.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from codegen_api_client.models.integration_status import IntegrationStatus + +class TestIntegrationStatus(unittest.TestCase): + """IntegrationStatus unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> IntegrationStatus: + """Test IntegrationStatus + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `IntegrationStatus` + """ + model = IntegrationStatus() + if include_optional: + return IntegrationStatus( + integration_type = '', + active = True, + token_id = 56, + installation_id = 56, + metadata = { } + ) + else: + return IntegrationStatus( + integration_type = '', + active = True, + ) + """ + + def testIntegrationStatus(self): + """Test IntegrationStatus""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_integrations_api.py b/test/test_integrations_api.py new file mode 100644 index 0000000..08dfed5 --- /dev/null +++ b/test/test_integrations_api.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from codegen_api_client.api.integrations_api import IntegrationsApi + + +class TestIntegrationsApi(unittest.TestCase): + """IntegrationsApi unit test stubs""" + + def setUp(self) -> None: + self.api = IntegrationsApi() + + def tearDown(self) -> None: + pass + + def test_get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get(self) -> None: + """Test case for get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get + + Get Organization Integrations Endpoint + """ + pass + + def test_get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_0(self) -> None: + """Test case for get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_0 + + Get Organization Integrations Endpoint + """ + pass + + def test_get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_1(self) -> None: + """Test case for get_organization_integrations_endpoint_v1_organizations_org_id_integrations_get_1 + + Get Organization Integrations Endpoint + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_linear_api.py b/test/test_linear_api.py new file mode 100644 index 0000000..6f789c2 --- /dev/null +++ b/test/test_linear_api.py @@ -0,0 +1,73 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from codegen_api_client.api.linear_api import LinearApi + + +class TestLinearApi(unittest.TestCase): + """LinearApi unit test stubs""" + + def setUp(self) -> None: + self.api = LinearApi() + + def tearDown(self) -> None: + pass + + def test_get_linear_projects_v1_linear_projects_get(self) -> None: + """Test case for get_linear_projects_v1_linear_projects_get + + Get Linear Projects + """ + pass + + def test_get_linear_projects_v1_linear_projects_get_0(self) -> None: + """Test case for get_linear_projects_v1_linear_projects_get_0 + + Get Linear Projects + """ + pass + + def test_get_linear_projects_v1_linear_projects_get_1(self) -> None: + """Test case for get_linear_projects_v1_linear_projects_get_1 + + Get Linear Projects + """ + pass + + def test_get_linear_teams_v1_linear_teams_get(self) -> None: + """Test case for get_linear_teams_v1_linear_teams_get + + Get Linear Teams + """ + pass + + def test_get_linear_teams_v1_linear_teams_get_0(self) -> None: + """Test case for get_linear_teams_v1_linear_teams_get_0 + + Get Linear Teams + """ + pass + + def test_get_linear_teams_v1_linear_teams_get_1(self) -> None: + """Test case for get_linear_teams_v1_linear_teams_get_1 + + Get Linear Teams + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_no_repos_found_in_org_error_response.py b/test/test_no_repos_found_in_org_error_response.py new file mode 100644 index 0000000..573f36f --- /dev/null +++ b/test/test_no_repos_found_in_org_error_response.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from codegen_api_client.models.no_repos_found_in_org_error_response import NoReposFoundInOrgErrorResponse + +class TestNoReposFoundInOrgErrorResponse(unittest.TestCase): + """NoReposFoundInOrgErrorResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NoReposFoundInOrgErrorResponse: + """Test NoReposFoundInOrgErrorResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `NoReposFoundInOrgErrorResponse` + """ + model = NoReposFoundInOrgErrorResponse() + if include_optional: + return NoReposFoundInOrgErrorResponse( + message = 'No repos found in the organization. Please add some repos and try again.', + status_code = 56 + ) + else: + return NoReposFoundInOrgErrorResponse( + ) + """ + + def testNoReposFoundInOrgErrorResponse(self): + """Test NoReposFoundInOrgErrorResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_observation.py b/test/test_observation.py new file mode 100644 index 0000000..ad291c5 --- /dev/null +++ b/test/test_observation.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from codegen_api_client.models.observation import Observation + +class TestObservation(unittest.TestCase): + """Observation unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Observation: + """Test Observation + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Observation` + """ + model = Observation() + if include_optional: + return Observation( + ) + else: + return Observation( + ) + """ + + def testObservation(self): + """Test Observation""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_organization_integrations_response.py b/test/test_organization_integrations_response.py new file mode 100644 index 0000000..a1b8aec --- /dev/null +++ b/test/test_organization_integrations_response.py @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from codegen_api_client.models.organization_integrations_response import OrganizationIntegrationsResponse + +class TestOrganizationIntegrationsResponse(unittest.TestCase): + """OrganizationIntegrationsResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> OrganizationIntegrationsResponse: + """Test OrganizationIntegrationsResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `OrganizationIntegrationsResponse` + """ + model = OrganizationIntegrationsResponse() + if include_optional: + return OrganizationIntegrationsResponse( + organization_id = 56, + organization_name = '', + integrations = [ + codegen_api_client.models.integration_status.IntegrationStatus( + integration_type = '', + active = True, + token_id = 56, + installation_id = 56, + metadata = { }, ) + ], + total_active_integrations = 56 + ) + else: + return OrganizationIntegrationsResponse( + organization_id = 56, + organization_name = '', + integrations = [ + codegen_api_client.models.integration_status.IntegrationStatus( + integration_type = '', + active = True, + token_id = 56, + installation_id = 56, + metadata = { }, ) + ], + total_active_integrations = 56, + ) + """ + + def testOrganizationIntegrationsResponse(self): + """Test OrganizationIntegrationsResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_page_agent_run_response.py b/test/test_page_agent_run_response.py new file mode 100644 index 0000000..9def3f4 --- /dev/null +++ b/test/test_page_agent_run_response.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from codegen_api_client.models.page_agent_run_response import PageAgentRunResponse + +class TestPageAgentRunResponse(unittest.TestCase): + """PageAgentRunResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PageAgentRunResponse: + """Test PageAgentRunResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PageAgentRunResponse` + """ + model = PageAgentRunResponse() + if include_optional: + return PageAgentRunResponse( + items = [ + codegen_api_client.models.agent_run_response.AgentRunResponse( + id = 56, + organization_id = 56, + status = '', + created_at = '', + web_url = '', + result = '', + source_type = 'LOCAL', + github_pull_requests = [ + codegen_api_client.models.github_pull_request_response.GithubPullRequestResponse( + id = 56, + title = '', + url = '', + created_at = '', ) + ], + metadata = { }, ) + ], + total = 56, + page = 56, + size = 56, + pages = 56 + ) + else: + return PageAgentRunResponse( + items = [ + codegen_api_client.models.agent_run_response.AgentRunResponse( + id = 56, + organization_id = 56, + status = '', + created_at = '', + web_url = '', + result = '', + source_type = 'LOCAL', + github_pull_requests = [ + codegen_api_client.models.github_pull_request_response.GithubPullRequestResponse( + id = 56, + title = '', + url = '', + created_at = '', ) + ], + metadata = { }, ) + ], + total = 56, + page = 56, + size = 56, + pages = 56, + ) + """ + + def testPageAgentRunResponse(self): + """Test PageAgentRunResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_page_repo_response.py b/test/test_page_repo_response.py new file mode 100644 index 0000000..201a37c --- /dev/null +++ b/test/test_page_repo_response.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from codegen_api_client.models.page_repo_response import PageRepoResponse + +class TestPageRepoResponse(unittest.TestCase): + """PageRepoResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PageRepoResponse: + """Test PageRepoResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PageRepoResponse` + """ + model = PageRepoResponse() + if include_optional: + return PageRepoResponse( + items = [ + codegen_api_client.models.repo_response.RepoResponse( + id = 56, + name = '', + full_name = '', + description = '', + github_id = '', + organization_id = 56, + visibility = '', + archived = True, + setup_status = '', + language = '', ) + ], + total = 56, + page = 56, + size = 56, + pages = 56 + ) + else: + return PageRepoResponse( + items = [ + codegen_api_client.models.repo_response.RepoResponse( + id = 56, + name = '', + full_name = '', + description = '', + github_id = '', + organization_id = 56, + visibility = '', + archived = True, + setup_status = '', + language = '', ) + ], + total = 56, + page = 56, + size = 56, + pages = 56, + ) + """ + + def testPageRepoResponse(self): + """Test PageRepoResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_permissions_error_response.py b/test/test_permissions_error_response.py new file mode 100644 index 0000000..99308b3 --- /dev/null +++ b/test/test_permissions_error_response.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from codegen_api_client.models.permissions_error_response import PermissionsErrorResponse + +class TestPermissionsErrorResponse(unittest.TestCase): + """PermissionsErrorResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PermissionsErrorResponse: + """Test PermissionsErrorResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PermissionsErrorResponse` + """ + model = PermissionsErrorResponse() + if include_optional: + return PermissionsErrorResponse( + message = 'You do not have access to this organization.', + status_code = 56 + ) + else: + return PermissionsErrorResponse( + ) + """ + + def testPermissionsErrorResponse(self): + """Test PermissionsErrorResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_repo_response.py b/test/test_repo_response.py new file mode 100644 index 0000000..ee8bf51 --- /dev/null +++ b/test/test_repo_response.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from codegen_api_client.models.repo_response import RepoResponse + +class TestRepoResponse(unittest.TestCase): + """RepoResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RepoResponse: + """Test RepoResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RepoResponse` + """ + model = RepoResponse() + if include_optional: + return RepoResponse( + id = 56, + name = '', + full_name = '', + description = '', + github_id = '', + organization_id = 56, + visibility = '', + archived = True, + setup_status = '', + language = '' + ) + else: + return RepoResponse( + id = 56, + name = '', + full_name = '', + description = '', + github_id = '', + organization_id = 56, + visibility = '', + archived = True, + setup_status = '', + language = '', + ) + """ + + def testRepoResponse(self): + """Test RepoResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_repositories_api.py b/test/test_repositories_api.py new file mode 100644 index 0000000..60f1257 --- /dev/null +++ b/test/test_repositories_api.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from codegen_api_client.api.repositories_api import RepositoriesApi + + +class TestRepositoriesApi(unittest.TestCase): + """RepositoriesApi unit test stubs""" + + def setUp(self) -> None: + self.api = RepositoriesApi() + + def tearDown(self) -> None: + pass + + def test_get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get(self) -> None: + """Test case for get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get + + Get Check Suite Retry Stats + """ + pass + + def test_get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_0(self) -> None: + """Test case for get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_0 + + Get Check Suite Retry Stats + """ + pass + + def test_get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_1(self) -> None: + """Test case for get_check_suite_retry_stats_v1_organizations_org_id_repos_repo_id_check_suite_stats_get_1 + + Get Check Suite Retry Stats + """ + pass + + def test_get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get(self) -> None: + """Test case for get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get + + Get Check Suite Settings + """ + pass + + def test_get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_0(self) -> None: + """Test case for get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_0 + + Get Check Suite Settings + """ + pass + + def test_get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_1(self) -> None: + """Test case for get_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_get_1 + + Get Check Suite Settings + """ + pass + + def test_get_repositories_v1_organizations_org_id_repos_get(self) -> None: + """Test case for get_repositories_v1_organizations_org_id_repos_get + + Get Repositories + """ + pass + + def test_get_repositories_v1_organizations_org_id_repos_get_0(self) -> None: + """Test case for get_repositories_v1_organizations_org_id_repos_get_0 + + Get Repositories + """ + pass + + def test_get_repositories_v1_organizations_org_id_repos_get_1(self) -> None: + """Test case for get_repositories_v1_organizations_org_id_repos_get_1 + + Get Repositories + """ + pass + + def test_update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put(self) -> None: + """Test case for update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put + + Update Check Suite Settings + """ + pass + + def test_update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_0(self) -> None: + """Test case for update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_0 + + Update Check Suite Settings + """ + pass + + def test_update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_1(self) -> None: + """Test case for update_check_suite_settings_v1_organizations_org_id_repos_repo_id_check_suite_settings_put_1 + + Update Check Suite Settings + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_resume_agent_run_input.py b/test/test_resume_agent_run_input.py new file mode 100644 index 0000000..94e660a --- /dev/null +++ b/test/test_resume_agent_run_input.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from codegen_api_client.models.resume_agent_run_input import ResumeAgentRunInput + +class TestResumeAgentRunInput(unittest.TestCase): + """ResumeAgentRunInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ResumeAgentRunInput: + """Test ResumeAgentRunInput + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ResumeAgentRunInput` + """ + model = ResumeAgentRunInput() + if include_optional: + return ResumeAgentRunInput( + agent_run_id = 56, + prompt = '', + images = [ + '' + ] + ) + else: + return ResumeAgentRunInput( + agent_run_id = 56, + prompt = '', + ) + """ + + def testResumeAgentRunInput(self): + """Test ResumeAgentRunInput""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_stop_agent_run_input.py b/test/test_stop_agent_run_input.py new file mode 100644 index 0000000..f3d0a98 --- /dev/null +++ b/test/test_stop_agent_run_input.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from codegen_api_client.models.stop_agent_run_input import StopAgentRunInput + +class TestStopAgentRunInput(unittest.TestCase): + """StopAgentRunInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> StopAgentRunInput: + """Test StopAgentRunInput + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `StopAgentRunInput` + """ + model = StopAgentRunInput() + if include_optional: + return StopAgentRunInput( + agent_run_id = 56 + ) + else: + return StopAgentRunInput( + agent_run_id = 56, + ) + """ + + def testStopAgentRunInput(self): + """Test StopAgentRunInput""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_tool_execution_request.py b/test/test_tool_execution_request.py new file mode 100644 index 0000000..d6bf9af --- /dev/null +++ b/test/test_tool_execution_request.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from codegen_api_client.models.tool_execution_request import ToolExecutionRequest + +class TestToolExecutionRequest(unittest.TestCase): + """ToolExecutionRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ToolExecutionRequest: + """Test ToolExecutionRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ToolExecutionRequest` + """ + model = ToolExecutionRequest() + if include_optional: + return ToolExecutionRequest( + tool_name = '', + arguments = { }, + repo_id = 56 + ) + else: + return ToolExecutionRequest( + tool_name = '', + arguments = { }, + ) + """ + + def testToolExecutionRequest(self): + """Test ToolExecutionRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_tool_execution_response.py b/test/test_tool_execution_response.py new file mode 100644 index 0000000..fa33263 --- /dev/null +++ b/test/test_tool_execution_response.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from codegen_api_client.models.tool_execution_response import ToolExecutionResponse + +class TestToolExecutionResponse(unittest.TestCase): + """ToolExecutionResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ToolExecutionResponse: + """Test ToolExecutionResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ToolExecutionResponse` + """ + model = ToolExecutionResponse() + if include_optional: + return ToolExecutionResponse( + success = True, + result = None, + error = '', + tool_name = '', + execution_time_ms = 1.337 + ) + else: + return ToolExecutionResponse( + success = True, + tool_name = '', + ) + """ + + def testToolExecutionResponse(self): + """Test ToolExecutionResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_tools_api.py b/test/test_tools_api.py new file mode 100644 index 0000000..20fa157 --- /dev/null +++ b/test/test_tools_api.py @@ -0,0 +1,73 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from codegen_api_client.api.tools_api import ToolsApi + + +class TestToolsApi(unittest.TestCase): + """ToolsApi unit test stubs""" + + def setUp(self) -> None: + self.api = ToolsApi() + + def tearDown(self) -> None: + pass + + def test_execute_tool_v1_organizations_org_id_tools_execute_post(self) -> None: + """Test case for execute_tool_v1_organizations_org_id_tools_execute_post + + Execute Tool + """ + pass + + def test_execute_tool_v1_organizations_org_id_tools_execute_post_0(self) -> None: + """Test case for execute_tool_v1_organizations_org_id_tools_execute_post_0 + + Execute Tool + """ + pass + + def test_execute_tool_v1_organizations_org_id_tools_execute_post_1(self) -> None: + """Test case for execute_tool_v1_organizations_org_id_tools_execute_post_1 + + Execute Tool + """ + pass + + def test_get_available_tools_v1_organizations_org_id_tools_get(self) -> None: + """Test case for get_available_tools_v1_organizations_org_id_tools_get + + Get Available Tools + """ + pass + + def test_get_available_tools_v1_organizations_org_id_tools_get_0(self) -> None: + """Test case for get_available_tools_v1_organizations_org_id_tools_get_0 + + Get Available Tools + """ + pass + + def test_get_available_tools_v1_organizations_org_id_tools_get_1(self) -> None: + """Test case for get_available_tools_v1_organizations_org_id_tools_get_1 + + Get Available Tools + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_update_check_suite_settings_request.py b/test/test_update_check_suite_settings_request.py new file mode 100644 index 0000000..3bd8e79 --- /dev/null +++ b/test/test_update_check_suite_settings_request.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from codegen_api_client.models.update_check_suite_settings_request import UpdateCheckSuiteSettingsRequest + +class TestUpdateCheckSuiteSettingsRequest(unittest.TestCase): + """UpdateCheckSuiteSettingsRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateCheckSuiteSettingsRequest: + """Test UpdateCheckSuiteSettingsRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpdateCheckSuiteSettingsRequest` + """ + model = UpdateCheckSuiteSettingsRequest() + if include_optional: + return UpdateCheckSuiteSettingsRequest( + retry_count = 0.0, + ignored_checks = [ + '' + ] + ) + else: + return UpdateCheckSuiteSettingsRequest( + ) + """ + + def testUpdateCheckSuiteSettingsRequest(self): + """Test UpdateCheckSuiteSettingsRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_user_not_found_error_response.py b/test/test_user_not_found_error_response.py new file mode 100644 index 0000000..659c960 --- /dev/null +++ b/test/test_user_not_found_error_response.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Developer API + + API for application developers + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from codegen_api_client.models.user_not_found_error_response import UserNotFoundErrorResponse + +class TestUserNotFoundErrorResponse(unittest.TestCase): + """UserNotFoundErrorResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UserNotFoundErrorResponse: + """Test UserNotFoundErrorResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UserNotFoundErrorResponse` + """ + model = UserNotFoundErrorResponse() + if include_optional: + return UserNotFoundErrorResponse( + message = 'User not found.', + status_code = 56 + ) + else: + return UserNotFoundErrorResponse( + ) + """ + + def testUserNotFoundErrorResponse(self): + """Test UserNotFoundErrorResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() From b92b147b96113c0e95d4c1c9e134c769262e45ef Mon Sep 17 00:00:00 2001 From: "codegen-sh[bot]" <131295404+codegen-sh[bot]@users.noreply.github.com> Date: Sun, 17 Aug 2025 22:17:21 +0000 Subject: [PATCH 3/4] Restore UV package manager in GitHub workflow Co-authored-by: Jay Hack --- .github/workflows/python.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index b10c406..b82f56d 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -5,7 +5,13 @@ name: codegen_api_client Python package -on: [push, pull_request] +on: + push: + branches: + - develop + pull_request: + branches: + - develop jobs: build: @@ -17,15 +23,12 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + - name: Set up UV ${{ matrix.python-version }} + uses: astral-sh/setup-uv@v5 with: + enable-cache: true python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - pip install -r test-requirements.txt - name: Test with pytest run: | - pytest --cov=codegen_api_client + uv run pytest --cov=codegen_api_client + From 82c9fd18107fc88a7685f168fd685bea1425862a Mon Sep 17 00:00:00 2001 From: "codegen-sh[bot]" <131295404+codegen-sh[bot]@users.noreply.github.com> Date: Sun, 17 Aug 2025 22:20:23 +0000 Subject: [PATCH 4/4] Fix build configuration for GitHub Actions workflow - Add [project] table to pyproject.toml for setuptools compatibility - Add pytest and pytest-cov to requirements.txt - Add pytest.ini configuration file Co-authored-by: Jay Hack --- pyproject.toml | 19 ++++++++++++++++++- pytest.ini | 4 ++++ requirements.txt | 2 ++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 pytest.ini diff --git a/pyproject.toml b/pyproject.toml index 5113d7f..94d9565 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,9 +27,26 @@ mypy = ">= 1.5" [build-system] -requires = ["setuptools"] +requires = ["setuptools>=61.0"] build-backend = "setuptools.build_meta" +[project] +name = "codegen_api_client" +version = "1.0.0" +description = "Developer API" +authors = [ + {name = "OpenAPI Generator Community", email = "team@openapitools.org"} +] +license = {text = "NoLicense"} +readme = "README.md" +requires-python = ">=3.8" +dependencies = [ + "urllib3 >= 1.25.3, < 3.0.0", + "python-dateutil >= 2.8.2", + "pydantic >= 2", + "typing-extensions >= 4.7.1" +] + [tool.pylint.'MESSAGES CONTROL'] extension-pkg-whitelist = "pydantic" diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..eb09cdf --- /dev/null +++ b/pytest.ini @@ -0,0 +1,4 @@ +[pytest] +testpaths = test +python_files = test_*.py + diff --git a/requirements.txt b/requirements.txt index 67f7f68..db09e84 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,5 @@ urllib3 >= 1.25.3, < 3.0.0 python_dateutil >= 2.8.2 pydantic >= 2 typing-extensions >= 4.7.1 +pytest >= 7.2.1 +pytest-cov >= 2.8.1