/frontend/grant endpoint (#992)

This commit is contained in:
Michael Quigley
2025-06-24 16:54:21 -04:00
parent 1ac77fa5b9
commit eafaf56f13
34 changed files with 3014 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ README.md
docs/Access201Response.md
docs/AccessRequest.md
docs/AccountApi.md
docs/AddFrontendGrantRequest.md
docs/AddOrganizationMemberRequest.md
docs/AdminApi.md
docs/AgentApi.md
@@ -74,6 +75,7 @@ test/__init__.py
test/test_access201_response.py
test/test_access_request.py
test/test_account_api.py
test/test_add_frontend_grant_request.py
test/test_add_organization_member_request.py
test/test_admin_api.py
test/test_agent_api.py
@@ -154,6 +156,7 @@ zrok_api/exceptions.py
zrok_api/models/__init__.py
zrok_api/models/access201_response.py
zrok_api/models/access_request.py
zrok_api/models/add_frontend_grant_request.py
zrok_api/models/add_organization_member_request.py
zrok_api/models/auth_user.py
zrok_api/models/change_password_request.py

View File

@@ -100,12 +100,14 @@ Class | Method | HTTP request | Description
*AccountApi* | [**reset_password**](docs/AccountApi.md#reset_password) | **POST** /resetPassword |
*AccountApi* | [**reset_password_request**](docs/AccountApi.md#reset_password_request) | **POST** /resetPasswordRequest |
*AccountApi* | [**verify**](docs/AccountApi.md#verify) | **POST** /verify |
*AdminApi* | [**add_frontend_grant**](docs/AdminApi.md#add_frontend_grant) | **POST** /frontend/grant |
*AdminApi* | [**add_organization_member**](docs/AdminApi.md#add_organization_member) | **POST** /organization/add |
*AdminApi* | [**create_account**](docs/AdminApi.md#create_account) | **POST** /account |
*AdminApi* | [**create_frontend**](docs/AdminApi.md#create_frontend) | **POST** /frontend |
*AdminApi* | [**create_identity**](docs/AdminApi.md#create_identity) | **POST** /identity |
*AdminApi* | [**create_organization**](docs/AdminApi.md#create_organization) | **POST** /organization |
*AdminApi* | [**delete_frontend**](docs/AdminApi.md#delete_frontend) | **DELETE** /frontend |
*AdminApi* | [**delete_frontend_grant**](docs/AdminApi.md#delete_frontend_grant) | **DELETE** /frontend/grant |
*AdminApi* | [**delete_organization**](docs/AdminApi.md#delete_organization) | **DELETE** /organization |
*AdminApi* | [**grants**](docs/AdminApi.md#grants) | **POST** /grants |
*AdminApi* | [**invite_token_generate**](docs/AdminApi.md#invite_token_generate) | **POST** /invite/token/generate |
@@ -152,6 +154,7 @@ Class | Method | HTTP request | Description
- [Access201Response](docs/Access201Response.md)
- [AccessRequest](docs/AccessRequest.md)
- [AddFrontendGrantRequest](docs/AddFrontendGrantRequest.md)
- [AddOrganizationMemberRequest](docs/AddOrganizationMemberRequest.md)
- [AuthUser](docs/AuthUser.md)
- [ChangePasswordRequest](docs/ChangePasswordRequest.md)

View File

@@ -0,0 +1,30 @@
# AddFrontendGrantRequest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**frontend_token** | **str** | | [optional]
**email** | **str** | | [optional]
## Example
```python
from zrok_api.models.add_frontend_grant_request import AddFrontendGrantRequest
# TODO update the JSON string below
json = "{}"
# create an instance of AddFrontendGrantRequest from a JSON string
add_frontend_grant_request_instance = AddFrontendGrantRequest.from_json(json)
# print the JSON string representation of the object
print(AddFrontendGrantRequest.to_json())
# convert the object into a dict
add_frontend_grant_request_dict = add_frontend_grant_request_instance.to_dict()
# create an instance of AddFrontendGrantRequest from a dict
add_frontend_grant_request_from_dict = AddFrontendGrantRequest.from_dict(add_frontend_grant_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)

View File

@@ -4,12 +4,14 @@ All URIs are relative to */api/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**add_frontend_grant**](AdminApi.md#add_frontend_grant) | **POST** /frontend/grant |
[**add_organization_member**](AdminApi.md#add_organization_member) | **POST** /organization/add |
[**create_account**](AdminApi.md#create_account) | **POST** /account |
[**create_frontend**](AdminApi.md#create_frontend) | **POST** /frontend |
[**create_identity**](AdminApi.md#create_identity) | **POST** /identity |
[**create_organization**](AdminApi.md#create_organization) | **POST** /organization |
[**delete_frontend**](AdminApi.md#delete_frontend) | **DELETE** /frontend |
[**delete_frontend_grant**](AdminApi.md#delete_frontend_grant) | **DELETE** /frontend/grant |
[**delete_organization**](AdminApi.md#delete_organization) | **DELETE** /organization |
[**grants**](AdminApi.md#grants) | **POST** /grants |
[**invite_token_generate**](AdminApi.md#invite_token_generate) | **POST** /invite/token/generate |
@@ -20,6 +22,80 @@ Method | HTTP request | Description
[**update_frontend**](AdminApi.md#update_frontend) | **PATCH** /frontend |
# **add_frontend_grant**
> add_frontend_grant(body=body)
### Example
* Api Key Authentication (key):
```python
import zrok_api
from zrok_api.models.add_frontend_grant_request import AddFrontendGrantRequest
from zrok_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to /api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = zrok_api.Configuration(
host = "/api/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: key
configuration.api_key['key'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['key'] = 'Bearer'
# Enter a context with an instance of the API client
with zrok_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = zrok_api.AdminApi(api_client)
body = zrok_api.AddFrontendGrantRequest() # AddFrontendGrantRequest | (optional)
try:
api_instance.add_frontend_grant(body=body)
except Exception as e:
print("Exception when calling AdminApi->add_frontend_grant: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**AddFrontendGrantRequest**](AddFrontendGrantRequest.md)| | [optional]
### Return type
void (empty response body)
### Authorization
[key](../README.md#key)
### HTTP request headers
- **Content-Type**: application/zrok.v1+json
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | ok | - |
**401** | unauthorized | - |
**500** | internal server 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)
# **add_organization_member**
> add_organization_member(body=body)
@@ -480,6 +556,80 @@ void (empty response body)
[[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)
# **delete_frontend_grant**
> delete_frontend_grant(body=body)
### Example
* Api Key Authentication (key):
```python
import zrok_api
from zrok_api.models.add_frontend_grant_request import AddFrontendGrantRequest
from zrok_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to /api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = zrok_api.Configuration(
host = "/api/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: key
configuration.api_key['key'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['key'] = 'Bearer'
# Enter a context with an instance of the API client
with zrok_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = zrok_api.AdminApi(api_client)
body = zrok_api.AddFrontendGrantRequest() # AddFrontendGrantRequest | (optional)
try:
api_instance.delete_frontend_grant(body=body)
except Exception as e:
print("Exception when calling AdminApi->delete_frontend_grant: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**AddFrontendGrantRequest**](AddFrontendGrantRequest.md)| | [optional]
### Return type
void (empty response body)
### Authorization
[key](../README.md#key)
### HTTP request headers
- **Content-Type**: application/zrok.v1+json
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | ok | - |
**401** | unauthorized | - |
**500** | internal server 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)
# **delete_organization**
> delete_organization(body=body)

View File

@@ -0,0 +1,52 @@
# coding: utf-8
"""
zrok
zrok client access
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 zrok_api.models.add_frontend_grant_request import AddFrontendGrantRequest
class TestAddFrontendGrantRequest(unittest.TestCase):
"""AddFrontendGrantRequest unit test stubs"""
def setUp(self):
pass
def tearDown(self):
pass
def make_instance(self, include_optional) -> AddFrontendGrantRequest:
"""Test AddFrontendGrantRequest
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 `AddFrontendGrantRequest`
"""
model = AddFrontendGrantRequest()
if include_optional:
return AddFrontendGrantRequest(
frontend_token = '',
email = ''
)
else:
return AddFrontendGrantRequest(
)
"""
def testAddFrontendGrantRequest(self):
"""Test AddFrontendGrantRequest"""
# inst_req_only = self.make_instance(include_optional=False)
# inst_req_and_optional = self.make_instance(include_optional=True)
if __name__ == '__main__':
unittest.main()

View File

@@ -26,6 +26,12 @@ class TestAdminApi(unittest.TestCase):
def tearDown(self) -> None:
pass
def test_add_frontend_grant(self) -> None:
"""Test case for add_frontend_grant
"""
pass
def test_add_organization_member(self) -> None:
"""Test case for add_organization_member
@@ -62,6 +68,12 @@ class TestAdminApi(unittest.TestCase):
"""
pass
def test_delete_frontend_grant(self) -> None:
"""Test case for delete_frontend_grant
"""
pass
def test_delete_organization(self) -> None:
"""Test case for delete_organization

View File

@@ -38,6 +38,7 @@ from zrok_api.exceptions import ApiException
# import models into sdk package
from zrok_api.models.access201_response import Access201Response
from zrok_api.models.access_request import AccessRequest
from zrok_api.models.add_frontend_grant_request import AddFrontendGrantRequest
from zrok_api.models.add_organization_member_request import AddOrganizationMemberRequest
from zrok_api.models.auth_user import AuthUser
from zrok_api.models.change_password_request import ChangePasswordRequest

View File

@@ -17,6 +17,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union
from typing_extensions import Annotated
from typing import List, Optional
from zrok_api.models.add_frontend_grant_request import AddFrontendGrantRequest
from zrok_api.models.add_organization_member_request import AddOrganizationMemberRequest
from zrok_api.models.create_frontend201_response import CreateFrontend201Response
from zrok_api.models.create_frontend_request import CreateFrontendRequest
@@ -52,6 +53,276 @@ class AdminApi:
self.api_client = api_client
@validate_call
def add_frontend_grant(
self,
body: Optional[AddFrontendGrantRequest] = 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,
) -> None:
"""add_frontend_grant
:param body:
:type body: AddFrontendGrantRequest
: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._add_frontend_grant_serialize(
body=body,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': None,
'401': None,
'500': None,
}
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 add_frontend_grant_with_http_info(
self,
body: Optional[AddFrontendGrantRequest] = 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[None]:
"""add_frontend_grant
:param body:
:type body: AddFrontendGrantRequest
: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._add_frontend_grant_serialize(
body=body,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': None,
'401': None,
'500': None,
}
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 add_frontend_grant_without_preload_content(
self,
body: Optional[AddFrontendGrantRequest] = 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:
"""add_frontend_grant
:param body:
:type body: AddFrontendGrantRequest
: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._add_frontend_grant_serialize(
body=body,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': None,
'401': None,
'500': None,
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _add_frontend_grant_serialize(
self,
body,
_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
# process the form parameters
# process the body parameter
if body is not None:
_body_params = body
# 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/zrok.v1+json'
]
)
)
if _default_content_type is not None:
_header_params['Content-Type'] = _default_content_type
# authentication setting
_auth_settings: List[str] = [
'key'
]
return self.api_client.param_serialize(
method='POST',
resource_path='/frontend/grant',
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 add_organization_member(
self,
@@ -1712,6 +1983,276 @@ class AdminApi:
@validate_call
def delete_frontend_grant(
self,
body: Optional[AddFrontendGrantRequest] = 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,
) -> None:
"""delete_frontend_grant
:param body:
:type body: AddFrontendGrantRequest
: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._delete_frontend_grant_serialize(
body=body,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': None,
'401': None,
'500': None,
}
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 delete_frontend_grant_with_http_info(
self,
body: Optional[AddFrontendGrantRequest] = 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[None]:
"""delete_frontend_grant
:param body:
:type body: AddFrontendGrantRequest
: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._delete_frontend_grant_serialize(
body=body,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': None,
'401': None,
'500': None,
}
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 delete_frontend_grant_without_preload_content(
self,
body: Optional[AddFrontendGrantRequest] = 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:
"""delete_frontend_grant
:param body:
:type body: AddFrontendGrantRequest
: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._delete_frontend_grant_serialize(
body=body,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': None,
'401': None,
'500': None,
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _delete_frontend_grant_serialize(
self,
body,
_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
# process the form parameters
# process the body parameter
if body is not None:
_body_params = body
# 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/zrok.v1+json'
]
)
)
if _default_content_type is not None:
_header_params['Content-Type'] = _default_content_type
# authentication setting
_auth_settings: List[str] = [
'key'
]
return self.api_client.param_serialize(
method='DELETE',
resource_path='/frontend/grant',
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 delete_organization(
self,

View File

@@ -16,6 +16,7 @@
# import models into model package
from zrok_api.models.access201_response import Access201Response
from zrok_api.models.access_request import AccessRequest
from zrok_api.models.add_frontend_grant_request import AddFrontendGrantRequest
from zrok_api.models.add_organization_member_request import AddOrganizationMemberRequest
from zrok_api.models.auth_user import AuthUser
from zrok_api.models.change_password_request import ChangePasswordRequest

View File

@@ -0,0 +1,89 @@
# coding: utf-8
"""
zrok
zrok client access
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 import Optional, Set
from typing_extensions import Self
class AddFrontendGrantRequest(BaseModel):
"""
AddFrontendGrantRequest
""" # noqa: E501
frontend_token: Optional[StrictStr] = Field(default=None, alias="frontendToken")
email: Optional[StrictStr] = None
__properties: ClassVar[List[str]] = ["frontendToken", "email"]
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 AddFrontendGrantRequest 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 AddFrontendGrantRequest from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"frontendToken": obj.get("frontendToken"),
"email": obj.get("email")
})
return _obj