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

chore: regenerate REGISTRY (sdk) 🔁 #14

Merged
merged 1 commit into from
Apr 12, 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
4 changes: 2 additions & 2 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
LICENSE.txt
Makefile
README.md
docs/AboutApi.md
docs/ActiveEventData.md
docs/ActiveEventSSE.md
docs/ActiveEventSSEEvent.md
Expand Down Expand Up @@ -50,7 +51,6 @@ docs/CreateFunctionQueryV2.md
docs/CreateKFServingAsyncResponse.md
docs/CreatePlugAsyncResponse.md
docs/CreateWebscriptAsyncResponse.md
docs/DefaultApi.md
docs/DelayedEventData.md
docs/DelayedEventSSE.md
docs/DelayedEventSSEEvent.md
Expand Down Expand Up @@ -405,7 +405,7 @@ pyproject.toml
requirements.txt
test/__init__.py
test/api/__init__.py
test/api/default_api_test.py
test/api/about_api_test.py
test/api/jobs_api_test.py
test/api/model_functions_api_test.py
test/api/plug_functions_api_test.py
Expand Down
20 changes: 7 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,16 @@ from waylay.sdk.api.api_exceptions import ApiError
waylay_client = WaylayClient.from_profile()

# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-registry-types` is installed
from waylay.services.registry.models.function_type import FunctionType
from waylay.services.registry.models.job_state_result import JobStateResult
from waylay.services.registry.models.job_type_schema import JobTypeSchema
from waylay.services.registry.models.jobs_response import JobsResponse
from waylay.services.registry.models.root_page_response import RootPageResponse
try:
# List Jobs
# calls `GET /registry/v2/jobs/`
api_response = await waylay_client.registry.jobs.list(
# query parameters:
query = {
},
# Get Service Status
# calls `GET /registry/v2/`
api_response = await waylay_client.registry.about.get(
)
print("The response of registry.jobs.list:\n")
print("The response of registry.about.get:\n")
pprint(api_response)
except ApiError as e:
print("Exception when calling registry.jobs.list: %s\n" % e)
print("Exception when calling registry.about.get: %s\n" % e)
```


Expand All @@ -61,6 +55,7 @@ All URIs are relative to *https://api.waylay.io*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AboutApi* | [**get**](docs/AboutApi.md#get) | **GET** /registry/v2/ | Get Service Status
*JobsApi* | [**events**](docs/JobsApi.md#events) | **GET** /registry/v2/jobs/events | Stream Events
*JobsApi* | [**get**](docs/JobsApi.md#get) | **GET** /registry/v2/jobs/{type}/{id} | Get Job
*JobsApi* | [**list**](docs/JobsApi.md#list) | **GET** /registry/v2/jobs/ | List Jobs
Expand Down Expand Up @@ -124,7 +119,6 @@ Class | Method | HTTP request | Description
*WebscriptFunctionsApi* | [**update_asset**](docs/WebscriptFunctionsApi.md#update_asset) | **PUT** /registry/v2/webscripts/{name}/versions/{version}/content/{wildcard} | Update Webscript Asset
*WebscriptFunctionsApi* | [**update_assets**](docs/WebscriptFunctionsApi.md#update_assets) | **PUT** /registry/v2/webscripts/{name}/versions/{version}/content | Update Webscript Assets
*WebscriptFunctionsApi* | [**verify**](docs/WebscriptFunctionsApi.md#verify) | **POST** /registry/v2/webscripts/{name}/versions/{version}/verify | Verify Health Of Webscript
*DefaultApi* | [**get**](docs/DefaultApi.md#get) | **GET** /registry/v2/ | Version


## Documentation For Models
Expand Down
16 changes: 8 additions & 8 deletions docs/DefaultApi.md → docs/AboutApi.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# waylay.services.registry.DefaultApi
# waylay.services.registry.AboutApi

All URIs are relative to *https://api.waylay.io*

Method | HTTP request | Description
------------- | ------------- | -------------
[**get**](DefaultApi.md#get) | **GET** /registry/v2/ | Version
[**get**](AboutApi.md#get) | **GET** /registry/v2/ | Get Service Status

# **get**
> get(
> headers
> ) -> RootPageResponse

Version
Get Service Status

Get the version of this function registry deployment.
Get the status and version of the function registry service.

### Example

Expand All @@ -30,14 +30,14 @@ waylay_client = WaylayClient.from_profile()
# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-registry-types` is installed
from waylay.services.registry.models.root_page_response import RootPageResponse
try:
# Version
# Get Service Status
# calls `GET /registry/v2/`
api_response = await waylay_client.registry.default.get(
api_response = await waylay_client.registry.about.get(
)
print("The response of registry.default.get:\n")
print("The response of registry.about.get:\n")
pprint(api_response)
except ApiError as e:
print("Exception when calling registry.default.get: %s\n" % e)
print("Exception when calling registry.about.get: %s\n" % e)
```

### Endpoint
Expand Down
4 changes: 2 additions & 2 deletions docs/JobsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Method | HTTP request | Description
> events(
> query: EventsQuery,
> headers
> ) -> EventWithCloseSSE
> ) -> AsyncIterator[EventWithCloseSSE]

Stream Events

Expand Down Expand Up @@ -67,7 +67,7 @@ Name | Type | API binding | Description | Notes

Selected path param | Raw response param | Return Type | Description | Links
------------------- | ------------------ | ------------ | ----------- | -----
Literal[""] _(default)_ | False _(default)_ | **`EventWithCloseSSE`** | | [EventWithCloseSSE](EventWithCloseSSE.md)
Literal[""] _(default)_ | False _(default)_ | **`AsyncIterator[EventWithCloseSSE]`** | | [EventWithCloseSSE](EventWithCloseSSE.md)
str | False _(default)_ | **`Any`** | If any other string value for the selected path is provided, the exact type of the response will only be known at runtime. |
/ | True | `Response` | The raw http response object.

Expand Down
8 changes: 5 additions & 3 deletions openapi/registry.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8476,8 +8476,11 @@ components:
paths:
/registry/v2/:
get:
summary: Version
description: Get the version of this function registry deployment.
operationId: get_about
summary: Get Service Status
tags:
- About
description: Get the status and version of the function registry service.
x-version: v2
responses:
default:
Expand All @@ -8486,7 +8489,6 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/IRootPageResponse'
operationId: get_registry_v2
security: &id001
- waylayApiKeySecret: []
/registry/v2/jobs/:
Expand Down
10 changes: 7 additions & 3 deletions openapi/registry.transformed.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8856,8 +8856,11 @@ components:
paths:
/registry/v2/:
get:
summary: Version
description: Get the version of this function registry deployment.
operationId: get_about
summary: Get Service Status
tags:
- About
description: Get the status and version of the function registry service.
x-version: v2
responses:
default:
Expand All @@ -8866,7 +8869,6 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/RootPageResponse'
operationId: get_registry_v2
security:
- waylayApiKeySecret: []
x-py-method: get
Expand Down Expand Up @@ -9030,13 +9032,15 @@ paths:
text/eventstream:
schema:
$ref: '#/components/schemas/EventWithCloseSSE'
x-is-event-stream: true
security:
- waylayApiKeySecret: []
x-py-method: events
x-consumes-multipart: false
x-consumes-urlencoded: false
x-consumes-json: false
x-consumes-other: false
x-produces-event-stream: true
/registry/v2/runtimes/:
get:
operationId: list_runtimes
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pydantic ~= 2.6
typing-extensions ~= 4.9
waylay-sdk-core ~= 0.1.0
waylay-sdk-core@git+https://github.com/waylayio/waylay-sdk-py@cc464ef9ee120bc54ff6381add0c92a2d06e2944
18 changes: 9 additions & 9 deletions test/api/default_api_test.py → test/api/about_api_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from typeguard import check_type
from waylay.sdk import ApiClient, WaylayClient
from waylay.sdk.api._models import Model
from waylay.services.registry.api import DefaultApi
from waylay.services.registry.api import AboutApi
from waylay.services.registry.service import RegistryService

from ..types.root_page_response_stub import RootPageResponseStub
Expand All @@ -36,13 +36,13 @@


@pytest.fixture
def default_api(waylay_api_client: ApiClient) -> DefaultApi:
return DefaultApi(waylay_api_client)
def about_api(waylay_api_client: ApiClient) -> AboutApi:
return AboutApi(waylay_api_client)


def test_registered(waylay_client: WaylayClient):
"""Test that DefaultApi api is registered in the sdk client."""
assert isinstance(waylay_client.registry.default, DefaultApi)
"""Test that AboutApi api is registered in the sdk client."""
assert isinstance(waylay_client.registry.about, AboutApi)


def _get_set_mock_response(httpx_mock: HTTPXMock, gateway_url: str):
Expand All @@ -60,12 +60,12 @@ def _get_set_mock_response(httpx_mock: HTTPXMock, gateway_url: str):
@pytest.mark.skipif(not MODELS_AVAILABLE, reason="Types not installed.")
async def test_get(service: RegistryService, gateway_url: str, httpx_mock: HTTPXMock):
"""Test case for get
Version
Get Service Status
"""
# set path params
kwargs = {}
_get_set_mock_response(httpx_mock, gateway_url)
resp = await service.default.get(**kwargs)
resp = await service.about.get(**kwargs)
check_type(resp, Union[RootPageResponse,])


Expand All @@ -75,10 +75,10 @@ async def test_get_without_types(
service: RegistryService, gateway_url: str, httpx_mock: HTTPXMock
):
"""Test case for get with models not installed
Version
Get Service Status
"""
# set path params
kwargs = {}
_get_set_mock_response(httpx_mock, gateway_url)
resp = await service.default.get(**kwargs)
resp = await service.about.get(**kwargs)
check_type(resp, Model)
13 changes: 10 additions & 3 deletions test/api/jobs_api_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import json
import re
from importlib.util import find_spec
from typing import Union
from typing import AsyncIterator, Union, get_args
from urllib.parse import quote

import pytest
Expand Down Expand Up @@ -59,8 +59,9 @@ def _events_set_mock_response(httpx_mock: HTTPXMock, gateway_url: str):
httpx_mock_kwargs = {
"method": "GET",
"url": re.compile(f"^{gateway_url}/registry/v2/jobs/events(\\?.*)?"),
"content": json.dumps(mock_response, default=str),
"content": json.dumps(mock_response, default=str) + "\n",
"status_code": 200,
"headers": {"content-type": "application/x-ndjson"},
}
httpx_mock.add_response(**httpx_mock_kwargs)

Expand All @@ -84,7 +85,10 @@ async def test_events(
}
_events_set_mock_response(httpx_mock, gateway_url)
resp = await service.jobs.events(**kwargs)
check_type(resp, Union[EventWithCloseSSE,])
check_type(resp, Union[AsyncIterator[EventWithCloseSSE],])
async for item in resp:
check_type(item, get_args(Union[AsyncIterator[EventWithCloseSSE],])[0])
break # Test only the first value


@pytest.mark.asyncio
Expand All @@ -106,6 +110,9 @@ async def test_events_without_types(
_events_set_mock_response(httpx_mock, gateway_url)
resp = await service.jobs.events(**kwargs)
check_type(resp, Model)
async for item in resp:
check_type(item, Model)
break # Test only the first value


def _get_set_mock_response(httpx_mock: HTTPXMock, gateway_url: str, type: str, id: str):
Expand Down
2 changes: 1 addition & 1 deletion waylay-sdk-registry-types/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ src/waylay/services/registry/models/with_entity_attributes.py
src/waylay/services/registry/models/with_limit.py
src/waylay/services/registry/models/with_paging.py
src/waylay/services/registry/queries/__init__.py
src/waylay/services/registry/queries/default_api.py
src/waylay/services/registry/queries/about_api.py
src/waylay/services/registry/queries/jobs_api.py
src/waylay/services/registry/queries/model_functions_api.py
src/waylay/services/registry/queries/plug_functions_api.py
Expand Down
18 changes: 6 additions & 12 deletions waylay-sdk-registry-types/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,16 @@ from waylay.sdk.api.api_exceptions import ApiError
waylay_client = WaylayClient.from_profile()

# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-registry-types` is installed
from waylay.services.registry.models.function_type import FunctionType
from waylay.services.registry.models.job_state_result import JobStateResult
from waylay.services.registry.models.job_type_schema import JobTypeSchema
from waylay.services.registry.models.jobs_response import JobsResponse
from waylay.services.registry.models.root_page_response import RootPageResponse
try:
# List Jobs
# calls `GET /registry/v2/jobs/`
api_response = await waylay_client.registry.jobs.list(
# query parameters:
query = {
},
# Get Service Status
# calls `GET /registry/v2/`
api_response = await waylay_client.registry.about.get(
)
print("The response of registry.jobs.list:\n")
print("The response of registry.about.get:\n")
pprint(api_response)
except ApiError as e:
print("Exception when calling registry.jobs.list: %s\n" % e)
print("Exception when calling registry.about.get: %s\n" % e)
```


Expand Down
6 changes: 3 additions & 3 deletions waylay-sdk-registry-types/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ build-backend = "setuptools.build_meta"

[project]
name = "waylay-sdk-registry-types"
version = "2.12.4b20240410"
version = "2.12.4"
description = "Waylay Function Registry Types "
authors = [
{ name = "Waylay", email = "[email protected]"}
]
keywords = ["Waylay Function Registry" , "Types"]
requires-python = ">= 3.9"
dependencies = [
"waylay-sdk-core ~= 0.1.0",
"waylay-sdk-registry == 2.12.4b20240410",
"waylay-sdk-core ~= 0.2.0",
"waylay-sdk-registry == 2.12.4",
"pydantic ~= 2.6",
"typing-extensions ~= 4.10",
"eval-type-backport ~= 0.1.3; python_version < '3.10'",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Do not edit the class manually.
"""

__version__ = "2.12.4b20240410"
__version__ = "2.12.4"

# import models into model package
from .active_event_data import ActiveEventData
Expand Down
2 changes: 1 addition & 1 deletion waylay-sdk-registry/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
LICENSE.txt
pyproject.toml
src/waylay/services/registry/api/__init__.py
src/waylay/services/registry/api/default_api.py
src/waylay/services/registry/api/about_api.py
src/waylay/services/registry/api/jobs_api.py
src/waylay/services/registry/api/model_functions_api.py
src/waylay/services/registry/api/plug_functions_api.py
Expand Down
18 changes: 6 additions & 12 deletions waylay-sdk-registry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,16 @@ from waylay.sdk.api.api_exceptions import ApiError
waylay_client = WaylayClient.from_profile()

# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-registry-types` is installed
from waylay.services.registry.models.function_type import FunctionType
from waylay.services.registry.models.job_state_result import JobStateResult
from waylay.services.registry.models.job_type_schema import JobTypeSchema
from waylay.services.registry.models.jobs_response import JobsResponse
from waylay.services.registry.models.root_page_response import RootPageResponse
try:
# List Jobs
# calls `GET /registry/v2/jobs/`
api_response = await waylay_client.registry.jobs.list(
# query parameters:
query = {
},
# Get Service Status
# calls `GET /registry/v2/`
api_response = await waylay_client.registry.about.get(
)
print("The response of registry.jobs.list:\n")
print("The response of registry.about.get:\n")
pprint(api_response)
except ApiError as e:
print("Exception when calling registry.jobs.list: %s\n" % e)
print("Exception when calling registry.about.get: %s\n" % e)
```


Expand Down
Loading