Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: 0.2.0 #59

Merged
merged 4 commits into from
Nov 7, 2024
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
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.1"
".": "0.2.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 7
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/riza%2Friza-api-f91a367833f80d00c3ed5214e143b684b5d2c37ed98c4910f21b56db21bf3a28.yml
configured_endpoints: 8
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/riza%2Friza-api-6a6ef20cc3e9d270a1ddd031d63f754cfec74c877c184161a7996249a5cffae6.yml
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 0.2.0 (2024-11-07)

Full Changelog: [v0.1.1...v0.2.0](https://github.com/riza-io/riza-api-python/compare/v0.1.1...v0.2.0)

### Features

* **api:** api update ([#58](https://github.com/riza-io/riza-api-python/issues/58)) ([688cb10](https://github.com/riza-io/riza-api-python/commit/688cb109640323f2608fb996ff82129d334f225d))
* **api:** api update ([#61](https://github.com/riza-io/riza-api-python/issues/61)) ([7c8f2ee](https://github.com/riza-io/riza-api-python/commit/7c8f2ee4c54ebc950a559c76becc982519a03e53))
* **api:** manual updates ([#60](https://github.com/riza-io/riza-api-python/issues/60)) ([3b818f9](https://github.com/riza-io/riza-api-python/commit/3b818f95469ee73b5a80bda1cf127b71eecf90ce))

## 0.1.1 (2024-11-06)

Full Changelog: [v0.1.0-alpha.10...v0.1.1](https://github.com/riza-io/riza-api-python/compare/v0.1.0-alpha.10...v0.1.1)
Expand Down
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ client = Riza(
)

response = client.command.exec(
code='print("Hello world!")',
code="print('Hello, World!')",
language="python",
)
print(response.exit_code)
```
Expand All @@ -60,7 +61,8 @@ client = AsyncRiza(

async def main() -> None:
response = await client.command.exec(
code='print("Hello world!")',
code="print('Hello, World!')",
language="python",
)
print(response.exit_code)

Expand Down Expand Up @@ -96,7 +98,8 @@ client = Riza()

try:
client.command.exec(
code='print("Hello world!")',
code="print('Hello, World!')",
language="python",
)
except rizaio.APIConnectionError as e:
print("The server could not be reached")
Expand Down Expand Up @@ -141,7 +144,8 @@ client = Riza(

# Or, configure per-request:
client.with_options(max_retries=5).command.exec(
code='print("Hello world!")',
code="print('Hello, World!')",
language="python",
)
```

Expand All @@ -166,7 +170,8 @@ client = Riza(

# Override per-request:
client.with_options(timeout=5.0).command.exec(
code='print("Hello world!")',
code="print('Hello, World!')",
language="python",
)
```

Expand Down Expand Up @@ -207,7 +212,8 @@ from rizaio import Riza

client = Riza()
response = client.command.with_raw_response.exec(
code="print(\"Hello world!\")",
code="print('Hello, World!')",
language="python",
)
print(response.headers.get('X-My-Header'))

Expand All @@ -227,7 +233,8 @@ To stream the response body, use `.with_streaming_response` instead, which requi

```python
with client.command.with_streaming_response.exec(
code='print("Hello world!")',
code="print('Hello, World!')",
language="python",
) as response:
print(response.headers.get("X-My-Header"))

Expand Down
1 change: 1 addition & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ from rizaio.types import Secret, SecretListResponse

Methods:

- <code title="post /v1/secrets">client.secrets.<a href="./src/rizaio/resources/secrets.py">create</a>(\*\*<a href="src/rizaio/types/secret_create_params.py">params</a>) -> <a href="./src/rizaio/types/secret.py">Secret</a></code>
- <code title="get /v1/secrets">client.secrets.<a href="./src/rizaio/resources/secrets.py">list</a>() -> <a href="./src/rizaio/types/secret_list_response.py">SecretListResponse</a></code>

# Tools
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "rizaio"
version = "0.1.1"
version = "0.2.0"
description = "The official Python library for the riza API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/rizaio/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "rizaio"
__version__ = "0.1.1" # x-release-please-version
__version__ = "0.2.0" # x-release-please-version
98 changes: 98 additions & 0 deletions src/rizaio/resources/secrets.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@

import httpx

from ..types import secret_create_params
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._utils import (
maybe_transform,
async_maybe_transform,
)
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
Expand All @@ -14,6 +19,7 @@
async_to_streamed_response_wrapper,
)
from .._base_client import make_request_options
from ..types.secret import Secret
from ..types.secret_list_response import SecretListResponse

__all__ = ["SecretsResource", "AsyncSecretsResource"]
Expand All @@ -39,6 +45,45 @@ def with_streaming_response(self) -> SecretsResourceWithStreamingResponse:
"""
return SecretsResourceWithStreamingResponse(self)

def create(
self,
*,
name: str,
value: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Secret:
"""
Create a secret in your project.

Args:
extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return self._post(
"/v1/secrets",
body=maybe_transform(
{
"name": name,
"value": value,
},
secret_create_params.SecretCreateParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=Secret,
)

def list(
self,
*,
Expand All @@ -49,6 +94,7 @@ def list(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SecretListResponse:
"""Returns a list of secrets in your project."""
return self._get(
"/v1/secrets",
options=make_request_options(
Expand Down Expand Up @@ -78,6 +124,45 @@ def with_streaming_response(self) -> AsyncSecretsResourceWithStreamingResponse:
"""
return AsyncSecretsResourceWithStreamingResponse(self)

async def create(
self,
*,
name: str,
value: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Secret:
"""
Create a secret in your project.

Args:
extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return await self._post(
"/v1/secrets",
body=await async_maybe_transform(
{
"name": name,
"value": value,
},
secret_create_params.SecretCreateParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=Secret,
)

async def list(
self,
*,
Expand All @@ -88,6 +173,7 @@ async def list(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SecretListResponse:
"""Returns a list of secrets in your project."""
return await self._get(
"/v1/secrets",
options=make_request_options(
Expand All @@ -101,6 +187,9 @@ class SecretsResourceWithRawResponse:
def __init__(self, secrets: SecretsResource) -> None:
self._secrets = secrets

self.create = to_raw_response_wrapper(
secrets.create,
)
self.list = to_raw_response_wrapper(
secrets.list,
)
Expand All @@ -110,6 +199,9 @@ class AsyncSecretsResourceWithRawResponse:
def __init__(self, secrets: AsyncSecretsResource) -> None:
self._secrets = secrets

self.create = async_to_raw_response_wrapper(
secrets.create,
)
self.list = async_to_raw_response_wrapper(
secrets.list,
)
Expand All @@ -119,6 +211,9 @@ class SecretsResourceWithStreamingResponse:
def __init__(self, secrets: SecretsResource) -> None:
self._secrets = secrets

self.create = to_streamed_response_wrapper(
secrets.create,
)
self.list = to_streamed_response_wrapper(
secrets.list,
)
Expand All @@ -128,6 +223,9 @@ class AsyncSecretsResourceWithStreamingResponse:
def __init__(self, secrets: AsyncSecretsResource) -> None:
self._secrets = secrets

self.create = async_to_streamed_response_wrapper(
secrets.create,
)
self.list = async_to_streamed_response_wrapper(
secrets.list,
)
26 changes: 24 additions & 2 deletions src/rizaio/resources/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ def create(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Tool:
"""
Create a tool in your project.

Args:
extra_headers: Send extra headers

Expand Down Expand Up @@ -109,6 +111,8 @@ def update(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Tool:
"""
Update the source code and input schema of a tool.

Args:
extra_headers: Send extra headers

Expand Down Expand Up @@ -148,6 +152,7 @@ def list(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ToolListResponse:
"""Returns a list of tools in your project."""
return self._get(
"/v1/tools",
options=make_request_options(
Expand All @@ -171,7 +176,11 @@ def exec(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ToolExecResponse:
"""
"""Execute a tool with a given input.

The input is validated against the tool's
input schema.

Args:
extra_headers: Send extra headers

Expand Down Expand Up @@ -212,6 +221,8 @@ def get(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Tool:
"""
Retrieves a tool.

Args:
extra_headers: Send extra headers

Expand Down Expand Up @@ -268,6 +279,8 @@ async def create(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Tool:
"""
Create a tool in your project.

Args:
extra_headers: Send extra headers

Expand Down Expand Up @@ -312,6 +325,8 @@ async def update(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Tool:
"""
Update the source code and input schema of a tool.

Args:
extra_headers: Send extra headers

Expand Down Expand Up @@ -351,6 +366,7 @@ async def list(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ToolListResponse:
"""Returns a list of tools in your project."""
return await self._get(
"/v1/tools",
options=make_request_options(
Expand All @@ -374,7 +390,11 @@ async def exec(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ToolExecResponse:
"""
"""Execute a tool with a given input.

The input is validated against the tool's
input schema.

Args:
extra_headers: Send extra headers

Expand Down Expand Up @@ -415,6 +435,8 @@ async def get(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Tool:
"""
Retrieves a tool.

Args:
extra_headers: Send extra headers

Expand Down
1 change: 1 addition & 0 deletions src/rizaio/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
from .tool_list_response import ToolListResponse as ToolListResponse
from .tool_update_params import ToolUpdateParams as ToolUpdateParams
from .command_exec_params import CommandExecParams as CommandExecParams
from .secret_create_params import SecretCreateParams as SecretCreateParams
from .secret_list_response import SecretListResponse as SecretListResponse
from .command_exec_response import CommandExecResponse as CommandExecResponse
Loading