From 4ef84770f6006daf774274d5d2c07fa570081699 Mon Sep 17 00:00:00 2001 From: nuonbot Date: Fri, 7 Aug 2026 14:12:12 +0000 Subject: [PATCH] ci: generate from api 0.19.1111 --- nuon/api/slack/create_slack_org_link.py | 218 ------------------ nuon/models/__init__.py | 2 - .../models/service_create_org_link_request.py | 61 ----- pyproject.toml | 2 +- version.txt | 2 +- 5 files changed, 2 insertions(+), 283 deletions(-) delete mode 100644 nuon/api/slack/create_slack_org_link.py delete mode 100644 nuon/models/service_create_org_link_request.py diff --git a/nuon/api/slack/create_slack_org_link.py b/nuon/api/slack/create_slack_org_link.py deleted file mode 100644 index 8d0405af..00000000 --- a/nuon/api/slack/create_slack_org_link.py +++ /dev/null @@ -1,218 +0,0 @@ -from http import HTTPStatus -from typing import Any -from urllib.parse import quote - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.app_slack_org_link import AppSlackOrgLink -from ...models.service_create_org_link_request import ServiceCreateOrgLinkRequest -from ...models.stderr_err_response import StderrErrResponse -from ...types import Response - - -def _get_kwargs( - org_id: str, - *, - body: ServiceCreateOrgLinkRequest, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/v1/orgs/{org_id}/slack/org-links".format( - org_id=quote(str(org_id), safe=""), - ), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AppSlackOrgLink | StderrErrResponse | None: - if response.status_code == 201: - response_201 = AppSlackOrgLink.from_dict(response.json()) - - return response_201 - - if response.status_code == 400: - response_400 = StderrErrResponse.from_dict(response.json()) - - return response_400 - - if response.status_code == 401: - response_401 = StderrErrResponse.from_dict(response.json()) - - return response_401 - - if response.status_code == 404: - response_404 = StderrErrResponse.from_dict(response.json()) - - return response_404 - - if response.status_code == 409: - response_409 = StderrErrResponse.from_dict(response.json()) - - return response_409 - - if response.status_code == 500: - response_500 = StderrErrResponse.from_dict(response.json()) - - return response_500 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AppSlackOrgLink | StderrErrResponse]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - org_id: str, - *, - client: AuthenticatedClient, - body: ServiceCreateOrgLinkRequest, -) -> Response[AppSlackOrgLink | StderrErrResponse]: - """Bind a Slack workspace to the current org - - Creates a verified SlackOrgLink between the supplied TeamID and the calling org. Used by the Phase 4 - confirmation flow when a user finishes the Slack OAuth round-trip and selects the Nuon org to attach - the workspace to. - - Args: - org_id (str): - body (ServiceCreateOrgLinkRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[AppSlackOrgLink | StderrErrResponse] - """ - - kwargs = _get_kwargs( - org_id=org_id, - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - org_id: str, - *, - client: AuthenticatedClient, - body: ServiceCreateOrgLinkRequest, -) -> AppSlackOrgLink | StderrErrResponse | None: - """Bind a Slack workspace to the current org - - Creates a verified SlackOrgLink between the supplied TeamID and the calling org. Used by the Phase 4 - confirmation flow when a user finishes the Slack OAuth round-trip and selects the Nuon org to attach - the workspace to. - - Args: - org_id (str): - body (ServiceCreateOrgLinkRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - AppSlackOrgLink | StderrErrResponse - """ - - return sync_detailed( - org_id=org_id, - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - org_id: str, - *, - client: AuthenticatedClient, - body: ServiceCreateOrgLinkRequest, -) -> Response[AppSlackOrgLink | StderrErrResponse]: - """Bind a Slack workspace to the current org - - Creates a verified SlackOrgLink between the supplied TeamID and the calling org. Used by the Phase 4 - confirmation flow when a user finishes the Slack OAuth round-trip and selects the Nuon org to attach - the workspace to. - - Args: - org_id (str): - body (ServiceCreateOrgLinkRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[AppSlackOrgLink | StderrErrResponse] - """ - - kwargs = _get_kwargs( - org_id=org_id, - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - org_id: str, - *, - client: AuthenticatedClient, - body: ServiceCreateOrgLinkRequest, -) -> AppSlackOrgLink | StderrErrResponse | None: - """Bind a Slack workspace to the current org - - Creates a verified SlackOrgLink between the supplied TeamID and the calling org. Used by the Phase 4 - confirmation flow when a user finishes the Slack OAuth round-trip and selects the Nuon org to attach - the workspace to. - - Args: - org_id (str): - body (ServiceCreateOrgLinkRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - AppSlackOrgLink | StderrErrResponse - """ - - return ( - await asyncio_detailed( - org_id=org_id, - client=client, - body=body, - ) - ).parsed diff --git a/nuon/models/__init__.py b/nuon/models/__init__.py index f8e4a508..3c020fa7 100644 --- a/nuon/models/__init__.py +++ b/nuon/models/__init__.py @@ -590,7 +590,6 @@ ServiceCreateOIDCTrustPolicyRequestClaimConditions, ) from .service_create_org_invite_request import ServiceCreateOrgInviteRequest -from .service_create_org_link_request import ServiceCreateOrgLinkRequest from .service_create_org_request import ServiceCreateOrgRequest from .service_create_org_user_request import ServiceCreateOrgUserRequest from .service_create_pulumi_component_config_request import ServiceCreatePulumiComponentConfigRequest @@ -1363,7 +1362,6 @@ "ServiceCreateOIDCTrustPolicyRequest", "ServiceCreateOIDCTrustPolicyRequestClaimConditions", "ServiceCreateOrgInviteRequest", - "ServiceCreateOrgLinkRequest", "ServiceCreateOrgRequest", "ServiceCreateOrgUserRequest", "ServiceCreatePulumiComponentConfigRequest", diff --git a/nuon/models/service_create_org_link_request.py b/nuon/models/service_create_org_link_request.py deleted file mode 100644 index 5add2542..00000000 --- a/nuon/models/service_create_org_link_request.py +++ /dev/null @@ -1,61 +0,0 @@ -from __future__ import annotations - -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="ServiceCreateOrgLinkRequest") - - -@_attrs_define -class ServiceCreateOrgLinkRequest: - """ - Attributes: - team_id (str): - """ - - team_id: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - team_id = self.team_id - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "team_id": team_id, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - team_id = d.pop("team_id") - - service_create_org_link_request = cls( - team_id=team_id, - ) - - service_create_org_link_request.additional_properties = d - return service_create_org_link_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/pyproject.toml b/pyproject.toml index 5a715893..24e25f70 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "nuon" -version = "0.19.1109" +version = "0.19.1111" description = "A client library for accessing Nuon" authors = [] requires-python = ">=3.11" diff --git a/version.txt b/version.txt index 31c6f77a..120cecc7 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.19.1109 +0.19.1111