diff --git a/rest_client_zrok/admin/admin_client.go b/rest_client_zrok/admin/admin_client.go index 529e984f..014cd73c 100644 --- a/rest_client_zrok/admin/admin_client.go +++ b/rest_client_zrok/admin/admin_client.go @@ -30,6 +30,8 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { + AddFrontendGrant(params *AddFrontendGrantParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AddFrontendGrantOK, error) + AddOrganizationMember(params *AddOrganizationMemberParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AddOrganizationMemberCreated, error) AddSecretsAccess(params *AddSecretsAccessParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AddSecretsAccessOK, error) @@ -42,8 +44,12 @@ type ClientService interface { CreateOrganization(params *CreateOrganizationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateOrganizationCreated, error) + DeleteAccount(params *DeleteAccountParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAccountOK, error) + DeleteFrontend(params *DeleteFrontendParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteFrontendOK, error) + DeleteFrontendGrant(params *DeleteFrontendGrantParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteFrontendGrantOK, error) + DeleteIdentity(params *DeleteIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIdentityOK, error) DeleteOrganization(params *DeleteOrganizationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteOrganizationOK, error) @@ -67,6 +73,45 @@ type ClientService interface { SetTransport(transport runtime.ClientTransport) } +/* +AddFrontendGrant add frontend grant API +*/ +func (a *Client) AddFrontendGrant(params *AddFrontendGrantParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AddFrontendGrantOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAddFrontendGrantParams() + } + op := &runtime.ClientOperation{ + ID: "addFrontendGrant", + Method: "POST", + PathPattern: "/frontend/grant", + ProducesMediaTypes: []string{"application/zrok.v1+json"}, + ConsumesMediaTypes: []string{"application/zrok.v1+json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &AddFrontendGrantReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*AddFrontendGrantOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for addFrontendGrant: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* AddOrganizationMember add organization member API */ @@ -301,6 +346,45 @@ func (a *Client) CreateOrganization(params *CreateOrganizationParams, authInfo r panic(msg) } +/* +DeleteAccount delete account API +*/ +func (a *Client) DeleteAccount(params *DeleteAccountParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAccountOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteAccountParams() + } + op := &runtime.ClientOperation{ + ID: "deleteAccount", + Method: "DELETE", + PathPattern: "/account", + ProducesMediaTypes: []string{"application/zrok.v1+json"}, + ConsumesMediaTypes: []string{"application/zrok.v1+json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeleteAccountReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteAccountOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for deleteAccount: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* DeleteFrontend delete frontend API */ @@ -340,6 +424,45 @@ func (a *Client) DeleteFrontend(params *DeleteFrontendParams, authInfo runtime.C panic(msg) } +/* +DeleteFrontendGrant delete frontend grant API +*/ +func (a *Client) DeleteFrontendGrant(params *DeleteFrontendGrantParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteFrontendGrantOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteFrontendGrantParams() + } + op := &runtime.ClientOperation{ + ID: "deleteFrontendGrant", + Method: "DELETE", + PathPattern: "/frontend/grant", + ProducesMediaTypes: []string{"application/zrok.v1+json"}, + ConsumesMediaTypes: []string{"application/zrok.v1+json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeleteFrontendGrantReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteFrontendGrantOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for deleteFrontendGrant: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* DeleteIdentity delete identity API */ diff --git a/rest_server_zrok/operations/zrok_api.go b/rest_server_zrok/operations/zrok_api.go index d3516a6a..0d207e59 100644 --- a/rest_server_zrok/operations/zrok_api.go +++ b/rest_server_zrok/operations/zrok_api.go @@ -53,6 +53,9 @@ func NewZrokAPI(spec *loads.Document) *ZrokAPI { ShareAccessHandler: share.AccessHandlerFunc(func(params share.AccessParams, principal *rest_model_zrok.Principal) middleware.Responder { return middleware.NotImplemented("operation share.Access has not yet been implemented") }), + AdminAddFrontendGrantHandler: admin.AddFrontendGrantHandlerFunc(func(params admin.AddFrontendGrantParams, principal *rest_model_zrok.Principal) middleware.Responder { + return middleware.NotImplemented("operation admin.AddFrontendGrant has not yet been implemented") + }), AdminAddOrganizationMemberHandler: admin.AddOrganizationMemberHandlerFunc(func(params admin.AddOrganizationMemberParams, principal *rest_model_zrok.Principal) middleware.Responder { return middleware.NotImplemented("operation admin.AddOrganizationMember has not yet been implemented") }), @@ -80,9 +83,15 @@ func NewZrokAPI(spec *loads.Document) *ZrokAPI { AdminCreateOrganizationHandler: admin.CreateOrganizationHandlerFunc(func(params admin.CreateOrganizationParams, principal *rest_model_zrok.Principal) middleware.Responder { return middleware.NotImplemented("operation admin.CreateOrganization has not yet been implemented") }), + AdminDeleteAccountHandler: admin.DeleteAccountHandlerFunc(func(params admin.DeleteAccountParams, principal *rest_model_zrok.Principal) middleware.Responder { + return middleware.NotImplemented("operation admin.DeleteAccount has not yet been implemented") + }), AdminDeleteFrontendHandler: admin.DeleteFrontendHandlerFunc(func(params admin.DeleteFrontendParams, principal *rest_model_zrok.Principal) middleware.Responder { return middleware.NotImplemented("operation admin.DeleteFrontend has not yet been implemented") }), + AdminDeleteFrontendGrantHandler: admin.DeleteFrontendGrantHandlerFunc(func(params admin.DeleteFrontendGrantParams, principal *rest_model_zrok.Principal) middleware.Responder { + return middleware.NotImplemented("operation admin.DeleteFrontendGrant has not yet been implemented") + }), AdminDeleteIdentityHandler: admin.DeleteIdentityHandlerFunc(func(params admin.DeleteIdentityParams, principal *rest_model_zrok.Principal) middleware.Responder { return middleware.NotImplemented("operation admin.DeleteIdentity has not yet been implemented") }), @@ -273,6 +282,8 @@ type ZrokAPI struct { // ShareAccessHandler sets the operation handler for the access operation ShareAccessHandler share.AccessHandler + // AdminAddFrontendGrantHandler sets the operation handler for the add frontend grant operation + AdminAddFrontendGrantHandler admin.AddFrontendGrantHandler // AdminAddOrganizationMemberHandler sets the operation handler for the add organization member operation AdminAddOrganizationMemberHandler admin.AddOrganizationMemberHandler // AdminAddSecretsAccessHandler sets the operation handler for the add secrets access operation @@ -291,8 +302,12 @@ type ZrokAPI struct { AdminCreateIdentityHandler admin.CreateIdentityHandler // AdminCreateOrganizationHandler sets the operation handler for the create organization operation AdminCreateOrganizationHandler admin.CreateOrganizationHandler + // AdminDeleteAccountHandler sets the operation handler for the delete account operation + AdminDeleteAccountHandler admin.DeleteAccountHandler // AdminDeleteFrontendHandler sets the operation handler for the delete frontend operation AdminDeleteFrontendHandler admin.DeleteFrontendHandler + // AdminDeleteFrontendGrantHandler sets the operation handler for the delete frontend grant operation + AdminDeleteFrontendGrantHandler admin.DeleteFrontendGrantHandler // AdminDeleteIdentityHandler sets the operation handler for the delete identity operation AdminDeleteIdentityHandler admin.DeleteIdentityHandler // AdminDeleteOrganizationHandler sets the operation handler for the delete organization operation @@ -469,6 +484,9 @@ func (o *ZrokAPI) Validate() error { if o.ShareAccessHandler == nil { unregistered = append(unregistered, "share.AccessHandler") } + if o.AdminAddFrontendGrantHandler == nil { + unregistered = append(unregistered, "admin.AddFrontendGrantHandler") + } if o.AdminAddOrganizationMemberHandler == nil { unregistered = append(unregistered, "admin.AddOrganizationMemberHandler") } @@ -496,9 +514,15 @@ func (o *ZrokAPI) Validate() error { if o.AdminCreateOrganizationHandler == nil { unregistered = append(unregistered, "admin.CreateOrganizationHandler") } + if o.AdminDeleteAccountHandler == nil { + unregistered = append(unregistered, "admin.DeleteAccountHandler") + } if o.AdminDeleteFrontendHandler == nil { unregistered = append(unregistered, "admin.DeleteFrontendHandler") } + if o.AdminDeleteFrontendGrantHandler == nil { + unregistered = append(unregistered, "admin.DeleteFrontendGrantHandler") + } if o.AdminDeleteIdentityHandler == nil { unregistered = append(unregistered, "admin.DeleteIdentityHandler") } @@ -743,6 +767,10 @@ func (o *ZrokAPI) initHandlerCache() { if o.handlers["POST"] == nil { o.handlers["POST"] = make(map[string]http.Handler) } + o.handlers["POST"]["/frontend/grant"] = admin.NewAddFrontendGrant(o.context, o.AdminAddFrontendGrantHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } o.handlers["POST"]["/organization/add"] = admin.NewAddOrganizationMember(o.context, o.AdminAddOrganizationMemberHandler) if o.handlers["POST"] == nil { o.handlers["POST"] = make(map[string]http.Handler) @@ -779,10 +807,18 @@ func (o *ZrokAPI) initHandlerCache() { if o.handlers["DELETE"] == nil { o.handlers["DELETE"] = make(map[string]http.Handler) } + o.handlers["DELETE"]["/account"] = admin.NewDeleteAccount(o.context, o.AdminDeleteAccountHandler) + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } o.handlers["DELETE"]["/frontend"] = admin.NewDeleteFrontend(o.context, o.AdminDeleteFrontendHandler) if o.handlers["DELETE"] == nil { o.handlers["DELETE"] = make(map[string]http.Handler) } + o.handlers["DELETE"]["/frontend/grant"] = admin.NewDeleteFrontendGrant(o.context, o.AdminDeleteFrontendGrantHandler) + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } o.handlers["DELETE"]["/identity"] = admin.NewDeleteIdentity(o.context, o.AdminDeleteIdentityHandler) if o.handlers["DELETE"] == nil { o.handlers["DELETE"] = make(map[string]http.Handler) diff --git a/sdk/nodejs/sdk/src/api/apis/AdminApi.ts b/sdk/nodejs/sdk/src/api/apis/AdminApi.ts index a578d6c5..85a27d68 100644 --- a/sdk/nodejs/sdk/src/api/apis/AdminApi.ts +++ b/sdk/nodejs/sdk/src/api/apis/AdminApi.ts @@ -15,6 +15,7 @@ import * as runtime from '../runtime'; import type { + AddFrontendGrantRequest, AddOrganizationMemberRequest, AddSecretsAccessRequest, CreateFrontend201Response, @@ -35,6 +36,8 @@ import type { Verify200Response, } from '../models/index'; import { + AddFrontendGrantRequestFromJSON, + AddFrontendGrantRequestToJSON, AddOrganizationMemberRequestFromJSON, AddOrganizationMemberRequestToJSON, AddSecretsAccessRequestFromJSON, @@ -73,6 +76,10 @@ import { Verify200ResponseToJSON, } from '../models/index'; +export interface AddFrontendGrantOperationRequest { + body?: AddFrontendGrantRequest; +} + export interface AddOrganizationMemberOperationRequest { body?: AddOrganizationMemberRequest; } @@ -97,10 +104,18 @@ export interface CreateOrganizationOperationRequest { body?: CreateOrganizationRequest; } +export interface DeleteAccountRequest { + body?: Verify200Response; +} + export interface DeleteFrontendRequest { body?: CreateFrontend201Response; } +export interface DeleteFrontendGrantRequest { + body?: AddFrontendGrantRequest; +} + export interface DeleteIdentityOperationRequest { body?: DeleteIdentityRequest; } @@ -138,6 +153,36 @@ export interface UpdateFrontendOperationRequest { */ export class AdminApi extends runtime.BaseAPI { + /** + */ + async addFrontendGrantRaw(requestParameters: AddFrontendGrantOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/zrok.v1+json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-token"] = await this.configuration.apiKey("x-token"); // key authentication + } + + const response = await this.request({ + path: `/frontend/grant`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: AddFrontendGrantRequestToJSON(requestParameters['body']), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + */ + async addFrontendGrant(requestParameters: AddFrontendGrantOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.addFrontendGrantRaw(requestParameters, initOverrides); + } + /** */ async addOrganizationMemberRaw(requestParameters: AddOrganizationMemberOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { @@ -322,6 +367,36 @@ export class AdminApi extends runtime.BaseAPI { return await response.value(); } + /** + */ + async deleteAccountRaw(requestParameters: DeleteAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/zrok.v1+json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-token"] = await this.configuration.apiKey("x-token"); // key authentication + } + + const response = await this.request({ + path: `/account`, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + body: Verify200ResponseToJSON(requestParameters['body']), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + */ + async deleteAccount(requestParameters: DeleteAccountRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteAccountRaw(requestParameters, initOverrides); + } + /** */ async deleteFrontendRaw(requestParameters: DeleteFrontendRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { @@ -352,6 +427,36 @@ export class AdminApi extends runtime.BaseAPI { await this.deleteFrontendRaw(requestParameters, initOverrides); } + /** + */ + async deleteFrontendGrantRaw(requestParameters: DeleteFrontendGrantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/zrok.v1+json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-token"] = await this.configuration.apiKey("x-token"); // key authentication + } + + const response = await this.request({ + path: `/frontend/grant`, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + body: AddFrontendGrantRequestToJSON(requestParameters['body']), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + */ + async deleteFrontendGrant(requestParameters: DeleteFrontendGrantRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteFrontendGrantRaw(requestParameters, initOverrides); + } + /** */ async deleteIdentityRaw(requestParameters: DeleteIdentityOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { diff --git a/sdk/python/src/README.md b/sdk/python/src/README.md index 03df5445..e3666820 100644 --- a/sdk/python/src/README.md +++ b/sdk/python/src/README.md @@ -100,13 +100,16 @@ 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* | [**add_secrets_access**](docs/AdminApi.md#add_secrets_access) | **POST** /secrets/access | *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_account**](docs/AdminApi.md#delete_account) | **DELETE** /account | *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_identity**](docs/AdminApi.md#delete_identity) | **DELETE** /identity | *AdminApi* | [**delete_organization**](docs/AdminApi.md#delete_organization) | **DELETE** /organization | *AdminApi* | [**delete_secrets_access**](docs/AdminApi.md#delete_secrets_access) | **DELETE** /secrets/access | @@ -155,6 +158,7 @@ Class | Method | HTTP request | Description - [Access201Response](docs/Access201Response.md) - [AccessRequest](docs/AccessRequest.md) + - [AddFrontendGrantRequest](docs/AddFrontendGrantRequest.md) - [AddOrganizationMemberRequest](docs/AddOrganizationMemberRequest.md) - [AddSecretsAccessRequest](docs/AddSecretsAccessRequest.md) - [AuthUser](docs/AuthUser.md) diff --git a/sdk/python/src/docs/AdminApi.md b/sdk/python/src/docs/AdminApi.md index f248bd6f..cd545883 100644 --- a/sdk/python/src/docs/AdminApi.md +++ b/sdk/python/src/docs/AdminApi.md @@ -4,13 +4,16 @@ 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 | [**add_secrets_access**](AdminApi.md#add_secrets_access) | **POST** /secrets/access | [**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_account**](AdminApi.md#delete_account) | **DELETE** /account | [**delete_frontend**](AdminApi.md#delete_frontend) | **DELETE** /frontend | +[**delete_frontend_grant**](AdminApi.md#delete_frontend_grant) | **DELETE** /frontend/grant | [**delete_identity**](AdminApi.md#delete_identity) | **DELETE** /identity | [**delete_organization**](AdminApi.md#delete_organization) | **DELETE** /organization | [**delete_secrets_access**](AdminApi.md#delete_secrets_access) | **DELETE** /secrets/access | @@ -23,6 +26,81 @@ 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**: application/zrok.v1+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**404** | not found | - | +**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) @@ -483,6 +561,81 @@ Name | Type | Description | Notes [[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_account** +> delete_account(body=body) + +### Example + +* Api Key Authentication (key): + +```python +import zrok_api +from zrok_api.models.verify200_response import Verify200Response +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.Verify200Response() # Verify200Response | (optional) + + try: + api_instance.delete_account(body=body) + except Exception as e: + print("Exception when calling AdminApi->delete_account: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Verify200Response**](Verify200Response.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 | - | +**404** | not found | - | +**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_frontend** > delete_frontend(body=body) @@ -558,6 +711,81 @@ 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**: application/zrok.v1+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**404** | not found | - | +**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_identity** > delete_identity(body=body) diff --git a/sdk/python/src/test/test_admin_api.py b/sdk/python/src/test/test_admin_api.py index 53d83c21..57c596b5 100644 --- a/sdk/python/src/test/test_admin_api.py +++ b/sdk/python/src/test/test_admin_api.py @@ -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,12 +68,24 @@ class TestAdminApi(unittest.TestCase): """ pass + def test_delete_account(self) -> None: + """Test case for delete_account + + """ + pass + def test_delete_frontend(self) -> None: """Test case for delete_frontend """ pass + def test_delete_frontend_grant(self) -> None: + """Test case for delete_frontend_grant + + """ + pass + def test_delete_identity(self) -> None: """Test case for delete_identity diff --git a/sdk/python/src/zrok_api/api/admin_api.py b/sdk/python/src/zrok_api/api/admin_api.py index 5b45e248..70a94c21 100644 --- a/sdk/python/src/zrok_api/api/admin_api.py +++ b/sdk/python/src/zrok_api/api/admin_api.py @@ -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.add_secrets_access_request import AddSecretsAccessRequest from zrok_api.models.create_frontend201_response import CreateFrontend201Response @@ -54,6 +55,286 @@ 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, + '404': "str", + '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, + '404': "str", + '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, + '404': "str", + '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 `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/zrok.v1+json' + ] + ) + + # 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, @@ -1714,6 +1995,279 @@ class AdminApi: + @validate_call + def delete_account( + self, + body: Optional[Verify200Response] = 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_account + + + :param body: + :type body: Verify200Response + :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_account_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, + '404': 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_account_with_http_info( + self, + body: Optional[Verify200Response] = 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_account + + + :param body: + :type body: Verify200Response + :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_account_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, + '404': 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_account_without_preload_content( + self, + body: Optional[Verify200Response] = 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_account + + + :param body: + :type body: Verify200Response + :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_account_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, + '404': None, + '500': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_account_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='/account', + 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_frontend( self, @@ -1987,6 +2541,286 @@ 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, + '404': "str", + '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, + '404': "str", + '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, + '404': "str", + '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 `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/zrok.v1+json' + ] + ) + + # 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_identity( self, diff --git a/ui/src/api/apis/AdminApi.ts b/ui/src/api/apis/AdminApi.ts index a578d6c5..85a27d68 100644 --- a/ui/src/api/apis/AdminApi.ts +++ b/ui/src/api/apis/AdminApi.ts @@ -15,6 +15,7 @@ import * as runtime from '../runtime'; import type { + AddFrontendGrantRequest, AddOrganizationMemberRequest, AddSecretsAccessRequest, CreateFrontend201Response, @@ -35,6 +36,8 @@ import type { Verify200Response, } from '../models/index'; import { + AddFrontendGrantRequestFromJSON, + AddFrontendGrantRequestToJSON, AddOrganizationMemberRequestFromJSON, AddOrganizationMemberRequestToJSON, AddSecretsAccessRequestFromJSON, @@ -73,6 +76,10 @@ import { Verify200ResponseToJSON, } from '../models/index'; +export interface AddFrontendGrantOperationRequest { + body?: AddFrontendGrantRequest; +} + export interface AddOrganizationMemberOperationRequest { body?: AddOrganizationMemberRequest; } @@ -97,10 +104,18 @@ export interface CreateOrganizationOperationRequest { body?: CreateOrganizationRequest; } +export interface DeleteAccountRequest { + body?: Verify200Response; +} + export interface DeleteFrontendRequest { body?: CreateFrontend201Response; } +export interface DeleteFrontendGrantRequest { + body?: AddFrontendGrantRequest; +} + export interface DeleteIdentityOperationRequest { body?: DeleteIdentityRequest; } @@ -138,6 +153,36 @@ export interface UpdateFrontendOperationRequest { */ export class AdminApi extends runtime.BaseAPI { + /** + */ + async addFrontendGrantRaw(requestParameters: AddFrontendGrantOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/zrok.v1+json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-token"] = await this.configuration.apiKey("x-token"); // key authentication + } + + const response = await this.request({ + path: `/frontend/grant`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: AddFrontendGrantRequestToJSON(requestParameters['body']), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + */ + async addFrontendGrant(requestParameters: AddFrontendGrantOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.addFrontendGrantRaw(requestParameters, initOverrides); + } + /** */ async addOrganizationMemberRaw(requestParameters: AddOrganizationMemberOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { @@ -322,6 +367,36 @@ export class AdminApi extends runtime.BaseAPI { return await response.value(); } + /** + */ + async deleteAccountRaw(requestParameters: DeleteAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/zrok.v1+json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-token"] = await this.configuration.apiKey("x-token"); // key authentication + } + + const response = await this.request({ + path: `/account`, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + body: Verify200ResponseToJSON(requestParameters['body']), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + */ + async deleteAccount(requestParameters: DeleteAccountRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteAccountRaw(requestParameters, initOverrides); + } + /** */ async deleteFrontendRaw(requestParameters: DeleteFrontendRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { @@ -352,6 +427,36 @@ export class AdminApi extends runtime.BaseAPI { await this.deleteFrontendRaw(requestParameters, initOverrides); } + /** + */ + async deleteFrontendGrantRaw(requestParameters: DeleteFrontendGrantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/zrok.v1+json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-token"] = await this.configuration.apiKey("x-token"); // key authentication + } + + const response = await this.request({ + path: `/frontend/grant`, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + body: AddFrontendGrantRequestToJSON(requestParameters['body']), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + */ + async deleteFrontendGrant(requestParameters: DeleteFrontendGrantRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteFrontendGrantRaw(requestParameters, initOverrides); + } + /** */ async deleteIdentityRaw(requestParameters: DeleteIdentityOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> {