Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cirro_api_client/cirro_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ class CirroApiClient(Client):
raise_on_unexpected_status: bool = field(default=True, kw_only=True)
client_name: str = field(kw_only=True, default="Cirro API Client")
package_name: str = field(kw_only=True, default="cirro-api-client")
user_agent: str = field(init=False, default=None)

def __attrs_post_init__(self):
self._headers["User-Agent"] = _get_user_agent(self.package_name, self.client_name)
self.user_agent = _get_user_agent(self.package_name, self.client_name)
self._headers["User-Agent"] = self.user_agent
79 changes: 0 additions & 79 deletions cirro_api_client/v1/api/billing/generate_billing_report.py

This file was deleted.

46 changes: 41 additions & 5 deletions cirro_api_client/v1/api/governance/get_requirements.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional
from typing import Any, Dict, List, Optional, Union

import httpx

from ... import errors
from ...client import Client
from ...models.governance_requirement import GovernanceRequirement
from ...types import Response
from ...types import UNSET, Response, Unset


def _get_kwargs() -> Dict[str, Any]:
def _get_kwargs(
*,
project_id: Union[Unset, str] = UNSET,
) -> Dict[str, Any]:
params: Dict[str, Any] = {}

params["projectId"] = project_id

params = {k: v for k, v in params.items() if v is not UNSET and v is not None}

_kwargs: Dict[str, Any] = {
"method": "get",
"url": "/governance/requirements",
"params": params,
}

return _kwargs
Expand Down Expand Up @@ -44,11 +54,16 @@ def _build_response(*, client: Client, response: httpx.Response) -> Response[Lis
def sync_detailed(
*,
client: Client,
project_id: Union[Unset, str] = UNSET,
) -> Response[List["GovernanceRequirement"]]:
"""Get requirements

Retrieve a list of governance requirements

Args:
project_id (Union[Unset, str]):
client (Client): instance of the API client

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.
Expand All @@ -57,7 +72,9 @@ def sync_detailed(
Response[List['GovernanceRequirement']]
"""

kwargs = _get_kwargs()
kwargs = _get_kwargs(
project_id=project_id,
)

response = client.get_httpx_client().request(
auth=client.get_auth(),
Expand All @@ -70,11 +87,16 @@ def sync_detailed(
def sync(
*,
client: Client,
project_id: Union[Unset, str] = UNSET,
) -> Optional[List["GovernanceRequirement"]]:
"""Get requirements

Retrieve a list of governance requirements

Args:
project_id (Union[Unset, str]):
client (Client): instance of the API client

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.
Expand All @@ -86,6 +108,7 @@ def sync(
try:
return sync_detailed(
client=client,
project_id=project_id,
).parsed
except errors.NotFoundException:
return None
Expand All @@ -94,11 +117,16 @@ def sync(
async def asyncio_detailed(
*,
client: Client,
project_id: Union[Unset, str] = UNSET,
) -> Response[List["GovernanceRequirement"]]:
"""Get requirements

Retrieve a list of governance requirements

Args:
project_id (Union[Unset, str]):
client (Client): instance of the API client

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.
Expand All @@ -107,7 +135,9 @@ async def asyncio_detailed(
Response[List['GovernanceRequirement']]
"""

kwargs = _get_kwargs()
kwargs = _get_kwargs(
project_id=project_id,
)

response = await client.get_async_httpx_client().request(auth=client.get_auth(), **kwargs)

Expand All @@ -117,11 +147,16 @@ async def asyncio_detailed(
async def asyncio(
*,
client: Client,
project_id: Union[Unset, str] = UNSET,
) -> Optional[List["GovernanceRequirement"]]:
"""Get requirements

Retrieve a list of governance requirements

Args:
project_id (Union[Unset, str]):
client (Client): instance of the API client

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.
Expand All @@ -134,6 +169,7 @@ async def asyncio(
return (
await asyncio_detailed(
client=client,
project_id=project_id,
)
).parsed
except errors.NotFoundException:
Expand Down
Loading